diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC.hs b/cabal-plugin/src/Distribution/Simple/UUAGC.hs
--- a/cabal-plugin/src/Distribution/Simple/UUAGC.hs
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC.hs
@@ -1,4 +1,5 @@
 module Distribution.Simple.UUAGC(uuagcUserHook
+                                ,uuagcUserHook'
                                 ,uuagc) where
 
 import Distribution.Simple.UUAGC.UUAGC
diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
--- a/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE CPP #-}
 
 module Distribution.Simple.UUAGC.UUAGC(uuagcUserHook,
+                                       uuagcUserHook',
                                        uuagc
                                       ) where
 import Distribution.Simple.BuildPaths (autogenModulesDir)
@@ -71,11 +72,16 @@
 agClass  = "x-agclass"
 
 uuagcUserHook :: UserHooks
-uuagcUserHook = simpleUserHooks {hookedPreProcessors = ("ag", uuagc):("lag",uuagc):knownSuffixHandlers
-                                ,buildHook = uuagcBuildHook
-                                ,postBuild = uuagcPostBuild
-                                }
+uuagcUserHook = uuagcUserHook' uuagcn
 
+uuagcUserHook' :: String -> UserHooks
+uuagcUserHook' uuagcPath = hooks where
+  hooks = simpleUserHooks { hookedPreProcessors = ("ag", ag):("lag",ag):knownSuffixHandlers
+                          , buildHook = uuagcBuildHook uuagcPath
+                          , postBuild = uuagcPostBuild
+                          }
+  ag = uuagc' uuagcPath
+
 originalPreBuild  = preBuild simpleUserHooks
 originalBuildHook = buildHook simpleUserHooks
 
@@ -123,11 +129,12 @@
 -- AG Files and theirs file dependencies in order to see if the latters
 -- are more updated that the formers, and if this is the case to
 -- update the AG File
-updateAGFile :: PackageDescription 
-             -> LocalBuildInfo 
+updateAGFile :: String
+             -> PackageDescription
+             -> LocalBuildInfo
              -> (FilePath, String)
              -> IO ()
-updateAGFile pkgDescr lbi (f, sp) = do
+updateAGFile uuagcPath pkgDescr lbi (f, sp) = do
   fileOpts <- readFileOptions
   let opts = case lookup f fileOpts of
                Nothing -> []
@@ -156,7 +163,8 @@
       do putErrorInfo ppOutput
          putErrorInfo ppError
          throwFailure
-  where newProcess mopts = createProcess $ (proc uuagcn (fromUUAGCOstoArgs mopts ++ ["--genfiledeps"
+  where newProcess mopts = createProcess $ (proc uuagcPath
+                                                        (fromUUAGCOstoArgs mopts ++ ["--genfiledeps"
                                                                                     ,"--=" ++ intercalate ":" [sp]
                                                                                     ,f
                                                                                     ]
@@ -208,12 +216,13 @@
                                                    ++ " is not defined."
 
 uuagcBuildHook
-  :: PackageDescription
+  :: String
+     -> PackageDescription
      -> LocalBuildInfo
      -> UserHooks
      -> BuildFlags
      -> IO ()
-uuagcBuildHook pd lbi uh bf = do
+uuagcBuildHook uuagcPath pd lbi uh bf = do
   let lib    = library pd
       exes   = executables pd
       bis    = map libBuildInfo (maybeToList lib) ++ map buildInfo exes
@@ -223,11 +232,11 @@
       let (notFound, opts) = getOptionsFromClass classes $ opt
       in do case buildVerbosity bf of
               Flag v | v >= verbose -> putStrLn ("options for " ++ filename opt ++ ": " ++ show opts)
-              _ -> return () 
+              _ -> return ()
             forM_ notFound (hPutStrLn stderr) >> return (normalise . filename $ opt, opts))
   writeFileOptions fileOptions
   let agflSP = map (id &&& dropFileName) $ nub $ getAGFileList options
-  mapM_ (updateAGFile pd lbi) agflSP
+  mapM_ (updateAGFile uuagcPath pd lbi) agflSP
   originalBuildHook pd lbi uh bf
 
 uuagcPostBuild _ _ _ _ = do
@@ -237,10 +246,14 @@
 getAGFileList :: AGFileOptions -> [FilePath]
 getAGFileList = map (normalise . filename)
 
-uuagc :: BuildInfo
+uuagc :: BuildInfo -> LocalBuildInfo -> PreProcessor
+uuagc = uuagc' uuagcn
+
+uuagc' :: String
+        -> BuildInfo
         -> LocalBuildInfo
         -> PreProcessor
-uuagc build local  =
+uuagc' uuagcPath build local  =
    PreProcessor {
      platformIndependent = True,
      runPreProcessor = mkSimplePreProcessor $ \ inFile outFile verbosity ->
@@ -254,10 +267,9 @@
                               search  = dropFileName inFile
                               options = fromUUAGCOstoArgs opts
                                         ++ ["-P" ++ search, "--output=" ++ outFile, inFile]
-                          (_,_,_,ph) <- createProcess (proc uuagcn options)
+                          (_,_,_,ph) <- createProcess (proc uuagcPath options)
                           eCode <- waitForProcess ph
                           case eCode of
                             ExitSuccess   -> return ()
                             ExitFailure _ -> throwFailure
                 }
-
diff --git a/src-derived/AG2AspectAG.hs b/src-derived/AG2AspectAG.hs
--- a/src-derived/AG2AspectAG.hs
+++ b/src-derived/AG2AspectAG.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (AG2AspectAG.ag)
+-- UUAGC 0.9.38.6 (AG2AspectAG.ag)
 module AG2AspectAG where
 {-# LINE 7 "AG2AspectAG.ag" #-}
 
diff --git a/src-derived/AbstractSyntax.hs b/src-derived/AbstractSyntax.hs
--- a/src-derived/AbstractSyntax.hs
+++ b/src-derived/AbstractSyntax.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (AbstractSyntax.ag)
+-- UUAGC 0.9.38.6 (AbstractSyntax.ag)
 module AbstractSyntax where
 {-# LINE 2 "AbstractSyntax.ag" #-}
 
diff --git a/src-derived/AbstractSyntaxDump.hs b/src-derived/AbstractSyntaxDump.hs
--- a/src-derived/AbstractSyntaxDump.hs
+++ b/src-derived/AbstractSyntaxDump.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (AbstractSyntaxDump.ag)
+-- UUAGC 0.9.38.6 (AbstractSyntaxDump.ag)
 module AbstractSyntaxDump where
 {-# LINE 6 "AbstractSyntaxDump.ag" #-}
 
diff --git a/src-derived/Code.hs b/src-derived/Code.hs
--- a/src-derived/Code.hs
+++ b/src-derived/Code.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (Code.ag)
+-- UUAGC 0.9.38.6 (Code.ag)
 module Code where
 {-# LINE 2 "Code.ag" #-}
 
diff --git a/src-derived/CodeSyntax.hs b/src-derived/CodeSyntax.hs
--- a/src-derived/CodeSyntax.hs
+++ b/src-derived/CodeSyntax.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (CodeSyntax.ag)
+-- UUAGC 0.9.38.6 (CodeSyntax.ag)
 module CodeSyntax where
 {-# LINE 2 "CodeSyntax.ag" #-}
 
diff --git a/src-derived/CodeSyntaxDump.hs b/src-derived/CodeSyntaxDump.hs
--- a/src-derived/CodeSyntaxDump.hs
+++ b/src-derived/CodeSyntaxDump.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (CodeSyntaxDump.ag)
+-- UUAGC 0.9.38.6 (CodeSyntaxDump.ag)
 module CodeSyntaxDump where
 {-# LINE 5 "CodeSyntaxDump.ag" #-}
 
diff --git a/src-derived/ConcreteSyntax.hs b/src-derived/ConcreteSyntax.hs
--- a/src-derived/ConcreteSyntax.hs
+++ b/src-derived/ConcreteSyntax.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (ConcreteSyntax.ag)
+-- UUAGC 0.9.38.6 (ConcreteSyntax.ag)
 module ConcreteSyntax where
 {-# LINE 2 "ConcreteSyntax.ag" #-}
 
diff --git a/src-derived/DeclBlocks.hs b/src-derived/DeclBlocks.hs
--- a/src-derived/DeclBlocks.hs
+++ b/src-derived/DeclBlocks.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (DeclBlocks.ag)
+-- UUAGC 0.9.38.6 (DeclBlocks.ag)
 module DeclBlocks where
 {-# LINE 2 "DeclBlocks.ag" #-}
 
diff --git a/src-derived/DefaultRules.hs b/src-derived/DefaultRules.hs
--- a/src-derived/DefaultRules.hs
+++ b/src-derived/DefaultRules.hs
@@ -1,6 +1,6 @@
 {-# OPTIONS_GHC -XBangPatterns #-}
 
--- UUAGC 0.9.38.2 (DefaultRules.ag)
+-- UUAGC 0.9.38.6 (DefaultRules.ag)
 module DefaultRules where
 {-# LINE 10 "DefaultRules.ag" #-}
 
@@ -61,14 +61,14 @@
                   | otherwise         =  con
        synonym    | con == "Cons"     = "(:)"
                   | con == "Nil"      = case lookup nt typeSyns of
-                                          Just (Map _ _)  -> "Map.empty"
-                                          Just (IntMap _) -> "IntMap.empty"
+                                          Just (Map _ _)  -> "Data.Map.empty"
+                                          Just (IntMap _) -> "Data.IntMap.empty"
                                           _               -> "[]"
                   | con == "Just"     = "Just"
                   | con == "Nothing"  = "Nothing"
                   | con == "Entry"    = case lookup nt typeSyns of
-                                          Just (Map _ _)  -> "Map.insert"
-                                          Just (IntMap _) -> "IntMap.insert"
+                                          Just (Map _ _)  -> "Data.Map.insert"
+                                          Just (IntMap _) -> "Data.IntMap.insert"
                   | otherwise         = normalName
 
 concatSeq = foldr (Seq.><) Seq.empty
diff --git a/src-derived/Desugar.hs b/src-derived/Desugar.hs
--- a/src-derived/Desugar.hs
+++ b/src-derived/Desugar.hs
@@ -1,6 +1,6 @@
 {-# OPTIONS_GHC -XBangPatterns #-}
 
--- UUAGC 0.9.38.1 (Desugar.ag)
+-- UUAGC 0.9.38.6 (Desugar.ag)
 module Desugar where
 {-# LINE 13 "Desugar.ag" #-}
 
diff --git a/src-derived/ErrorMessages.hs b/src-derived/ErrorMessages.hs
--- a/src-derived/ErrorMessages.hs
+++ b/src-derived/ErrorMessages.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (ErrorMessages.ag)
+-- UUAGC 0.9.38.6 (ErrorMessages.ag)
 module ErrorMessages where
 {-# LINE 2 "ErrorMessages.ag" #-}
 
diff --git a/src-derived/ExecutionPlan.hs b/src-derived/ExecutionPlan.hs
--- a/src-derived/ExecutionPlan.hs
+++ b/src-derived/ExecutionPlan.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.2 (ExecutionPlan.ag)
+-- UUAGC 0.9.38.6 (ExecutionPlan.ag)
 module ExecutionPlan where
 {-# LINE 2 "ExecutionPlan.ag" #-}
 
@@ -96,8 +96,9 @@
          child nonts          : ENonterminals 
          child typeSyns       : {TypeSyns}
          child wrappers       : {Set.Set NontermIdent}
+         child derivings      : {Derivings}
 -}
-data ExecutionPlan  = ExecutionPlan (ENonterminals ) (TypeSyns) ((Set.Set NontermIdent)) 
+data ExecutionPlan  = ExecutionPlan (ENonterminals ) (TypeSyns) ((Set.Set NontermIdent)) (Derivings) 
 -- Visit -------------------------------------------------------
 {-
    alternatives:
diff --git a/src-derived/ExecutionPlan2Hs.hs b/src-derived/ExecutionPlan2Hs.hs
--- a/src-derived/ExecutionPlan2Hs.hs
+++ b/src-derived/ExecutionPlan2Hs.hs
@@ -1,3717 +1,4744 @@
 
 
--- UUAGC 0.9.38.2 (ExecutionPlan2Hs.ag)
-module ExecutionPlan2Hs where
-{-# LINE 7 "ExecutionPlan2Hs.ag" #-}
-
-import ExecutionPlan
-import Pretty
-import PPUtil
-import Options
-import Data.Maybe
-import Debug.Trace
-
-import TokenDef
-import HsToken
-
-import qualified Data.Set as Set
-import qualified Data.Map as Map
-{-# LINE 20 "../src-derived/ExecutionPlan2Hs.hs" #-}
-
-{-# LINE 2 "./ExecutionPlan.ag" #-}
-
--- VisitSyntax.ag imports
-import Patterns    (Pattern(..),Patterns)
-import Expression  (Expression(..))
-import CommonTypes
-
-import qualified Data.Set as Set
-{-# LINE 30 "../src-derived/ExecutionPlan2Hs.hs" #-}
-
-{-# LINE 2 "./Patterns.ag" #-}
-
--- Patterns.ag imports
-import UU.Scanner.Position(Pos)
-import CommonTypes (ConstructorIdent,Identifier)
-{-# LINE 37 "../src-derived/ExecutionPlan2Hs.hs" #-}
-
-{-# LINE 2 "./Expression.ag" #-}
-
-import UU.Scanner.Position(Pos)
-import HsToken
-{-# LINE 43 "../src-derived/ExecutionPlan2Hs.hs" #-}
-
-{-# LINE 2 "./HsToken.ag" #-}
-
-import CommonTypes
-import UU.Scanner.Position(Pos)
-{-# LINE 49 "../src-derived/ExecutionPlan2Hs.hs" #-}
-{-# LINE 393 "ExecutionPlan2Hs.ag" #-}
-
-uwSetUnion :: (Ord a, Ord b) => Map.Map a (Set.Set b) -> Map.Map a (Set.Set b) -> Map.Map a (Set.Set b)
-uwSetUnion = Map.unionWith Set.union
-{-# LINE 54 "../src-derived/ExecutionPlan2Hs.hs" #-}
--- EChild ------------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         nt                   : NontermIdent
-      synthesized attributes:
-         argnames             :   PP_Doc  
-         argnamesw            :  PP_Doc 
-         argtps               :   PP_Doc  
-         childintros          : Map.Map Identifier PP_Doc
-         datatype             : PP_Doc
-         terminaldefs         : Set.Set String
-   alternatives:
-      alternative EChild:
-         child name           : {Identifier}
-         child tp             : {Type}
-         child virtual        : {Maybe (Maybe Type)}
-         visit 0:
-            local argnames    : _
--}
--- cata
-sem_EChild :: EChild  ->
-              T_EChild 
-sem_EChild (EChild _name _tp _virtual )  =
-    (sem_EChild_EChild _name _tp _virtual )
--- semantic domain
-newtype T_EChild  = T_EChild (NontermIdent ->
-                              ( (  PP_Doc  ),( PP_Doc ),(  PP_Doc  ),(Map.Map Identifier PP_Doc),PP_Doc,(Set.Set String)))
-data Inh_EChild  = Inh_EChild {nt_Inh_EChild :: NontermIdent}
-data Syn_EChild  = Syn_EChild {argnames_Syn_EChild :: (  PP_Doc  ),argnamesw_Syn_EChild :: ( PP_Doc ),argtps_Syn_EChild :: (  PP_Doc  ),childintros_Syn_EChild :: (Map.Map Identifier PP_Doc),datatype_Syn_EChild :: PP_Doc,terminaldefs_Syn_EChild :: (Set.Set String)}
-wrap_EChild :: T_EChild  ->
-               Inh_EChild  ->
-               Syn_EChild 
-wrap_EChild (T_EChild sem ) (Inh_EChild _lhsInt )  =
-    (let ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs) = sem _lhsInt 
-     in  (Syn_EChild _lhsOargnames _lhsOargnamesw _lhsOargtps _lhsOchildintros _lhsOdatatype _lhsOterminaldefs ))
-sem_EChild_EChild :: Identifier ->
-                     Type ->
-                     (Maybe (Maybe Type)) ->
-                     T_EChild 
-sem_EChild_EChild name_ tp_ virtual_  =
-    (T_EChild (\ _lhsInt ->
-                   (let _lhsOdatatype :: PP_Doc
-                        _lhsOargnamesw :: ( PP_Doc )
-                        _lhsOargtps :: (  PP_Doc  )
-                        _lhsOchildintros :: (Map.Map Identifier PP_Doc)
-                        _lhsOterminaldefs :: (Set.Set String)
-                        _lhsOargnames :: (  PP_Doc  )
-                        -- "ExecutionPlan2Hs.ag"(line 90, column 12)
-                        _lhsOdatatype =
-                            ({-# LINE 90 "ExecutionPlan2Hs.ag" #-}
-                             if isJust virtual_
-                             then empty
-                             else pp $ typeToHaskellString (Just _lhsInt) [] tp_
-                             {-# LINE 109 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- "ExecutionPlan2Hs.ag"(line 112, column 12)
-                        _lhsOargnamesw =
-                            ({-# LINE 112 "ExecutionPlan2Hs.ag" #-}
-                             if isJust virtual_
-                             then empty
-                             else if isNonterminal tp_
-                                 then "(" >#< "sem_" >|< extractNonterminal tp_ >#< "field_" >|< name_ >#< ")"
-                                 else text $ locname name_
-                             {-# LINE 119 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- "ExecutionPlan2Hs.ag"(line 256, column 12)
-                        _lhsOargtps =
-                            ({-# LINE 256 "ExecutionPlan2Hs.ag" #-}
-                             if isJust virtual_
-                             then empty
-                             else if isNonterminal tp_
-                                  then ("T_" >|< extractNonterminal tp_) >#< "->"
-                                  else (text $ show tp_) >#< "->"
-                             {-# LINE 129 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- "ExecutionPlan2Hs.ag"(line 261, column 12)
-                        _argnames =
-                            ({-# LINE 261 "ExecutionPlan2Hs.ag" #-}
-                             if isJust virtual_
-                             then empty
-                             else if isNonterminal tp_
-                                  then "field_" >|< name_
-                                  else text $ locname name_
-                             {-# LINE 139 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- "ExecutionPlan2Hs.ag"(line 327, column 12)
-                        _lhsOchildintros =
-                            ({-# LINE 327 "ExecutionPlan2Hs.ag" #-}
-                             Map.singleton name_ $ locname name_ >#< "<-" >#< "return" >#< "$" >#<
-                             if isJust virtual_
-                             then "sem_" >|< extractNonterminal tp_ >#< instname name_
-                             else "field_" >|< name_
-                             {-# LINE 148 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- "ExecutionPlan2Hs.ag"(line 404, column 12)
-                        _lhsOterminaldefs =
-                            ({-# LINE 404 "ExecutionPlan2Hs.ag" #-}
-                             if isJust virtual_ || isNonterminal tp_
-                             then Set.empty
-                             else Set.singleton $ locname name_
-                             {-# LINE 156 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (from local)
-                        _lhsOargnames =
-                            ({-# LINE 251 "ExecutionPlan2Hs.ag" #-}
-                             _argnames
-                             {-# LINE 162 "ExecutionPlan2Hs.hs" #-}
-                             )
-                    in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
--- EChildren ---------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         nt                   : NontermIdent
-      synthesized attributes:
-         argnames             :  [PP_Doc] 
-         argnamesw            : [PP_Doc]
-         argtps               :  [PP_Doc] 
-         childintros          : Map.Map Identifier PP_Doc
-         datatype             : [PP_Doc]
-         terminaldefs         : Set.Set String
-   alternatives:
-      alternative Cons:
-         child hd             : EChild 
-         child tl             : EChildren 
-      alternative Nil:
--}
--- cata
-sem_EChildren :: EChildren  ->
-                 T_EChildren 
-sem_EChildren list  =
-    (Prelude.foldr sem_EChildren_Cons sem_EChildren_Nil (Prelude.map sem_EChild list) )
--- semantic domain
-newtype T_EChildren  = T_EChildren (NontermIdent ->
-                                    ( ( [PP_Doc] ),([PP_Doc]),( [PP_Doc] ),(Map.Map Identifier PP_Doc),([PP_Doc]),(Set.Set String)))
-data Inh_EChildren  = Inh_EChildren {nt_Inh_EChildren :: NontermIdent}
-data Syn_EChildren  = Syn_EChildren {argnames_Syn_EChildren :: ( [PP_Doc] ),argnamesw_Syn_EChildren :: ([PP_Doc]),argtps_Syn_EChildren :: ( [PP_Doc] ),childintros_Syn_EChildren :: (Map.Map Identifier PP_Doc),datatype_Syn_EChildren :: ([PP_Doc]),terminaldefs_Syn_EChildren :: (Set.Set String)}
-wrap_EChildren :: T_EChildren  ->
-                  Inh_EChildren  ->
-                  Syn_EChildren 
-wrap_EChildren (T_EChildren sem ) (Inh_EChildren _lhsInt )  =
-    (let ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs) = sem _lhsInt 
-     in  (Syn_EChildren _lhsOargnames _lhsOargnamesw _lhsOargtps _lhsOchildintros _lhsOdatatype _lhsOterminaldefs ))
-sem_EChildren_Cons :: T_EChild  ->
-                      T_EChildren  ->
-                      T_EChildren 
-sem_EChildren_Cons (T_EChild hd_ ) (T_EChildren tl_ )  =
-    (T_EChildren (\ _lhsInt ->
-                      (let _lhsOargnames :: ( [PP_Doc] )
-                           _lhsOargnamesw :: ([PP_Doc])
-                           _lhsOargtps :: ( [PP_Doc] )
-                           _lhsOchildintros :: (Map.Map Identifier PP_Doc)
-                           _lhsOdatatype :: ([PP_Doc])
-                           _lhsOterminaldefs :: (Set.Set String)
-                           _hdOnt :: NontermIdent
-                           _tlOnt :: NontermIdent
-                           _hdIargnames :: (  PP_Doc  )
-                           _hdIargnamesw :: ( PP_Doc )
-                           _hdIargtps :: (  PP_Doc  )
-                           _hdIchildintros :: (Map.Map Identifier PP_Doc)
-                           _hdIdatatype :: PP_Doc
-                           _hdIterminaldefs :: (Set.Set String)
-                           _tlIargnames :: ( [PP_Doc] )
-                           _tlIargnamesw :: ([PP_Doc])
-                           _tlIargtps :: ( [PP_Doc] )
-                           _tlIchildintros :: (Map.Map Identifier PP_Doc)
-                           _tlIdatatype :: ([PP_Doc])
-                           _tlIterminaldefs :: (Set.Set String)
-                           -- use rule "ExecutionPlan2Hs.ag"(line 253, column 31)
-                           _lhsOargnames =
-                               ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
-                                _hdIargnames : _tlIargnames
-                                {-# LINE 228 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 109, column 32)
-                           _lhsOargnamesw =
-                               ({-# LINE 109 "ExecutionPlan2Hs.ag" #-}
-                                _hdIargnamesw : _tlIargnamesw
-                                {-# LINE 234 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 252, column 31)
-                           _lhsOargtps =
-                               ({-# LINE 252 "ExecutionPlan2Hs.ag" #-}
-                                _hdIargtps : _tlIargtps
-                                {-# LINE 240 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 318, column 41)
-                           _lhsOchildintros =
-                               ({-# LINE 318 "ExecutionPlan2Hs.ag" #-}
-                                _hdIchildintros `Map.union` _tlIchildintros
-                                {-# LINE 246 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 87, column 51)
-                           _lhsOdatatype =
-                               ({-# LINE 87 "ExecutionPlan2Hs.ag" #-}
-                                _hdIdatatype : _tlIdatatype
-                                {-# LINE 252 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 401, column 42)
-                           _lhsOterminaldefs =
-                               ({-# LINE 401 "ExecutionPlan2Hs.ag" #-}
-                                _hdIterminaldefs `Set.union` _tlIterminaldefs
-                                {-# LINE 258 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _hdOnt =
-                               ({-# LINE 86 "ExecutionPlan2Hs.ag" #-}
-                                _lhsInt
-                                {-# LINE 264 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _tlOnt =
-                               ({-# LINE 87 "ExecutionPlan2Hs.ag" #-}
-                                _lhsInt
-                                {-# LINE 270 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           ( _hdIargnames,_hdIargnamesw,_hdIargtps,_hdIchildintros,_hdIdatatype,_hdIterminaldefs) =
-                               hd_ _hdOnt 
-                           ( _tlIargnames,_tlIargnamesw,_tlIargtps,_tlIchildintros,_tlIdatatype,_tlIterminaldefs) =
-                               tl_ _tlOnt 
-                       in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
-sem_EChildren_Nil :: T_EChildren 
-sem_EChildren_Nil  =
-    (T_EChildren (\ _lhsInt ->
-                      (let _lhsOargnames :: ( [PP_Doc] )
-                           _lhsOargnamesw :: ([PP_Doc])
-                           _lhsOargtps :: ( [PP_Doc] )
-                           _lhsOchildintros :: (Map.Map Identifier PP_Doc)
-                           _lhsOdatatype :: ([PP_Doc])
-                           _lhsOterminaldefs :: (Set.Set String)
-                           -- use rule "ExecutionPlan2Hs.ag"(line 253, column 31)
-                           _lhsOargnames =
-                               ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
-                                []
-                                {-# LINE 290 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 109, column 32)
-                           _lhsOargnamesw =
-                               ({-# LINE 109 "ExecutionPlan2Hs.ag" #-}
-                                []
-                                {-# LINE 296 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 252, column 31)
-                           _lhsOargtps =
-                               ({-# LINE 252 "ExecutionPlan2Hs.ag" #-}
-                                []
-                                {-# LINE 302 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 318, column 41)
-                           _lhsOchildintros =
-                               ({-# LINE 318 "ExecutionPlan2Hs.ag" #-}
-                                Map.empty
-                                {-# LINE 308 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 87, column 51)
-                           _lhsOdatatype =
-                               ({-# LINE 87 "ExecutionPlan2Hs.ag" #-}
-                                []
-                                {-# LINE 314 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 401, column 42)
-                           _lhsOterminaldefs =
-                               ({-# LINE 401 "ExecutionPlan2Hs.ag" #-}
-                                Set.empty
-                                {-# LINE 320 "ExecutionPlan2Hs.hs" #-}
-                                )
-                       in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
--- ENonterminal ------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         inhmap               : Map.Map NontermIdent Attributes
-         options              : Options
-         synmap               : Map.Map NontermIdent Attributes
-         typeSyns             : TypeSyns
-         wrappers             : Set.Set NontermIdent
-      synthesized attributes:
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         debugoutput          : PP_Doc
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative ENonterminal:
-         child nt             : {NontermIdent}
-         child params         : {[Identifier]}
-         child initial        : {StateIdentifier}
-         child initialv       : {Maybe VisitIdentifier}
-         child prods          : EProductions 
-         visit 0:
-            local datatype    : _
-            local sem_nt      : _
-            local outedges    : _
-            local inedges     : _
-            local allstates   : _
-            local t_init      : _
-            local t_states    : _
-            local k_states    : _
-            local wr_inh      : _
-            local wr_syn      : _
-            local genwrap     : _
-            local wr_inhs     : _
-            local wr_syns     : _
-            local inhlist     : _
-            local synlist     : _
-            local wrapper     : _
--}
--- cata
-sem_ENonterminal :: ENonterminal  ->
-                    T_ENonterminal 
-sem_ENonterminal (ENonterminal _nt _params _initial _initialv _prods )  =
-    (sem_ENonterminal_ENonterminal _nt _params _initial _initialv (sem_EProductions _prods ) )
--- semantic domain
-newtype T_ENonterminal  = T_ENonterminal ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                          (Map.Map NontermIdent Attributes) ->
-                                          Options ->
-                                          (Map.Map NontermIdent Attributes) ->
-                                          TypeSyns ->
-                                          (Set.Set NontermIdent) ->
-                                          ( (Map.Map VisitIdentifier (Identifier -> PP_Doc)),PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_ENonterminal  = Inh_ENonterminal {allchildvisit_Inh_ENonterminal :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),inhmap_Inh_ENonterminal :: (Map.Map NontermIdent Attributes),options_Inh_ENonterminal :: Options,synmap_Inh_ENonterminal :: (Map.Map NontermIdent Attributes),typeSyns_Inh_ENonterminal :: TypeSyns,wrappers_Inh_ENonterminal :: (Set.Set NontermIdent)}
-data Syn_ENonterminal  = Syn_ENonterminal {childvisit_Syn_ENonterminal :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),debugoutput_Syn_ENonterminal :: PP_Doc,visitdefs_Syn_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_ENonterminal :: T_ENonterminal  ->
-                     Inh_ENonterminal  ->
-                     Syn_ENonterminal 
-wrap_ENonterminal (T_ENonterminal sem ) (Inh_ENonterminal _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIoptions _lhsIsynmap _lhsItypeSyns _lhsIwrappers )  =
-    (let ( _lhsOchildvisit,_lhsOdebugoutput,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIoptions _lhsIsynmap _lhsItypeSyns _lhsIwrappers 
-     in  (Syn_ENonterminal _lhsOchildvisit _lhsOdebugoutput _lhsOvisitdefs _lhsOvisituses ))
-sem_ENonterminal_ENonterminal :: NontermIdent ->
-                                 ([Identifier]) ->
-                                 StateIdentifier ->
-                                 (Maybe VisitIdentifier) ->
-                                 T_EProductions  ->
-                                 T_ENonterminal 
-sem_ENonterminal_ENonterminal nt_ params_ initial_ initialv_ (T_EProductions prods_ )  =
-    (T_ENonterminal (\ _lhsIallchildvisit
-                       _lhsIavisitdefs
-                       _lhsIavisituses
-                       _lhsIinhmap
-                       _lhsIoptions
-                       _lhsIsynmap
-                       _lhsItypeSyns
-                       _lhsIwrappers ->
-                         (let _prodsOrename :: Bool
-                              _lhsOdebugoutput :: PP_Doc
-                              _prodsOinhmap :: Attributes
-                              _prodsOsynmap :: Attributes
-                              _prodsOnt :: NontermIdent
-                              _prodsOinitial :: StateIdentifier
-                              _prodsOallstates :: (Set.Set StateIdentifier)
-                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _prodsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _prodsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _prodsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _prodsIallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                              _prodsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _prodsIdatatype :: ([PP_Doc])
-                              _prodsIsem_nt :: PP_Doc
-                              _prodsIsem_prod :: PP_Doc
-                              _prodsIt_visits :: PP_Doc
-                              _prodsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _prodsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              -- "ExecutionPlan2Hs.ag"(line 34, column 18)
-                              _prodsOrename =
-                                  ({-# LINE 34 "ExecutionPlan2Hs.ag" #-}
-                                   rename _lhsIoptions
-                                   {-# LINE 428 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 54, column 18)
-                              _lhsOdebugoutput =
-                                  ({-# LINE 54 "ExecutionPlan2Hs.ag" #-}
-                                   (if dataTypes _lhsIoptions then _datatype     else empty)
-                                   >-< (if nt_ `Set.member` _lhsIwrappers
-                                        then     _wr_inh
-                                             >-< _wr_syn
-                                             >-< _wrapper
-                                        else empty)
-                                   >-< _sem_nt
-                                   >-< _t_init
-                                   >-< _t_states
-                                   >-< _k_states
-                                   >-< _prodsIt_visits
-                                   >-< _prodsIsem_prod
-                                   {-# LINE 445 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 74, column 18)
-                              _datatype =
-                                  ({-# LINE 74 "ExecutionPlan2Hs.ag" #-}
-                                   case lookup nt_ _lhsItypeSyns of
-                                     Nothing -> "data" >#< nt_ >#< (vlist $ ("=" >#< head _prodsIdatatype)
-                                                : (map ("|" >#<) $ tail _prodsIdatatype))
-                                     Just (List t) -> "type" >#< nt_ >#< "=" >#< "[" >#< show t >#< "]"
-                                     Just x -> error $ "Type " ++ show x ++ " is not supported yet"
-                                   {-# LINE 455 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 96, column 18)
-                              _sem_nt =
-                                  ({-# LINE 96 "ExecutionPlan2Hs.ag" #-}
-                                   "sem_" >|< nt_ >#< "::" >#< nt_ >#< "->" >#< "T_" >|< nt_
-                                   >-< case lookup nt_ _lhsItypeSyns of
-                                         Nothing -> _prodsIsem_nt
-                                         Just (List t) -> "sem_" >|< nt_ >#< "list" >#< "=" >#< "Prelude.foldr sem_"
-                                                          >|< nt_ >|< "_Cons" >#< "sem_" >|< nt_ >|< "_Nil"
-                                                          >#< "(" >#< "Prelude.map sem_" >|< show t >#< "list" >#< ")"
-                                   {-# LINE 466 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 132, column 19)
-                              (Just _prodsOinhmap ) =
-                                  ({-# LINE 132 "ExecutionPlan2Hs.ag" #-}
-                                   Map.lookup nt_ _lhsIinhmap
-                                   {-# LINE 472 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 133, column 19)
-                              (Just _prodsOsynmap ) =
-                                  ({-# LINE 133 "ExecutionPlan2Hs.ag" #-}
-                                   Map.lookup nt_ _lhsIsynmap
-                                   {-# LINE 478 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 149, column 18)
-                              _outedges =
-                                  ({-# LINE 149 "ExecutionPlan2Hs.ag" #-}
-                                   Set.fromList $ map (\(_,f,_) -> f) _prodsIallvisits
-                                   {-# LINE 484 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 150, column 18)
-                              _inedges =
-                                  ({-# LINE 150 "ExecutionPlan2Hs.ag" #-}
-                                   Set.fromList $ map (\(_,_,t) -> t) _prodsIallvisits
-                                   {-# LINE 490 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 151, column 18)
-                              _allstates =
-                                  ({-# LINE 151 "ExecutionPlan2Hs.ag" #-}
-                                   Set.insert initial_ $ _inedges     `Set.union` _outedges
-                                   {-# LINE 496 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 152, column 18)
-                              _t_init =
-                                  ({-# LINE 152 "ExecutionPlan2Hs.ag" #-}
-                                   "type" >#< "T_" >|< nt_ >#< "=" >#< "T_" >|< nt_ >|< "_s" >|< initial_
-                                   {-# LINE 502 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 153, column 18)
-                              _t_states =
-                                  ({-# LINE 153 "ExecutionPlan2Hs.ag" #-}
-                                   vlist $ map (\st ->
-                                      let nt_st = nt_ >|< "_s" >|< st
-                                          t_st  = "T_" >|< nt_st
-                                          k_st  = "K_" >|< nt_st
-                                          c_st  = "C_" >|< nt_st
-                                          inv_st  = "inv_" >|< nt_st
-                                      in  "data" >#< t_st >#< "where" >#< c_st >#< "::" >#< "{" >#< inv_st >#< "::"
-                                                 >#< "forall t." >#< k_st >#< "t" >#< "->" >#< "t" >#< "}"
-                                                 >#< "->" >#< t_st
-                                          ) $ Set.toList _allstates
-                                   {-# LINE 517 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 166, column 18)
-                              _k_states =
-                                  ({-# LINE 166 "ExecutionPlan2Hs.ag" #-}
-                                   vlist $ map (\st ->
-                                       let nt_st = nt_ >|< "_s" >|< st
-                                           k_st  = "K_" >|< nt_st
-                                           outg  = filter (\(v,f,t) -> f == st) _prodsIallvisits
-                                           visitlist = vlist $ map (\(v,f,t) ->
-                                              "K_" >|< nt_ >|< "_v" >|< v >#< "::" >#< k_st >#< "T_" >|< nt_ >|< "_v" >|< v
-                                               ) outg
-                                       in  "data" >#< k_st >#< "k" >#< "where"
-                                           >-< indent 3 visitlist) $ Set.toList _allstates
-                                   {-# LINE 531 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 194, column 18)
-                              _prodsOnt =
-                                  ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
-                                   nt_
-                                   {-# LINE 537 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 210, column 18)
-                              _wr_inh =
-                                  ({-# LINE 210 "ExecutionPlan2Hs.ag" #-}
-                                   _genwrap     "Inh" _wr_inhs
-                                   {-# LINE 543 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 211, column 18)
-                              _wr_syn =
-                                  ({-# LINE 211 "ExecutionPlan2Hs.ag" #-}
-                                   _genwrap     "Syn" _wr_syns
-                                   {-# LINE 549 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 212, column 18)
-                              _genwrap =
-                                  ({-# LINE 212 "ExecutionPlan2Hs.ag" #-}
-                                   \nm attr -> "data" >#< nm >|< "_" >|< nt_ >#< "=" >#< nm >|< "_" >|< nt_ >#< "{"
-                                   >#< (ppCommas $ map (\(i,t) -> i >|< "_" >|< nm >|< "_" >|< nt_ >#< "::"
-                                        >#< typeToHaskellString (Just nt_) [] t) attr) >#< "}"
-                                   {-# LINE 557 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 215, column 18)
-                              _wr_inhs =
-                                  ({-# LINE 215 "ExecutionPlan2Hs.ag" #-}
-                                   Map.toList $ fromJust $ Map.lookup nt_ _lhsIinhmap
-                                   {-# LINE 563 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 216, column 18)
-                              _wr_syns =
-                                  ({-# LINE 216 "ExecutionPlan2Hs.ag" #-}
-                                   Map.toList $ fromJust $ Map.lookup nt_ _lhsIsynmap
-                                   {-# LINE 569 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 217, column 18)
-                              _inhlist =
-                                  ({-# LINE 217 "ExecutionPlan2Hs.ag" #-}
-                                   map (lhsname True . fst) _wr_inhs
-                                   {-# LINE 575 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 218, column 18)
-                              _synlist =
-                                  ({-# LINE 218 "ExecutionPlan2Hs.ag" #-}
-                                   map (lhsname False . fst) _wr_syns
-                                   {-# LINE 581 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 219, column 18)
-                              _wrapper =
-                                  ({-# LINE 219 "ExecutionPlan2Hs.ag" #-}
-                                   ("wrap_" >|< nt_ >#< "::" >#< "T_" >|< nt_ >#< "->"
-                                    >#< "Inh_" >|< nt_ >#< "->" >#< "Syn_" >|< nt_)
-                                   >-<
-                                   (("wrap_" >|< nt_ >#< "sem" >#< "(" >#< "Inh_" >|< nt_
-                                     >#< ppSpaced _inhlist     >#< ")" >#< "=")
-                                    >-<
-                                    indent 3 ("let" >#< "(" >#< ppCommas _synlist     >#< "," >#< "_" >#< ")" >#< "="
-                                               >#< "runIdentity" >#< "$" >#< "(" >#< "inv_" >|< nt_ >|< "_s" >|< initial_
-                                               >#< "sem" >#< "K_" >|< nt_ >|< "_v" >|< fromJust initialv_ >#< ")"
-                                               >#< ppSpaced _inhlist
-                                               >-<
-                                               "in " >#< "(" >#< "Syn_" >|< nt_ >#< ppSpaced _synlist     >#< ")")
-                                   )
-                                   {-# LINE 599 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 247, column 33)
-                              _prodsOinitial =
-                                  ({-# LINE 247 "ExecutionPlan2Hs.ag" #-}
-                                   initial_
-                                   {-# LINE 605 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 248, column 33)
-                              _prodsOallstates =
-                                  ({-# LINE 248 "ExecutionPlan2Hs.ag" #-}
-                                   _allstates
-                                   {-# LINE 611 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                              _lhsOchildvisit =
-                                  ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                   _prodsIchildvisit
-                                   {-# LINE 617 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                              _lhsOvisitdefs =
-                                  ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                   _prodsIvisitdefs
-                                   {-# LINE 623 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                              _lhsOvisituses =
-                                  ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                   _prodsIvisituses
-                                   {-# LINE 629 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _prodsOallchildvisit =
-                                  ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIallchildvisit
-                                   {-# LINE 635 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _prodsOavisitdefs =
-                                  ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisitdefs
-                                   {-# LINE 641 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _prodsOavisituses =
-                                  ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisituses
-                                   {-# LINE 647 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              ( _prodsIallvisits,_prodsIchildvisit,_prodsIdatatype,_prodsIsem_nt,_prodsIsem_prod,_prodsIt_visits,_prodsIvisitdefs,_prodsIvisituses) =
-                                  prods_ _prodsOallchildvisit _prodsOallstates _prodsOavisitdefs _prodsOavisituses _prodsOinhmap _prodsOinitial _prodsOnt _prodsOrename _prodsOsynmap 
-                          in  ( _lhsOchildvisit,_lhsOdebugoutput,_lhsOvisitdefs,_lhsOvisituses))) )
--- ENonterminals -----------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         inhmap               : Map.Map NontermIdent Attributes
-         options              : Options
-         synmap               : Map.Map NontermIdent Attributes
-         typeSyns             : TypeSyns
-         wrappers             : Set.Set NontermIdent
-      synthesized attributes:
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         debugoutput          : PP_Doc
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative Cons:
-         child hd             : ENonterminal 
-         child tl             : ENonterminals 
-      alternative Nil:
--}
--- cata
-sem_ENonterminals :: ENonterminals  ->
-                     T_ENonterminals 
-sem_ENonterminals list  =
-    (Prelude.foldr sem_ENonterminals_Cons sem_ENonterminals_Nil (Prelude.map sem_ENonterminal list) )
--- semantic domain
-newtype T_ENonterminals  = T_ENonterminals ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                            (Map.Map NontermIdent Attributes) ->
-                                            Options ->
-                                            (Map.Map NontermIdent Attributes) ->
-                                            TypeSyns ->
-                                            (Set.Set NontermIdent) ->
-                                            ( (Map.Map VisitIdentifier (Identifier -> PP_Doc)),PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_ENonterminals  = Inh_ENonterminals {allchildvisit_Inh_ENonterminals :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),inhmap_Inh_ENonterminals :: (Map.Map NontermIdent Attributes),options_Inh_ENonterminals :: Options,synmap_Inh_ENonterminals :: (Map.Map NontermIdent Attributes),typeSyns_Inh_ENonterminals :: TypeSyns,wrappers_Inh_ENonterminals :: (Set.Set NontermIdent)}
-data Syn_ENonterminals  = Syn_ENonterminals {childvisit_Syn_ENonterminals :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),debugoutput_Syn_ENonterminals :: PP_Doc,visitdefs_Syn_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_ENonterminals :: T_ENonterminals  ->
-                      Inh_ENonterminals  ->
-                      Syn_ENonterminals 
-wrap_ENonterminals (T_ENonterminals sem ) (Inh_ENonterminals _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIoptions _lhsIsynmap _lhsItypeSyns _lhsIwrappers )  =
-    (let ( _lhsOchildvisit,_lhsOdebugoutput,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIoptions _lhsIsynmap _lhsItypeSyns _lhsIwrappers 
-     in  (Syn_ENonterminals _lhsOchildvisit _lhsOdebugoutput _lhsOvisitdefs _lhsOvisituses ))
-sem_ENonterminals_Cons :: T_ENonterminal  ->
-                          T_ENonterminals  ->
-                          T_ENonterminals 
-sem_ENonterminals_Cons (T_ENonterminal hd_ ) (T_ENonterminals tl_ )  =
-    (T_ENonterminals (\ _lhsIallchildvisit
-                        _lhsIavisitdefs
-                        _lhsIavisituses
-                        _lhsIinhmap
-                        _lhsIoptions
-                        _lhsIsynmap
-                        _lhsItypeSyns
-                        _lhsIwrappers ->
-                          (let _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _lhsOdebugoutput :: PP_Doc
-                               _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _hdOinhmap :: (Map.Map NontermIdent Attributes)
-                               _hdOoptions :: Options
-                               _hdOsynmap :: (Map.Map NontermIdent Attributes)
-                               _hdOtypeSyns :: TypeSyns
-                               _hdOwrappers :: (Set.Set NontermIdent)
-                               _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _tlOinhmap :: (Map.Map NontermIdent Attributes)
-                               _tlOoptions :: Options
-                               _tlOsynmap :: (Map.Map NontermIdent Attributes)
-                               _tlOtypeSyns :: TypeSyns
-                               _tlOwrappers :: (Set.Set NontermIdent)
-                               _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _hdIdebugoutput :: PP_Doc
-                               _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _tlIdebugoutput :: PP_Doc
-                               _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                               _lhsOchildvisit =
-                                   ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                    _hdIchildvisit `Map.union` _tlIchildvisit
-                                    {-# LINE 742 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 48, column 85)
-                               _lhsOdebugoutput =
-                                   ({-# LINE 48 "ExecutionPlan2Hs.ag" #-}
-                                    _hdIdebugoutput >-< _tlIdebugoutput
-                                    {-# LINE 748 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                               _lhsOvisitdefs =
-                                   ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                    _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
-                                    {-# LINE 754 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                               _lhsOvisituses =
-                                   ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                    _hdIvisituses `uwSetUnion` _tlIvisituses
-                                    {-# LINE 760 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOallchildvisit =
-                                   ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIallchildvisit
-                                    {-# LINE 766 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOavisitdefs =
-                                   ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIavisitdefs
-                                    {-# LINE 772 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOavisituses =
-                                   ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIavisituses
-                                    {-# LINE 778 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOinhmap =
-                                   ({-# LINE 122 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIinhmap
-                                    {-# LINE 784 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOoptions =
-                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIoptions
-                                    {-# LINE 790 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOsynmap =
-                                   ({-# LINE 123 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIsynmap
-                                    {-# LINE 796 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOtypeSyns =
-                                   ({-# LINE 68 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsItypeSyns
-                                    {-# LINE 802 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _hdOwrappers =
-                                   ({-# LINE 48 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIwrappers
-                                    {-# LINE 808 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOallchildvisit =
-                                   ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIallchildvisit
-                                    {-# LINE 814 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOavisitdefs =
-                                   ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIavisitdefs
-                                    {-# LINE 820 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOavisituses =
-                                   ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIavisituses
-                                    {-# LINE 826 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOinhmap =
-                                   ({-# LINE 122 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIinhmap
-                                    {-# LINE 832 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOoptions =
-                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIoptions
-                                    {-# LINE 838 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOsynmap =
-                                   ({-# LINE 123 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIsynmap
-                                    {-# LINE 844 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOtypeSyns =
-                                   ({-# LINE 68 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsItypeSyns
-                                    {-# LINE 850 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _tlOwrappers =
-                                   ({-# LINE 48 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIwrappers
-                                    {-# LINE 856 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               ( _hdIchildvisit,_hdIdebugoutput,_hdIvisitdefs,_hdIvisituses) =
-                                   hd_ _hdOallchildvisit _hdOavisitdefs _hdOavisituses _hdOinhmap _hdOoptions _hdOsynmap _hdOtypeSyns _hdOwrappers 
-                               ( _tlIchildvisit,_tlIdebugoutput,_tlIvisitdefs,_tlIvisituses) =
-                                   tl_ _tlOallchildvisit _tlOavisitdefs _tlOavisituses _tlOinhmap _tlOoptions _tlOsynmap _tlOtypeSyns _tlOwrappers 
-                           in  ( _lhsOchildvisit,_lhsOdebugoutput,_lhsOvisitdefs,_lhsOvisituses))) )
-sem_ENonterminals_Nil :: T_ENonterminals 
-sem_ENonterminals_Nil  =
-    (T_ENonterminals (\ _lhsIallchildvisit
-                        _lhsIavisitdefs
-                        _lhsIavisituses
-                        _lhsIinhmap
-                        _lhsIoptions
-                        _lhsIsynmap
-                        _lhsItypeSyns
-                        _lhsIwrappers ->
-                          (let _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _lhsOdebugoutput :: PP_Doc
-                               _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                               _lhsOchildvisit =
-                                   ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                    Map.empty
-                                    {-# LINE 881 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 48, column 85)
-                               _lhsOdebugoutput =
-                                   ({-# LINE 48 "ExecutionPlan2Hs.ag" #-}
-                                    empty
-                                    {-# LINE 887 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                               _lhsOvisitdefs =
-                                   ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                    Map.empty
-                                    {-# LINE 893 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                               _lhsOvisituses =
-                                   ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                    Map.empty
-                                    {-# LINE 899 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                           in  ( _lhsOchildvisit,_lhsOdebugoutput,_lhsOvisitdefs,_lhsOvisituses))) )
--- EProduction -------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         allstates            : Set.Set StateIdentifier
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         inhmap               : Attributes
-         initial              : StateIdentifier
-         nt                   : NontermIdent
-         rename               : Bool
-         synmap               : Attributes
-      synthesized attributes:
-         allvisits            : [(VisitIdentifier,StateIdentifier, StateIdentifier)]
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         datatype             : PP_Doc
-         sem_nt               : PP_Doc
-         sem_prod             : PP_Doc
-         t_visits             : PP_Doc
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative EProduction:
-         child con            : {ConstructorIdent}
-         child rules          : ERules 
-         child children       : EChildren 
-         child visits         : Visits 
-         visit 0:
-            local args        : _
-            local statefns    : _
-            local stargs      : _
-            local stks        : _
-            local stvisits    : _
-            local stvs        : _
--}
--- cata
-sem_EProduction :: EProduction  ->
-                   T_EProduction 
-sem_EProduction (EProduction _con _rules _children _visits )  =
-    (sem_EProduction_EProduction _con (sem_ERules _rules ) (sem_EChildren _children ) (sem_Visits _visits ) )
--- semantic domain
-newtype T_EProduction  = T_EProduction ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                        (Set.Set StateIdentifier) ->
-                                        (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                        (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                        Attributes ->
-                                        StateIdentifier ->
-                                        NontermIdent ->
-                                        Bool ->
-                                        Attributes ->
-                                        ( ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),PP_Doc,PP_Doc,PP_Doc,PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_EProduction  = Inh_EProduction {allchildvisit_Inh_EProduction :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allstates_Inh_EProduction :: (Set.Set StateIdentifier),avisitdefs_Inh_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),inhmap_Inh_EProduction :: Attributes,initial_Inh_EProduction :: StateIdentifier,nt_Inh_EProduction :: NontermIdent,rename_Inh_EProduction :: Bool,synmap_Inh_EProduction :: Attributes}
-data Syn_EProduction  = Syn_EProduction {allvisits_Syn_EProduction :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),childvisit_Syn_EProduction :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),datatype_Syn_EProduction :: PP_Doc,sem_nt_Syn_EProduction :: PP_Doc,sem_prod_Syn_EProduction :: PP_Doc,t_visits_Syn_EProduction :: PP_Doc,visitdefs_Syn_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_EProduction :: T_EProduction  ->
-                    Inh_EProduction  ->
-                    Syn_EProduction 
-wrap_EProduction (T_EProduction sem ) (Inh_EProduction _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIinitial _lhsInt _lhsIrename _lhsIsynmap )  =
-    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIinitial _lhsInt _lhsIrename _lhsIsynmap 
-     in  (Syn_EProduction _lhsOallvisits _lhsOchildvisit _lhsOdatatype _lhsOsem_nt _lhsOsem_prod _lhsOt_visits _lhsOvisitdefs _lhsOvisituses ))
-sem_EProduction_EProduction :: ConstructorIdent ->
-                               T_ERules  ->
-                               T_EChildren  ->
-                               T_Visits  ->
-                               T_EProduction 
-sem_EProduction_EProduction con_ (T_ERules rules_ ) (T_EChildren children_ ) (T_Visits visits_ )  =
-    (T_EProduction (\ _lhsIallchildvisit
-                      _lhsIallstates
-                      _lhsIavisitdefs
-                      _lhsIavisituses
-                      _lhsIinhmap
-                      _lhsIinitial
-                      _lhsInt
-                      _lhsIrename
-                      _lhsIsynmap ->
-                        (let _lhsOdatatype :: PP_Doc
-                             _lhsOsem_nt :: PP_Doc
-                             _rulesOusedrules :: (Set.Set Identifier)
-                             _lhsOsem_prod :: PP_Doc
-                             _visitsOmrules :: (Map.Map Identifier PP_Doc)
-                             _visitsOchildintros :: (Map.Map Identifier PP_Doc)
-                             _visitsOallintramap :: (Map.Map StateIdentifier (Set.Set String))
-                             _visitsOterminaldefs :: (Set.Set String)
-                             _visitsOruledefs :: (Map.Map Identifier (Set.Set String))
-                             _visitsOruleuses :: (Map.Map Identifier (Set.Set String))
-                             _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                             _lhsOt_visits :: PP_Doc
-                             _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             _lhsOallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                             _childrenOnt :: NontermIdent
-                             _visitsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                             _visitsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             _visitsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             _visitsOinhmap :: Attributes
-                             _visitsOnt :: NontermIdent
-                             _visitsOsynmap :: Attributes
-                             _rulesImrules :: (Map.Map Identifier PP_Doc)
-                             _rulesIruledefs :: (Map.Map Identifier (Set.Set String))
-                             _rulesIruleuses :: (Map.Map Identifier (Set.Set String))
-                             _rulesIsem_rules :: PP_Doc
-                             _childrenIargnames :: ( [PP_Doc] )
-                             _childrenIargnamesw :: ([PP_Doc])
-                             _childrenIargtps :: ( [PP_Doc] )
-                             _childrenIchildintros :: (Map.Map Identifier PP_Doc)
-                             _childrenIdatatype :: ([PP_Doc])
-                             _childrenIterminaldefs :: (Set.Set String)
-                             _visitsIallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                             _visitsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                             _visitsIintramap :: (Map.Map StateIdentifier (Set.Set String))
-                             _visitsIsem_visit :: ( [(StateIdentifier,PP_Doc)] )
-                             _visitsIt_visits :: PP_Doc
-                             _visitsIusedrules :: (Set.Set Identifier)
-                             _visitsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             _visitsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                             -- "ExecutionPlan2Hs.ag"(line 84, column 17)
-                             _lhsOdatatype =
-                                 ({-# LINE 84 "ExecutionPlan2Hs.ag" #-}
-                                  conname _lhsIrename _lhsInt con_ >#< ppSpaced _childrenIdatatype
-                                  {-# LINE 1021 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 105, column 17)
-                             _lhsOsem_nt =
-                                 ({-# LINE 105 "ExecutionPlan2Hs.ag" #-}
-                                  "sem_" >|< _lhsInt >#< "(" >#< conname _lhsIrename _lhsInt con_ >#< ppSpaced _childrenIargnames >#< ")"
-                                  >#< "=" >#< "sem_" >|< _lhsInt >|< "_" >|< con_ >#< ppSpaced _childrenIargnamesw
-                                  {-# LINE 1028 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 182, column 17)
-                             _rulesOusedrules =
-                                 ({-# LINE 182 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIusedrules
-                                  {-# LINE 1034 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 268, column 17)
-                             _args =
-                                 ({-# LINE 268 "ExecutionPlan2Hs.ag" #-}
-                                  _childrenIargnames
-                                  {-# LINE 1040 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 269, column 17)
-                             _lhsOsem_prod =
-                                 ({-# LINE 269 "ExecutionPlan2Hs.ag" #-}
-                                  "sem_" >|< _lhsInt >|< "_" >|< con_ >#< "::" >#< ppSpaced _childrenIargtps >#< "T_" >|< _lhsInt
-                                  >-< "sem_" >|< _lhsInt >|< "_" >|< con_ >#< ppSpaced _args     >#< "="
-                                    >#< "st" >|< _lhsIinitial >#< "where"
-                                  >-< (indent 3 $ vlist _statefns     >-< _rulesIsem_rules)
-                                  {-# LINE 1049 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 273, column 17)
-                             _statefns =
-                                 ({-# LINE 273 "ExecutionPlan2Hs.ag" #-}
-                                  map (\st -> "st" >|< st >#< _stargs     st >#< "=" >#<
-                                           "C_" >|< _lhsInt >|< "_s" >|< st >#< "k" >|< st >#< "where"
-                                           >-< indent 3 (_stks     st >-< _stvs     st)
-                                      ) $ Set.toList _lhsIallstates
-                                  {-# LINE 1058 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 277, column 17)
-                             _stargs =
-                                 ({-# LINE 277 "ExecutionPlan2Hs.ag" #-}
-                                  \st -> ppSpaced $ Set.toList $ maybe Set.empty id $ Map.lookup st _visitsIintramap
-                                  {-# LINE 1064 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 278, column 17)
-                             _stks =
-                                 ({-# LINE 278 "ExecutionPlan2Hs.ag" #-}
-                                  \st -> "k" >|< st >#< "::" >#< "K_" >|< _lhsInt >|< "_s" >|< st >#< "t" >#< "->" >#< "t"
-                                     >-< vlist (map (\(v,f,t) -> "k" >|< st >#< "K_" >|< _lhsInt >|< "_v" >|< v >#< "="
-                                                              >#< "v" >|< v) $ _stvisits     st)
-                                     >-< if null (_stvisits     st)
-                                         then "k" >|< st >#< "_" >#< "=" >#< "error \"unreachable\""
-                                         else empty
-                                  {-# LINE 1075 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 284, column 17)
-                             _stvisits =
-                                 ({-# LINE 284 "ExecutionPlan2Hs.ag" #-}
-                                  \st -> filter (\(v,f,t) -> f == st) _visitsIallvisits
-                                  {-# LINE 1081 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 285, column 17)
-                             _stvs =
-                                 ({-# LINE 285 "ExecutionPlan2Hs.ag" #-}
-                                  \st -> vlist $ map snd $ filter (\(f,pp) -> f == st) _visitsIsem_visit
-                                  {-# LINE 1087 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 286, column 17)
-                             _visitsOmrules =
-                                 ({-# LINE 286 "ExecutionPlan2Hs.ag" #-}
-                                  _rulesImrules
-                                  {-# LINE 1093 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 324, column 17)
-                             _visitsOchildintros =
-                                 ({-# LINE 324 "ExecutionPlan2Hs.ag" #-}
-                                  _childrenIchildintros
-                                  {-# LINE 1099 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 409, column 17)
-                             _visitsOallintramap =
-                                 ({-# LINE 409 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIintramap
-                                  {-# LINE 1105 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 410, column 17)
-                             _visitsOterminaldefs =
-                                 ({-# LINE 410 "ExecutionPlan2Hs.ag" #-}
-                                  _childrenIterminaldefs
-                                  {-# LINE 1111 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 429, column 17)
-                             _visitsOruledefs =
-                                 ({-# LINE 429 "ExecutionPlan2Hs.ag" #-}
-                                  _rulesIruledefs
-                                  {-# LINE 1117 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- "ExecutionPlan2Hs.ag"(line 430, column 17)
-                             _visitsOruleuses =
-                                 ({-# LINE 430 "ExecutionPlan2Hs.ag" #-}
-                                  _rulesIruleuses
-                                  {-# LINE 1123 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                             _lhsOchildvisit =
-                                 ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIchildvisit
-                                  {-# LINE 1129 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- use rule "ExecutionPlan2Hs.ag"(line 188, column 54)
-                             _lhsOt_visits =
-                                 ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIt_visits
-                                  {-# LINE 1135 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                             _lhsOvisitdefs =
-                                 ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIvisitdefs
-                                  {-# LINE 1141 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                             _lhsOvisituses =
-                                 ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIvisituses
-                                  {-# LINE 1147 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (up)
-                             _lhsOallvisits =
-                                 ({-# LINE 138 "ExecutionPlan2Hs.ag" #-}
-                                  _visitsIallvisits
-                                  {-# LINE 1153 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _childrenOnt =
-                                 ({-# LINE 87 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsInt
-                                  {-# LINE 1159 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOallchildvisit =
-                                 ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsIallchildvisit
-                                  {-# LINE 1165 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOavisitdefs =
-                                 ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsIavisitdefs
-                                  {-# LINE 1171 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOavisituses =
-                                 ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsIavisituses
-                                  {-# LINE 1177 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOinhmap =
-                                 ({-# LINE 128 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsIinhmap
-                                  {-# LINE 1183 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOnt =
-                                 ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsInt
-                                  {-# LINE 1189 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _visitsOsynmap =
-                                 ({-# LINE 129 "ExecutionPlan2Hs.ag" #-}
-                                  _lhsIsynmap
-                                  {-# LINE 1195 "ExecutionPlan2Hs.hs" #-}
-                                  )
-                             ( _rulesImrules,_rulesIruledefs,_rulesIruleuses,_rulesIsem_rules) =
-                                 rules_ _rulesOusedrules 
-                             ( _childrenIargnames,_childrenIargnamesw,_childrenIargtps,_childrenIchildintros,_childrenIdatatype,_childrenIterminaldefs) =
-                                 children_ _childrenOnt 
-                             ( _visitsIallvisits,_visitsIchildvisit,_visitsIintramap,_visitsIsem_visit,_visitsIt_visits,_visitsIusedrules,_visitsIvisitdefs,_visitsIvisituses) =
-                                 visits_ _visitsOallchildvisit _visitsOallintramap _visitsOavisitdefs _visitsOavisituses _visitsOchildintros _visitsOinhmap _visitsOmrules _visitsOnt _visitsOruledefs _visitsOruleuses _visitsOsynmap _visitsOterminaldefs 
-                         in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
--- EProductions ------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         allstates            : Set.Set StateIdentifier
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         inhmap               : Attributes
-         initial              : StateIdentifier
-         nt                   : NontermIdent
-         rename               : Bool
-         synmap               : Attributes
-      synthesized attributes:
-         allvisits            : [(VisitIdentifier,StateIdentifier, StateIdentifier)]
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         datatype             : [PP_Doc]
-         sem_nt               : PP_Doc
-         sem_prod             : PP_Doc
-         t_visits             : PP_Doc
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative Cons:
-         child hd             : EProduction 
-         child tl             : EProductions 
-      alternative Nil:
--}
--- cata
-sem_EProductions :: EProductions  ->
-                    T_EProductions 
-sem_EProductions list  =
-    (Prelude.foldr sem_EProductions_Cons sem_EProductions_Nil (Prelude.map sem_EProduction list) )
--- semantic domain
-newtype T_EProductions  = T_EProductions ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                          (Set.Set StateIdentifier) ->
-                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                          Attributes ->
-                                          StateIdentifier ->
-                                          NontermIdent ->
-                                          Bool ->
-                                          Attributes ->
-                                          ( ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),([PP_Doc]),PP_Doc,PP_Doc,PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_EProductions  = Inh_EProductions {allchildvisit_Inh_EProductions :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allstates_Inh_EProductions :: (Set.Set StateIdentifier),avisitdefs_Inh_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),inhmap_Inh_EProductions :: Attributes,initial_Inh_EProductions :: StateIdentifier,nt_Inh_EProductions :: NontermIdent,rename_Inh_EProductions :: Bool,synmap_Inh_EProductions :: Attributes}
-data Syn_EProductions  = Syn_EProductions {allvisits_Syn_EProductions :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),childvisit_Syn_EProductions :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),datatype_Syn_EProductions :: ([PP_Doc]),sem_nt_Syn_EProductions :: PP_Doc,sem_prod_Syn_EProductions :: PP_Doc,t_visits_Syn_EProductions :: PP_Doc,visitdefs_Syn_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_EProductions :: T_EProductions  ->
-                     Inh_EProductions  ->
-                     Syn_EProductions 
-wrap_EProductions (T_EProductions sem ) (Inh_EProductions _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIinitial _lhsInt _lhsIrename _lhsIsynmap )  =
-    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIinhmap _lhsIinitial _lhsInt _lhsIrename _lhsIsynmap 
-     in  (Syn_EProductions _lhsOallvisits _lhsOchildvisit _lhsOdatatype _lhsOsem_nt _lhsOsem_prod _lhsOt_visits _lhsOvisitdefs _lhsOvisituses ))
-sem_EProductions_Cons :: T_EProduction  ->
-                         T_EProductions  ->
-                         T_EProductions 
-sem_EProductions_Cons (T_EProduction hd_ ) (T_EProductions tl_ )  =
-    (T_EProductions (\ _lhsIallchildvisit
-                       _lhsIallstates
-                       _lhsIavisitdefs
-                       _lhsIavisituses
-                       _lhsIinhmap
-                       _lhsIinitial
-                       _lhsInt
-                       _lhsIrename
-                       _lhsIsynmap ->
-                         (let _lhsOallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                              _lhsOt_visits :: PP_Doc
-                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _lhsOdatatype :: ([PP_Doc])
-                              _lhsOsem_nt :: PP_Doc
-                              _lhsOsem_prod :: PP_Doc
-                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _hdOallstates :: (Set.Set StateIdentifier)
-                              _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _hdOinhmap :: Attributes
-                              _hdOinitial :: StateIdentifier
-                              _hdOnt :: NontermIdent
-                              _hdOrename :: Bool
-                              _hdOsynmap :: Attributes
-                              _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _tlOallstates :: (Set.Set StateIdentifier)
-                              _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _tlOinhmap :: Attributes
-                              _tlOinitial :: StateIdentifier
-                              _tlOnt :: NontermIdent
-                              _tlOrename :: Bool
-                              _tlOsynmap :: Attributes
-                              _hdIallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                              _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _hdIdatatype :: PP_Doc
-                              _hdIsem_nt :: PP_Doc
-                              _hdIsem_prod :: PP_Doc
-                              _hdIt_visits :: PP_Doc
-                              _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _tlIallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                              _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _tlIdatatype :: ([PP_Doc])
-                              _tlIsem_nt :: PP_Doc
-                              _tlIsem_prod :: PP_Doc
-                              _tlIt_visits :: PP_Doc
-                              _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              -- "ExecutionPlan2Hs.ag"(line 144, column 10)
-                              _lhsOallvisits =
-                                  ({-# LINE 144 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIallvisits
-                                   {-# LINE 1315 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- "ExecutionPlan2Hs.ag"(line 191, column 10)
-                              _lhsOt_visits =
-                                  ({-# LINE 191 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIt_visits
-                                   {-# LINE 1321 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                              _lhsOchildvisit =
-                                  ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIchildvisit `Map.union` _tlIchildvisit
-                                   {-# LINE 1327 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 81, column 34)
-                              _lhsOdatatype =
-                                  ({-# LINE 81 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIdatatype : _tlIdatatype
-                                   {-# LINE 1333 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 103, column 44)
-                              _lhsOsem_nt =
-                                  ({-# LINE 103 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIsem_nt >-< _tlIsem_nt
-                                   {-# LINE 1339 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 244, column 34)
-                              _lhsOsem_prod =
-                                  ({-# LINE 244 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIsem_prod >-< _tlIsem_prod
-                                   {-# LINE 1345 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                              _lhsOvisitdefs =
-                                  ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
-                                   {-# LINE 1351 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                              _lhsOvisituses =
-                                  ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                   _hdIvisituses `uwSetUnion` _tlIvisituses
-                                   {-# LINE 1357 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOallchildvisit =
-                                  ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIallchildvisit
-                                   {-# LINE 1363 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOallstates =
-                                  ({-# LINE 246 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIallstates
-                                   {-# LINE 1369 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOavisitdefs =
-                                  ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisitdefs
-                                   {-# LINE 1375 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOavisituses =
-                                  ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisituses
-                                   {-# LINE 1381 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOinhmap =
-                                  ({-# LINE 128 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIinhmap
-                                   {-# LINE 1387 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOinitial =
-                                  ({-# LINE 246 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIinitial
-                                   {-# LINE 1393 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOnt =
-                                  ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsInt
-                                   {-# LINE 1399 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOrename =
-                                  ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIrename
-                                   {-# LINE 1405 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOsynmap =
-                                  ({-# LINE 129 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIsynmap
-                                   {-# LINE 1411 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOallchildvisit =
-                                  ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIallchildvisit
-                                   {-# LINE 1417 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOallstates =
-                                  ({-# LINE 246 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIallstates
-                                   {-# LINE 1423 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOavisitdefs =
-                                  ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisitdefs
-                                   {-# LINE 1429 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOavisituses =
-                                  ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIavisituses
-                                   {-# LINE 1435 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOinhmap =
-                                  ({-# LINE 128 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIinhmap
-                                   {-# LINE 1441 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOinitial =
-                                  ({-# LINE 246 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIinitial
-                                   {-# LINE 1447 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOnt =
-                                  ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsInt
-                                   {-# LINE 1453 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOrename =
-                                  ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIrename
-                                   {-# LINE 1459 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOsynmap =
-                                  ({-# LINE 129 "ExecutionPlan2Hs.ag" #-}
-                                   _lhsIsynmap
-                                   {-# LINE 1465 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              ( _hdIallvisits,_hdIchildvisit,_hdIdatatype,_hdIsem_nt,_hdIsem_prod,_hdIt_visits,_hdIvisitdefs,_hdIvisituses) =
-                                  hd_ _hdOallchildvisit _hdOallstates _hdOavisitdefs _hdOavisituses _hdOinhmap _hdOinitial _hdOnt _hdOrename _hdOsynmap 
-                              ( _tlIallvisits,_tlIchildvisit,_tlIdatatype,_tlIsem_nt,_tlIsem_prod,_tlIt_visits,_tlIvisitdefs,_tlIvisituses) =
-                                  tl_ _tlOallchildvisit _tlOallstates _tlOavisitdefs _tlOavisituses _tlOinhmap _tlOinitial _tlOnt _tlOrename _tlOsynmap 
-                          in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
-sem_EProductions_Nil :: T_EProductions 
-sem_EProductions_Nil  =
-    (T_EProductions (\ _lhsIallchildvisit
-                       _lhsIallstates
-                       _lhsIavisitdefs
-                       _lhsIavisituses
-                       _lhsIinhmap
-                       _lhsIinitial
-                       _lhsInt
-                       _lhsIrename
-                       _lhsIsynmap ->
-                         (let _lhsOallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                              _lhsOdatatype :: ([PP_Doc])
-                              _lhsOsem_nt :: PP_Doc
-                              _lhsOsem_prod :: PP_Doc
-                              _lhsOt_visits :: PP_Doc
-                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                              -- "ExecutionPlan2Hs.ag"(line 145, column 10)
-                              _lhsOallvisits =
-                                  ({-# LINE 145 "ExecutionPlan2Hs.ag" #-}
-                                   error "Every nonterminal should have at least 1 production"
-                                   {-# LINE 1495 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                              _lhsOchildvisit =
-                                  ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                                   Map.empty
-                                   {-# LINE 1501 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 81, column 34)
-                              _lhsOdatatype =
-                                  ({-# LINE 81 "ExecutionPlan2Hs.ag" #-}
-                                   []
-                                   {-# LINE 1507 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 103, column 44)
-                              _lhsOsem_nt =
-                                  ({-# LINE 103 "ExecutionPlan2Hs.ag" #-}
-                                   empty
-                                   {-# LINE 1513 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 244, column 34)
-                              _lhsOsem_prod =
-                                  ({-# LINE 244 "ExecutionPlan2Hs.ag" #-}
-                                   empty
-                                   {-# LINE 1519 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 188, column 54)
-                              _lhsOt_visits =
-                                  ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                                   empty
-                                   {-# LINE 1525 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                              _lhsOvisitdefs =
-                                  ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                                   Map.empty
-                                   {-# LINE 1531 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                              -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                              _lhsOvisituses =
-                                  ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                                   Map.empty
-                                   {-# LINE 1537 "ExecutionPlan2Hs.hs" #-}
-                                   )
-                          in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
--- ERule -------------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         usedrules            : Set.Set Identifier
-      synthesized attributes:
-         mrules               : Map.Map Identifier PP_Doc
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-         sem_rules            : PP_Doc
-   alternatives:
-      alternative ERule:
-         child name           : {Identifier}
-         child pattern        : Pattern 
-         child rhs            : Expression 
-         child owrt           : {Bool}
-         child origin         : {String}
-         child explicit       : {Bool}
-         visit 0:
-            local attrlst     : _
--}
--- cata
-sem_ERule :: ERule  ->
-             T_ERule 
-sem_ERule (ERule _name _pattern _rhs _owrt _origin _explicit )  =
-    (sem_ERule_ERule _name (sem_Pattern _pattern ) (sem_Expression _rhs ) _owrt _origin _explicit )
--- semantic domain
-newtype T_ERule  = T_ERule ((Set.Set Identifier) ->
-                            ( (Map.Map Identifier PP_Doc),(Map.Map Identifier (Set.Set String)),(Map.Map Identifier (Set.Set String)),PP_Doc))
-data Inh_ERule  = Inh_ERule {usedrules_Inh_ERule :: (Set.Set Identifier)}
-data Syn_ERule  = Syn_ERule {mrules_Syn_ERule :: (Map.Map Identifier PP_Doc),ruledefs_Syn_ERule :: (Map.Map Identifier (Set.Set String)),ruleuses_Syn_ERule :: (Map.Map Identifier (Set.Set String)),sem_rules_Syn_ERule :: PP_Doc}
-wrap_ERule :: T_ERule  ->
-              Inh_ERule  ->
-              Syn_ERule 
-wrap_ERule (T_ERule sem ) (Inh_ERule _lhsIusedrules )  =
-    (let ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules) = sem _lhsIusedrules 
-     in  (Syn_ERule _lhsOmrules _lhsOruledefs _lhsOruleuses _lhsOsem_rules ))
-sem_ERule_ERule :: Identifier ->
-                   T_Pattern  ->
-                   T_Expression  ->
-                   Bool ->
-                   String ->
-                   Bool ->
-                   T_ERule 
-sem_ERule_ERule name_ (T_Pattern pattern_ ) (T_Expression rhs_ ) owrt_ origin_ explicit_  =
-    (T_ERule (\ _lhsIusedrules ->
-                  (let _lhsOsem_rules :: PP_Doc
-                       _lhsOmrules :: (Map.Map Identifier PP_Doc)
-                       _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
-                       _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
-                       _patternIattrs :: (Set.Set String)
-                       _patternIcopy :: Pattern 
-                       _patternIsem_lhs :: PP_Doc
-                       _rhsIattrs :: (Set.Set String)
-                       _rhsIsemfunc :: PP_Doc
-                       -- "ExecutionPlan2Hs.ag"(line 337, column 11)
-                       _lhsOsem_rules =
-                           ({-# LINE 337 "ExecutionPlan2Hs.ag" #-}
-                            if Set.member name_ _lhsIusedrules
-                            then (name_ >#< "=" >#<
-                                 (if Set.null _rhsIattrs
-                                    then empty
-                                    else "\\" >|< _attrlst     >#< "->")
-                                  >#< _rhsIsemfunc)
-                            else empty
-                            {-# LINE 1605 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 344, column 11)
-                       _attrlst =
-                           ({-# LINE 344 "ExecutionPlan2Hs.ag" #-}
-                            ppSpaced $ Set.toList _rhsIattrs
-                            {-# LINE 1611 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 345, column 11)
-                       _lhsOmrules =
-                           ({-# LINE 345 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton name_ $ _patternIsem_lhs >#< "<-" >#< "return" >#< "$" >#< name_ >#< _attrlst
-                            {-# LINE 1617 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 425, column 11)
-                       _lhsOruledefs =
-                           ({-# LINE 425 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton name_ _patternIattrs
-                            {-# LINE 1623 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 426, column 11)
-                       _lhsOruleuses =
-                           ({-# LINE 426 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton name_ _rhsIattrs
-                            {-# LINE 1629 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       ( _patternIattrs,_patternIcopy,_patternIsem_lhs) =
-                           pattern_ 
-                       ( _rhsIattrs,_rhsIsemfunc) =
-                           rhs_ 
-                   in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
--- ERules ------------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         usedrules            : Set.Set Identifier
-      synthesized attributes:
-         mrules               : Map.Map Identifier PP_Doc
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-         sem_rules            : PP_Doc
-   alternatives:
-      alternative Cons:
-         child hd             : ERule 
-         child tl             : ERules 
-      alternative Nil:
--}
--- cata
-sem_ERules :: ERules  ->
-              T_ERules 
-sem_ERules list  =
-    (Prelude.foldr sem_ERules_Cons sem_ERules_Nil (Prelude.map sem_ERule list) )
--- semantic domain
-newtype T_ERules  = T_ERules ((Set.Set Identifier) ->
-                              ( (Map.Map Identifier PP_Doc),(Map.Map Identifier (Set.Set String)),(Map.Map Identifier (Set.Set String)),PP_Doc))
-data Inh_ERules  = Inh_ERules {usedrules_Inh_ERules :: (Set.Set Identifier)}
-data Syn_ERules  = Syn_ERules {mrules_Syn_ERules :: (Map.Map Identifier PP_Doc),ruledefs_Syn_ERules :: (Map.Map Identifier (Set.Set String)),ruleuses_Syn_ERules :: (Map.Map Identifier (Set.Set String)),sem_rules_Syn_ERules :: PP_Doc}
-wrap_ERules :: T_ERules  ->
-               Inh_ERules  ->
-               Syn_ERules 
-wrap_ERules (T_ERules sem ) (Inh_ERules _lhsIusedrules )  =
-    (let ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules) = sem _lhsIusedrules 
-     in  (Syn_ERules _lhsOmrules _lhsOruledefs _lhsOruleuses _lhsOsem_rules ))
-sem_ERules_Cons :: T_ERule  ->
-                   T_ERules  ->
-                   T_ERules 
-sem_ERules_Cons (T_ERule hd_ ) (T_ERules tl_ )  =
-    (T_ERules (\ _lhsIusedrules ->
-                   (let _lhsOmrules :: (Map.Map Identifier PP_Doc)
-                        _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
-                        _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
-                        _lhsOsem_rules :: PP_Doc
-                        _hdOusedrules :: (Set.Set Identifier)
-                        _tlOusedrules :: (Set.Set Identifier)
-                        _hdImrules :: (Map.Map Identifier PP_Doc)
-                        _hdIruledefs :: (Map.Map Identifier (Set.Set String))
-                        _hdIruleuses :: (Map.Map Identifier (Set.Set String))
-                        _hdIsem_rules :: PP_Doc
-                        _tlImrules :: (Map.Map Identifier PP_Doc)
-                        _tlIruledefs :: (Map.Map Identifier (Set.Set String))
-                        _tlIruleuses :: (Map.Map Identifier (Set.Set String))
-                        _tlIsem_rules :: PP_Doc
-                        -- use rule "ExecutionPlan2Hs.ag"(line 334, column 32)
-                        _lhsOmrules =
-                            ({-# LINE 334 "ExecutionPlan2Hs.ag" #-}
-                             _hdImrules `Map.union` _tlImrules
-                             {-# LINE 1691 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 418, column 34)
-                        _lhsOruledefs =
-                            ({-# LINE 418 "ExecutionPlan2Hs.ag" #-}
-                             _hdIruledefs `uwSetUnion` _tlIruledefs
-                             {-# LINE 1697 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 419, column 34)
-                        _lhsOruleuses =
-                            ({-# LINE 419 "ExecutionPlan2Hs.ag" #-}
-                             _hdIruleuses `uwSetUnion` _tlIruleuses
-                             {-# LINE 1703 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 333, column 35)
-                        _lhsOsem_rules =
-                            ({-# LINE 333 "ExecutionPlan2Hs.ag" #-}
-                             _hdIsem_rules >-< _tlIsem_rules
-                             {-# LINE 1709 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOusedrules =
-                            ({-# LINE 176 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIusedrules
-                             {-# LINE 1715 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOusedrules =
-                            ({-# LINE 176 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIusedrules
-                             {-# LINE 1721 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        ( _hdImrules,_hdIruledefs,_hdIruleuses,_hdIsem_rules) =
-                            hd_ _hdOusedrules 
-                        ( _tlImrules,_tlIruledefs,_tlIruleuses,_tlIsem_rules) =
-                            tl_ _tlOusedrules 
-                    in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
-sem_ERules_Nil :: T_ERules 
-sem_ERules_Nil  =
-    (T_ERules (\ _lhsIusedrules ->
-                   (let _lhsOmrules :: (Map.Map Identifier PP_Doc)
-                        _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
-                        _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
-                        _lhsOsem_rules :: PP_Doc
-                        -- use rule "ExecutionPlan2Hs.ag"(line 334, column 32)
-                        _lhsOmrules =
-                            ({-# LINE 334 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 1739 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 418, column 34)
-                        _lhsOruledefs =
-                            ({-# LINE 418 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 1745 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 419, column 34)
-                        _lhsOruleuses =
-                            ({-# LINE 419 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 1751 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 333, column 35)
-                        _lhsOsem_rules =
-                            ({-# LINE 333 "ExecutionPlan2Hs.ag" #-}
-                             empty
-                             {-# LINE 1757 "ExecutionPlan2Hs.hs" #-}
-                             )
-                    in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
--- ExecutionPlan -----------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         importBlocks         : PP_Doc
-         inhmap               : Map.Map NontermIdent Attributes
-         mainName             : String
-         moduleHeader         : String -> String -> String -> Bool -> String
-         options              : Options
-         pragmaBlocks         : String
-         synmap               : Map.Map NontermIdent Attributes
-         textBlocks           : PP_Doc
-      synthesized attribute:
-         debugoutput          : PP_Doc
-   alternatives:
-      alternative ExecutionPlan:
-         child nonts          : ENonterminals 
-         child typeSyns       : {TypeSyns}
-         child wrappers       : {Set.Set NontermIdent}
--}
--- cata
-sem_ExecutionPlan :: ExecutionPlan  ->
-                     T_ExecutionPlan 
-sem_ExecutionPlan (ExecutionPlan _nonts _typeSyns _wrappers )  =
-    (sem_ExecutionPlan_ExecutionPlan (sem_ENonterminals _nonts ) _typeSyns _wrappers )
--- semantic domain
-newtype T_ExecutionPlan  = T_ExecutionPlan (PP_Doc ->
-                                            (Map.Map NontermIdent Attributes) ->
-                                            String ->
-                                            (String -> String -> String -> Bool -> String) ->
-                                            Options ->
-                                            String ->
-                                            (Map.Map NontermIdent Attributes) ->
-                                            PP_Doc ->
-                                            ( PP_Doc))
-data Inh_ExecutionPlan  = Inh_ExecutionPlan {importBlocks_Inh_ExecutionPlan :: PP_Doc,inhmap_Inh_ExecutionPlan :: (Map.Map NontermIdent Attributes),mainName_Inh_ExecutionPlan :: String,moduleHeader_Inh_ExecutionPlan :: (String -> String -> String -> Bool -> String),options_Inh_ExecutionPlan :: Options,pragmaBlocks_Inh_ExecutionPlan :: String,synmap_Inh_ExecutionPlan :: (Map.Map NontermIdent Attributes),textBlocks_Inh_ExecutionPlan :: PP_Doc}
-data Syn_ExecutionPlan  = Syn_ExecutionPlan {debugoutput_Syn_ExecutionPlan :: PP_Doc}
-wrap_ExecutionPlan :: T_ExecutionPlan  ->
-                      Inh_ExecutionPlan  ->
-                      Syn_ExecutionPlan 
-wrap_ExecutionPlan (T_ExecutionPlan sem ) (Inh_ExecutionPlan _lhsIimportBlocks _lhsIinhmap _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks )  =
-    (let ( _lhsOdebugoutput) = sem _lhsIimportBlocks _lhsIinhmap _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks 
-     in  (Syn_ExecutionPlan _lhsOdebugoutput ))
-sem_ExecutionPlan_ExecutionPlan :: T_ENonterminals  ->
-                                   TypeSyns ->
-                                   (Set.Set NontermIdent) ->
-                                   T_ExecutionPlan 
-sem_ExecutionPlan_ExecutionPlan (T_ENonterminals nonts_ ) typeSyns_ wrappers_  =
-    (T_ExecutionPlan (\ _lhsIimportBlocks
-                        _lhsIinhmap
-                        _lhsImainName
-                        _lhsImoduleHeader
-                        _lhsIoptions
-                        _lhsIpragmaBlocks
-                        _lhsIsynmap
-                        _lhsItextBlocks ->
-                          (let _lhsOdebugoutput :: PP_Doc
-                               _nontsOwrappers :: (Set.Set NontermIdent)
-                               _nontsOtypeSyns :: TypeSyns
-                               _nontsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _nontsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _nontsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _nontsOinhmap :: (Map.Map NontermIdent Attributes)
-                               _nontsOoptions :: Options
-                               _nontsOsynmap :: (Map.Map NontermIdent Attributes)
-                               _nontsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                               _nontsIdebugoutput :: PP_Doc
-                               _nontsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               _nontsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                               -- "ExecutionPlan2Hs.ag"(line 40, column 19)
-                               _lhsOdebugoutput =
-                                   ({-# LINE 40 "ExecutionPlan2Hs.ag" #-}
-                                    "{-# LANGUAGE Rank2Types, GADTs, EmptyDataDecls #-}"
-                                    >-< _lhsIpragmaBlocks
-                                    >-< _lhsImoduleHeader _lhsImainName "" "" False
-                                    >-< "import Control.Monad.Identity"
-                                    >-< _lhsIimportBlocks
-                                    >-< _lhsItextBlocks
-                                    >-< _nontsIdebugoutput
-                                    {-# LINE 1839 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- "ExecutionPlan2Hs.ag"(line 51, column 19)
-                               _nontsOwrappers =
-                                   ({-# LINE 51 "ExecutionPlan2Hs.ag" #-}
-                                    wrappers_
-                                    {-# LINE 1845 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- "ExecutionPlan2Hs.ag"(line 71, column 19)
-                               _nontsOtypeSyns =
-                                   ({-# LINE 71 "ExecutionPlan2Hs.ag" #-}
-                                    typeSyns_
-                                    {-# LINE 1851 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- "ExecutionPlan2Hs.ag"(line 384, column 19)
-                               _nontsOallchildvisit =
-                                   ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
-                                    _nontsIchildvisit
-                                    {-# LINE 1857 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- "ExecutionPlan2Hs.ag"(line 450, column 19)
-                               _nontsOavisitdefs =
-                                   ({-# LINE 450 "ExecutionPlan2Hs.ag" #-}
-                                    _nontsIvisitdefs
-                                    {-# LINE 1863 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- "ExecutionPlan2Hs.ag"(line 451, column 19)
-                               _nontsOavisituses =
-                                   ({-# LINE 451 "ExecutionPlan2Hs.ag" #-}
-                                    _nontsIvisituses
-                                    {-# LINE 1869 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _nontsOinhmap =
-                                   ({-# LINE 122 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIinhmap
-                                    {-# LINE 1875 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _nontsOoptions =
-                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIoptions
-                                    {-# LINE 1881 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               -- copy rule (down)
-                               _nontsOsynmap =
-                                   ({-# LINE 123 "ExecutionPlan2Hs.ag" #-}
-                                    _lhsIsynmap
-                                    {-# LINE 1887 "ExecutionPlan2Hs.hs" #-}
-                                    )
-                               ( _nontsIchildvisit,_nontsIdebugoutput,_nontsIvisitdefs,_nontsIvisituses) =
-                                   nonts_ _nontsOallchildvisit _nontsOavisitdefs _nontsOavisituses _nontsOinhmap _nontsOoptions _nontsOsynmap _nontsOtypeSyns _nontsOwrappers 
-                           in  ( _lhsOdebugoutput))) )
--- Expression --------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         attrs                : Set.Set String
-         semfunc              : PP_Doc
-   alternatives:
-      alternative Expression:
-         child pos            : {Pos}
-         child tks            : {[HsToken]}
--}
--- cata
-sem_Expression :: Expression  ->
-                  T_Expression 
-sem_Expression (Expression _pos _tks )  =
-    (sem_Expression_Expression _pos _tks )
--- semantic domain
-newtype T_Expression  = T_Expression (( (Set.Set String),PP_Doc))
-data Inh_Expression  = Inh_Expression {}
-data Syn_Expression  = Syn_Expression {attrs_Syn_Expression :: (Set.Set String),semfunc_Syn_Expression :: PP_Doc}
-wrap_Expression :: T_Expression  ->
-                   Inh_Expression  ->
-                   Syn_Expression 
-wrap_Expression (T_Expression sem ) (Inh_Expression )  =
-    (let ( _lhsOattrs,_lhsOsemfunc) = sem 
-     in  (Syn_Expression _lhsOattrs _lhsOsemfunc ))
-sem_Expression_Expression :: Pos ->
-                             ([HsToken]) ->
-                             T_Expression 
-sem_Expression_Expression pos_ tks_  =
-    (T_Expression (let _lhsOattrs :: (Set.Set String)
-                       _lhsOsemfunc :: PP_Doc
-                       -- "ExecutionPlan2Hs.ag"(line 368, column 16)
-                       _lhsOattrs =
-                           ({-# LINE 368 "ExecutionPlan2Hs.ag" #-}
-                            Set.unions $ map (\tok -> attrs_Syn_HsToken (wrap_HsToken (sem_HsToken tok) Inh_HsToken)) tks_
-                            {-# LINE 1928 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 369, column 16)
-                       _lhsOsemfunc =
-                           ({-# LINE 369 "ExecutionPlan2Hs.ag" #-}
-                            vlist $ showTokens $ map (\tok -> tok_Syn_HsToken (wrap_HsToken (sem_HsToken tok) Inh_HsToken)) tks_
-                            {-# LINE 1934 "ExecutionPlan2Hs.hs" #-}
-                            )
-                   in  ( _lhsOattrs,_lhsOsemfunc)) )
--- HsToken -----------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         attrs                : Set.Set String
-         tok                  : (Pos,String)
-   alternatives:
-      alternative AGField:
-         child field          : {Identifier}
-         child attr           : {Identifier}
-         child pos            : {Pos}
-         child rdesc          : {Maybe String}
-         visit 0:
-            local addTrace    : _
-      alternative AGLocal:
-         child var            : {Identifier}
-         child pos            : {Pos}
-         child rdesc          : {Maybe String}
-         visit 0:
-            local tok         : _
-      alternative CharToken:
-         child value          : {String}
-         child pos            : {Pos}
-      alternative Err:
-         child mesg           : {String}
-         child pos            : {Pos}
-      alternative HsToken:
-         child value          : {String}
-         child pos            : {Pos}
-      alternative StrToken:
-         child value          : {String}
-         child pos            : {Pos}
--}
--- cata
-sem_HsToken :: HsToken  ->
-               T_HsToken 
-sem_HsToken (AGField _field _attr _pos _rdesc )  =
-    (sem_HsToken_AGField _field _attr _pos _rdesc )
-sem_HsToken (AGLocal _var _pos _rdesc )  =
-    (sem_HsToken_AGLocal _var _pos _rdesc )
-sem_HsToken (CharToken _value _pos )  =
-    (sem_HsToken_CharToken _value _pos )
-sem_HsToken (Err _mesg _pos )  =
-    (sem_HsToken_Err _mesg _pos )
-sem_HsToken (HsToken _value _pos )  =
-    (sem_HsToken_HsToken _value _pos )
-sem_HsToken (StrToken _value _pos )  =
-    (sem_HsToken_StrToken _value _pos )
--- semantic domain
-newtype T_HsToken  = T_HsToken (( (Set.Set String),((Pos,String))))
-data Inh_HsToken  = Inh_HsToken {}
-data Syn_HsToken  = Syn_HsToken {attrs_Syn_HsToken :: (Set.Set String),tok_Syn_HsToken :: ((Pos,String))}
-wrap_HsToken :: T_HsToken  ->
-                Inh_HsToken  ->
-                Syn_HsToken 
-wrap_HsToken (T_HsToken sem ) (Inh_HsToken )  =
-    (let ( _lhsOattrs,_lhsOtok) = sem 
-     in  (Syn_HsToken _lhsOattrs _lhsOtok ))
-sem_HsToken_AGField :: Identifier ->
-                       Identifier ->
-                       Pos ->
-                       (Maybe String) ->
-                       T_HsToken 
-sem_HsToken_AGField field_ attr_ pos_ rdesc_  =
-    (T_HsToken (let _lhsOattrs :: (Set.Set String)
-                    _lhsOtok :: ((Pos,String))
-                    -- "ExecutionPlan2Hs.ag"(line 363, column 15)
-                    _lhsOattrs =
-                        ({-# LINE 363 "ExecutionPlan2Hs.ag" #-}
-                         Set.singleton $ attrname True field_ attr_
-                         {-# LINE 2007 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- "ExecutionPlan2Hs.ag"(line 482, column 8)
-                    _addTrace =
-                        ({-# LINE 482 "ExecutionPlan2Hs.ag" #-}
-                         case rdesc_ of
-                           Just d  -> \x -> "(trace " ++ show (d ++ " -> " ++ show field_ ++ "." ++ show attr_) ++ " (" ++ x ++ "))"
-                           Nothing -> id
-                         {-# LINE 2015 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- "ExecutionPlan2Hs.ag"(line 485, column 8)
-                    _lhsOtok =
-                        ({-# LINE 485 "ExecutionPlan2Hs.ag" #-}
-                         (pos_, _addTrace     $ attrname True field_ attr_)
-                         {-# LINE 2021 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
-sem_HsToken_AGLocal :: Identifier ->
-                       Pos ->
-                       (Maybe String) ->
-                       T_HsToken 
-sem_HsToken_AGLocal var_ pos_ rdesc_  =
-    (T_HsToken (let _lhsOattrs :: (Set.Set String)
-                    _lhsOtok :: ((Pos,String))
-                    -- "ExecutionPlan2Hs.ag"(line 362, column 15)
-                    _lhsOattrs =
-                        ({-# LINE 362 "ExecutionPlan2Hs.ag" #-}
-                         Set.singleton $ locname var_
-                         {-# LINE 2035 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- "ExecutionPlan2Hs.ag"(line 477, column 15)
-                    _tok =
-                        ({-# LINE 477 "ExecutionPlan2Hs.ag" #-}
-                         (pos_,locname var_)
-                         {-# LINE 2041 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- copy rule (from local)
-                    _lhsOtok =
-                        ({-# LINE 480 "ExecutionPlan2Hs.ag" #-}
-                         _tok
-                         {-# LINE 2047 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
-sem_HsToken_CharToken :: String ->
-                         Pos ->
-                         T_HsToken 
-sem_HsToken_CharToken value_ pos_  =
-    (T_HsToken (let _lhsOtok :: ((Pos,String))
-                    _lhsOattrs :: (Set.Set String)
-                    -- "ExecutionPlan2Hs.ag"(line 489, column 16)
-                    _lhsOtok =
-                        ({-# LINE 489 "ExecutionPlan2Hs.ag" #-}
-                         (pos_, if null value_
-                                   then ""
-                                   else showCharShort (head value_)
-                         )
-                         {-# LINE 2063 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 360, column 37)
-                    _lhsOattrs =
-                        ({-# LINE 360 "ExecutionPlan2Hs.ag" #-}
-                         Set.empty
-                         {-# LINE 2069 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
-sem_HsToken_Err :: String ->
-                   Pos ->
-                   T_HsToken 
-sem_HsToken_Err mesg_ pos_  =
-    (T_HsToken (let _lhsOtok :: ((Pos,String))
-                    _lhsOattrs :: (Set.Set String)
-                    -- "ExecutionPlan2Hs.ag"(line 495, column 16)
-                    _lhsOtok =
-                        ({-# LINE 495 "ExecutionPlan2Hs.ag" #-}
-                         (pos_, "")
-                         {-# LINE 2082 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 360, column 37)
-                    _lhsOattrs =
-                        ({-# LINE 360 "ExecutionPlan2Hs.ag" #-}
-                         Set.empty
-                         {-# LINE 2088 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
-sem_HsToken_HsToken :: String ->
-                       Pos ->
-                       T_HsToken 
-sem_HsToken_HsToken value_ pos_  =
-    (T_HsToken (let _lhsOtok :: ((Pos,String))
-                    _lhsOattrs :: (Set.Set String)
-                    -- "ExecutionPlan2Hs.ag"(line 487, column 14)
-                    _lhsOtok =
-                        ({-# LINE 487 "ExecutionPlan2Hs.ag" #-}
-                         (pos_, value_)
-                         {-# LINE 2101 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 360, column 37)
-                    _lhsOattrs =
-                        ({-# LINE 360 "ExecutionPlan2Hs.ag" #-}
-                         Set.empty
-                         {-# LINE 2107 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
-sem_HsToken_StrToken :: String ->
-                        Pos ->
-                        T_HsToken 
-sem_HsToken_StrToken value_ pos_  =
-    (T_HsToken (let _lhsOtok :: ((Pos,String))
-                    _lhsOattrs :: (Set.Set String)
-                    -- "ExecutionPlan2Hs.ag"(line 494, column 16)
-                    _lhsOtok =
-                        ({-# LINE 494 "ExecutionPlan2Hs.ag" #-}
-                         (pos_, showStrShort value_)
-                         {-# LINE 2120 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 360, column 37)
-                    _lhsOattrs =
-                        ({-# LINE 360 "ExecutionPlan2Hs.ag" #-}
-                         Set.empty
-                         {-# LINE 2126 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOtok)) )
--- HsTokens ----------------------------------------------------
-{-
-   visit 0:
-      synthesized attribute:
-         tks                  : [(Pos,String)]
-   alternatives:
-      alternative Cons:
-         child hd             : HsToken 
-         child tl             : HsTokens 
-      alternative Nil:
--}
--- cata
-sem_HsTokens :: HsTokens  ->
-                T_HsTokens 
-sem_HsTokens list  =
-    (Prelude.foldr sem_HsTokens_Cons sem_HsTokens_Nil (Prelude.map sem_HsToken list) )
--- semantic domain
-newtype T_HsTokens  = T_HsTokens (( ([(Pos,String)])))
-data Inh_HsTokens  = Inh_HsTokens {}
-data Syn_HsTokens  = Syn_HsTokens {tks_Syn_HsTokens :: ([(Pos,String)])}
-wrap_HsTokens :: T_HsTokens  ->
-                 Inh_HsTokens  ->
-                 Syn_HsTokens 
-wrap_HsTokens (T_HsTokens sem ) (Inh_HsTokens )  =
-    (let ( _lhsOtks) = sem 
-     in  (Syn_HsTokens _lhsOtks ))
-sem_HsTokens_Cons :: T_HsToken  ->
-                     T_HsTokens  ->
-                     T_HsTokens 
-sem_HsTokens_Cons (T_HsToken hd_ ) (T_HsTokens tl_ )  =
-    (T_HsTokens (let _lhsOtks :: ([(Pos,String)])
-                     _hdIattrs :: (Set.Set String)
-                     _hdItok :: ((Pos,String))
-                     _tlItks :: ([(Pos,String)])
-                     -- "ExecutionPlan2Hs.ag"(line 472, column 10)
-                     _lhsOtks =
-                         ({-# LINE 472 "ExecutionPlan2Hs.ag" #-}
-                          _hdItok : _tlItks
-                          {-# LINE 2167 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     ( _hdIattrs,_hdItok) =
-                         hd_ 
-                     ( _tlItks) =
-                         tl_ 
-                 in  ( _lhsOtks)) )
-sem_HsTokens_Nil :: T_HsTokens 
-sem_HsTokens_Nil  =
-    (T_HsTokens (let _lhsOtks :: ([(Pos,String)])
-                     -- "ExecutionPlan2Hs.ag"(line 473, column 10)
-                     _lhsOtks =
-                         ({-# LINE 473 "ExecutionPlan2Hs.ag" #-}
-                          []
-                          {-# LINE 2181 "ExecutionPlan2Hs.hs" #-}
-                          )
-                 in  ( _lhsOtks)) )
--- HsTokensRoot ------------------------------------------------
-{-
-   alternatives:
-      alternative HsTokensRoot:
-         child tokens         : HsTokens 
--}
--- cata
-sem_HsTokensRoot :: HsTokensRoot  ->
-                    T_HsTokensRoot 
-sem_HsTokensRoot (HsTokensRoot _tokens )  =
-    (sem_HsTokensRoot_HsTokensRoot (sem_HsTokens _tokens ) )
--- semantic domain
-newtype T_HsTokensRoot  = T_HsTokensRoot (( ))
-data Inh_HsTokensRoot  = Inh_HsTokensRoot {}
-data Syn_HsTokensRoot  = Syn_HsTokensRoot {}
-wrap_HsTokensRoot :: T_HsTokensRoot  ->
-                     Inh_HsTokensRoot  ->
-                     Syn_HsTokensRoot 
-wrap_HsTokensRoot (T_HsTokensRoot sem ) (Inh_HsTokensRoot )  =
-    (let ( ) = sem 
-     in  (Syn_HsTokensRoot ))
-sem_HsTokensRoot_HsTokensRoot :: T_HsTokens  ->
-                                 T_HsTokensRoot 
-sem_HsTokensRoot_HsTokensRoot (T_HsTokens tokens_ )  =
-    (T_HsTokensRoot (let _tokensItks :: ([(Pos,String)])
-                         ( _tokensItks) =
-                             tokens_ 
-                     in  ( )) )
--- Pattern -----------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         attrs                : Set.Set String
-         copy                 : SELF 
-         sem_lhs              : PP_Doc
-   alternatives:
-      alternative Alias:
-         child field          : {Identifier}
-         child attr           : {Identifier}
-         child pat            : Pattern 
-         child parts          : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Constr:
-         child name           : {ConstructorIdent}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Irrefutable:
-         child pat            : Pattern 
-         visit 0:
-            local copy        : _
-      alternative Product:
-         child pos            : {Pos}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Underscore:
-         child pos            : {Pos}
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Pattern :: Pattern  ->
-               T_Pattern 
-sem_Pattern (Alias _field _attr _pat _parts )  =
-    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
-sem_Pattern (Constr _name _pats )  =
-    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
-sem_Pattern (Irrefutable _pat )  =
-    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
-sem_Pattern (Product _pos _pats )  =
-    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
-sem_Pattern (Underscore _pos )  =
-    (sem_Pattern_Underscore _pos )
--- semantic domain
-newtype T_Pattern  = T_Pattern (( (Set.Set String),Pattern ,PP_Doc))
-data Inh_Pattern  = Inh_Pattern {}
-data Syn_Pattern  = Syn_Pattern {attrs_Syn_Pattern :: (Set.Set String),copy_Syn_Pattern :: Pattern ,sem_lhs_Syn_Pattern :: PP_Doc}
-wrap_Pattern :: T_Pattern  ->
-                Inh_Pattern  ->
-                Syn_Pattern 
-wrap_Pattern (T_Pattern sem ) (Inh_Pattern )  =
-    (let ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs) = sem 
-     in  (Syn_Pattern _lhsOattrs _lhsOcopy _lhsOsem_lhs ))
-sem_Pattern_Alias :: Identifier ->
-                     Identifier ->
-                     T_Pattern  ->
-                     T_Patterns  ->
-                     T_Pattern 
-sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
-    (T_Pattern (let _lhsOsem_lhs :: PP_Doc
-                    _lhsOattrs :: (Set.Set String)
-                    _lhsOcopy :: Pattern 
-                    _patIattrs :: (Set.Set String)
-                    _patIcopy :: Pattern 
-                    _patIsem_lhs :: PP_Doc
-                    _partsIattrs :: (Set.Set String)
-                    _partsIcopy :: Patterns 
-                    _partsIsem_lhs :: ([PP_Doc])
-                    -- "ExecutionPlan2Hs.ag"(line 353, column 17)
-                    _lhsOsem_lhs =
-                        ({-# LINE 353 "ExecutionPlan2Hs.ag" #-}
-                         text $ attrname False field_ attr_
-                         {-# LINE 2288 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- "ExecutionPlan2Hs.ag"(line 354, column 17)
-                    _lhsOattrs =
-                        ({-# LINE 354 "ExecutionPlan2Hs.ag" #-}
-                         Set.singleton $ attrname False field_ attr_
-                         {-# LINE 2294 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Alias field_ attr_ _patIcopy _partsIcopy
-                         {-# LINE 2300 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 2306 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    ( _patIattrs,_patIcopy,_patIsem_lhs) =
-                        pat_ 
-                    ( _partsIattrs,_partsIcopy,_partsIsem_lhs) =
-                        parts_ 
-                in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
-sem_Pattern_Constr :: ConstructorIdent ->
-                      T_Patterns  ->
-                      T_Pattern 
-sem_Pattern_Constr name_ (T_Patterns pats_ )  =
-    (T_Pattern (let _lhsOsem_lhs :: PP_Doc
-                    _lhsOattrs :: (Set.Set String)
-                    _lhsOcopy :: Pattern 
-                    _patsIattrs :: (Set.Set String)
-                    _patsIcopy :: Patterns 
-                    _patsIsem_lhs :: ([PP_Doc])
-                    -- "ExecutionPlan2Hs.ag"(line 356, column 17)
-                    _lhsOsem_lhs =
-                        ({-# LINE 356 "ExecutionPlan2Hs.ag" #-}
-                         pp_parens $ name_ >#< hv_sp _patsIsem_lhs
-                         {-# LINE 2327 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 347, column 27)
-                    _lhsOattrs =
-                        ({-# LINE 347 "ExecutionPlan2Hs.ag" #-}
-                         _patsIattrs
-                         {-# LINE 2333 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Constr name_ _patsIcopy
-                         {-# LINE 2339 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 2345 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    ( _patsIattrs,_patsIcopy,_patsIsem_lhs) =
-                        pats_ 
-                in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
-sem_Pattern_Irrefutable :: T_Pattern  ->
-                           T_Pattern 
-sem_Pattern_Irrefutable (T_Pattern pat_ )  =
-    (T_Pattern (let _lhsOsem_lhs :: PP_Doc
-                    _lhsOattrs :: (Set.Set String)
-                    _lhsOcopy :: Pattern 
-                    _patIattrs :: (Set.Set String)
-                    _patIcopy :: Pattern 
-                    _patIsem_lhs :: PP_Doc
-                    -- "ExecutionPlan2Hs.ag"(line 358, column 17)
-                    _lhsOsem_lhs =
-                        ({-# LINE 358 "ExecutionPlan2Hs.ag" #-}
-                         text "~" >|< pp_parens _patIsem_lhs
-                         {-# LINE 2363 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 347, column 27)
-                    _lhsOattrs =
-                        ({-# LINE 347 "ExecutionPlan2Hs.ag" #-}
-                         _patIattrs
-                         {-# LINE 2369 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Irrefutable _patIcopy
-                         {-# LINE 2375 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 2381 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    ( _patIattrs,_patIcopy,_patIsem_lhs) =
-                        pat_ 
-                in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
-sem_Pattern_Product :: Pos ->
-                       T_Patterns  ->
-                       T_Pattern 
-sem_Pattern_Product pos_ (T_Patterns pats_ )  =
-    (T_Pattern (let _lhsOsem_lhs :: PP_Doc
-                    _lhsOattrs :: (Set.Set String)
-                    _lhsOcopy :: Pattern 
-                    _patsIattrs :: (Set.Set String)
-                    _patsIcopy :: Patterns 
-                    _patsIsem_lhs :: ([PP_Doc])
-                    -- "ExecutionPlan2Hs.ag"(line 355, column 17)
-                    _lhsOsem_lhs =
-                        ({-# LINE 355 "ExecutionPlan2Hs.ag" #-}
-                         pp_block "(" ")" "," _patsIsem_lhs
-                         {-# LINE 2400 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 347, column 27)
-                    _lhsOattrs =
-                        ({-# LINE 347 "ExecutionPlan2Hs.ag" #-}
-                         _patsIattrs
-                         {-# LINE 2406 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Product pos_ _patsIcopy
-                         {-# LINE 2412 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 2418 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    ( _patsIattrs,_patsIcopy,_patsIsem_lhs) =
-                        pats_ 
-                in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
-sem_Pattern_Underscore :: Pos ->
-                          T_Pattern 
-sem_Pattern_Underscore pos_  =
-    (T_Pattern (let _lhsOsem_lhs :: PP_Doc
-                    _lhsOattrs :: (Set.Set String)
-                    _lhsOcopy :: Pattern 
-                    -- "ExecutionPlan2Hs.ag"(line 357, column 17)
-                    _lhsOsem_lhs =
-                        ({-# LINE 357 "ExecutionPlan2Hs.ag" #-}
-                         text "_"
-                         {-# LINE 2433 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- use rule "ExecutionPlan2Hs.ag"(line 347, column 27)
-                    _lhsOattrs =
-                        ({-# LINE 347 "ExecutionPlan2Hs.ag" #-}
-                         Set.empty
-                         {-# LINE 2439 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Underscore pos_
-                         {-# LINE 2445 "ExecutionPlan2Hs.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 2451 "ExecutionPlan2Hs.hs" #-}
-                         )
-                in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
--- Patterns ----------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         attrs                : Set.Set String
-         copy                 : SELF 
-         sem_lhs              : [PP_Doc]
-   alternatives:
-      alternative Cons:
-         child hd             : Pattern 
-         child tl             : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Nil:
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Patterns :: Patterns  ->
-                T_Patterns 
-sem_Patterns list  =
-    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
--- semantic domain
-newtype T_Patterns  = T_Patterns (( (Set.Set String),Patterns ,([PP_Doc])))
-data Inh_Patterns  = Inh_Patterns {}
-data Syn_Patterns  = Syn_Patterns {attrs_Syn_Patterns :: (Set.Set String),copy_Syn_Patterns :: Patterns ,sem_lhs_Syn_Patterns :: ([PP_Doc])}
-wrap_Patterns :: T_Patterns  ->
-                 Inh_Patterns  ->
-                 Syn_Patterns 
-wrap_Patterns (T_Patterns sem ) (Inh_Patterns )  =
-    (let ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs) = sem 
-     in  (Syn_Patterns _lhsOattrs _lhsOcopy _lhsOsem_lhs ))
-sem_Patterns_Cons :: T_Pattern  ->
-                     T_Patterns  ->
-                     T_Patterns 
-sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
-    (T_Patterns (let _lhsOattrs :: (Set.Set String)
-                     _lhsOsem_lhs :: ([PP_Doc])
-                     _lhsOcopy :: Patterns 
-                     _hdIattrs :: (Set.Set String)
-                     _hdIcopy :: Pattern 
-                     _hdIsem_lhs :: PP_Doc
-                     _tlIattrs :: (Set.Set String)
-                     _tlIcopy :: Patterns 
-                     _tlIsem_lhs :: ([PP_Doc])
-                     -- use rule "ExecutionPlan2Hs.ag"(line 349, column 27)
-                     _lhsOattrs =
-                         ({-# LINE 349 "ExecutionPlan2Hs.ag" #-}
-                          _hdIattrs `Set.union` _tlIattrs
-                          {-# LINE 2503 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- use rule "ExecutionPlan2Hs.ag"(line 350, column 29)
-                     _lhsOsem_lhs =
-                         ({-# LINE 350 "ExecutionPlan2Hs.ag" #-}
-                          _hdIsem_lhs : _tlIsem_lhs
-                          {-# LINE 2509 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- self rule
-                     _copy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          (:) _hdIcopy _tlIcopy
-                          {-# LINE 2515 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- self rule
-                     _lhsOcopy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          _copy
-                          {-# LINE 2521 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     ( _hdIattrs,_hdIcopy,_hdIsem_lhs) =
-                         hd_ 
-                     ( _tlIattrs,_tlIcopy,_tlIsem_lhs) =
-                         tl_ 
-                 in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
-sem_Patterns_Nil :: T_Patterns 
-sem_Patterns_Nil  =
-    (T_Patterns (let _lhsOattrs :: (Set.Set String)
-                     _lhsOsem_lhs :: ([PP_Doc])
-                     _lhsOcopy :: Patterns 
-                     -- use rule "ExecutionPlan2Hs.ag"(line 349, column 27)
-                     _lhsOattrs =
-                         ({-# LINE 349 "ExecutionPlan2Hs.ag" #-}
-                          Set.empty
-                          {-# LINE 2537 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- use rule "ExecutionPlan2Hs.ag"(line 350, column 29)
-                     _lhsOsem_lhs =
-                         ({-# LINE 350 "ExecutionPlan2Hs.ag" #-}
-                          []
-                          {-# LINE 2543 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- self rule
-                     _copy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          []
-                          {-# LINE 2549 "ExecutionPlan2Hs.hs" #-}
-                          )
-                     -- self rule
-                     _lhsOcopy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          _copy
-                          {-# LINE 2555 "ExecutionPlan2Hs.hs" #-}
-                          )
-                 in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs)) )
--- Visit -------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         allintramap          : Map.Map StateIdentifier (Set.Set String)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         childintros          : Map.Map Identifier PP_Doc
-         inhmap               : Attributes
-         mrules               : Map.Map Identifier PP_Doc
-         nt                   : NontermIdent
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-         synmap               : Attributes
-         terminaldefs         : Set.Set String
-      synthesized attributes:
-         allvisits            : (VisitIdentifier,StateIdentifier, StateIdentifier)
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         intramap             : Map.Map StateIdentifier (Set.Set String)
-         sem_visit            :   (StateIdentifier,PP_Doc)  
-         t_visits             : PP_Doc
-         usedrules            : Set.Set Identifier
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative Visit:
-         child ident          : {VisitIdentifier}
-         child from           : {StateIdentifier}
-         child to             : {StateIdentifier}
-         child inh            : {Set.Set Identifier}
-         child syn            : {Set.Set Identifier}
-         child steps          : VisitSteps 
-         visit 0:
-            local inhpart     : _
-            local synpart     : _
-            local inhargs     : _
-            local synargs     : _
-            local nextargs    : _
-            local sem_steps   : _
-            local nextintra   : _
-            local uses        : _
-            local defs        : _
--}
--- cata
-sem_Visit :: Visit  ->
-             T_Visit 
-sem_Visit (Visit _ident _from _to _inh _syn _steps )  =
-    (sem_Visit_Visit _ident _from _to _inh _syn (sem_VisitSteps _steps ) )
--- semantic domain
-newtype T_Visit  = T_Visit ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                            (Map.Map StateIdentifier (Set.Set String)) ->
-                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                            (Map.Map Identifier PP_Doc) ->
-                            Attributes ->
-                            (Map.Map Identifier PP_Doc) ->
-                            NontermIdent ->
-                            (Map.Map Identifier (Set.Set String)) ->
-                            (Map.Map Identifier (Set.Set String)) ->
-                            Attributes ->
-                            (Set.Set String) ->
-                            ( ((VisitIdentifier,StateIdentifier, StateIdentifier)),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(Map.Map StateIdentifier (Set.Set String)),(  (StateIdentifier,PP_Doc)  ),PP_Doc,(Set.Set Identifier),(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_Visit  = Inh_Visit {allchildvisit_Inh_Visit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allintramap_Inh_Visit :: (Map.Map StateIdentifier (Set.Set String)),avisitdefs_Inh_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_Visit :: (Map.Map Identifier PP_Doc),inhmap_Inh_Visit :: Attributes,mrules_Inh_Visit :: (Map.Map Identifier PP_Doc),nt_Inh_Visit :: NontermIdent,ruledefs_Inh_Visit :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_Visit :: (Map.Map Identifier (Set.Set String)),synmap_Inh_Visit :: Attributes,terminaldefs_Inh_Visit :: (Set.Set String)}
-data Syn_Visit  = Syn_Visit {allvisits_Syn_Visit :: ((VisitIdentifier,StateIdentifier, StateIdentifier)),childvisit_Syn_Visit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),intramap_Syn_Visit :: (Map.Map StateIdentifier (Set.Set String)),sem_visit_Syn_Visit :: (  (StateIdentifier,PP_Doc)  ),t_visits_Syn_Visit :: PP_Doc,usedrules_Syn_Visit :: (Set.Set Identifier),visitdefs_Syn_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_Visit :: T_Visit  ->
-              Inh_Visit  ->
-              Syn_Visit 
-wrap_Visit (T_Visit sem ) (Inh_Visit _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs )  =
-    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs 
-     in  (Syn_Visit _lhsOallvisits _lhsOchildvisit _lhsOintramap _lhsOsem_visit _lhsOt_visits _lhsOusedrules _lhsOvisitdefs _lhsOvisituses ))
-sem_Visit_Visit :: VisitIdentifier ->
-                   StateIdentifier ->
-                   StateIdentifier ->
-                   (Set.Set Identifier) ->
-                   (Set.Set Identifier) ->
-                   T_VisitSteps  ->
-                   T_Visit 
-sem_Visit_Visit ident_ from_ to_ inh_ syn_ (T_VisitSteps steps_ )  =
-    (T_Visit (\ _lhsIallchildvisit
-                _lhsIallintramap
-                _lhsIavisitdefs
-                _lhsIavisituses
-                _lhsIchildintros
-                _lhsIinhmap
-                _lhsImrules
-                _lhsInt
-                _lhsIruledefs
-                _lhsIruleuses
-                _lhsIsynmap
-                _lhsIterminaldefs ->
-                  (let _lhsOallvisits :: ((VisitIdentifier,StateIdentifier, StateIdentifier))
-                       _lhsOt_visits :: PP_Doc
-                       _lhsOsem_visit :: (  (StateIdentifier,PP_Doc)  )
-                       _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                       _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
-                       _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                       _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                       _lhsOusedrules :: (Set.Set Identifier)
-                       _stepsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                       _stepsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                       _stepsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                       _stepsOchildintros :: (Map.Map Identifier PP_Doc)
-                       _stepsOmrules :: (Map.Map Identifier PP_Doc)
-                       _stepsOruledefs :: (Map.Map Identifier (Set.Set String))
-                       _stepsOruleuses :: (Map.Map Identifier (Set.Set String))
-                       _stepsIdefs :: (Set.Set String)
-                       _stepsIsem_steps :: PP_Doc
-                       _stepsIusedrules :: (Set.Set Identifier)
-                       _stepsIuses :: (Set.Set String)
-                       -- "ExecutionPlan2Hs.ag"(line 141, column 11)
-                       _lhsOallvisits =
-                           ({-# LINE 141 "ExecutionPlan2Hs.ag" #-}
-                            (ident_, from_, to_)
-                            {-# LINE 2672 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 197, column 11)
-                       _lhsOt_visits =
-                           ({-# LINE 197 "ExecutionPlan2Hs.ag" #-}
-                            "type" >#< "T_" >|< _lhsInt >|< "_v" >|< ident_ >#< "=" >#< _inhpart     >#<
-                            "Identity" >#< "(" >#< _synpart     >#< "T_" >|< _lhsInt >|< "_s" >|< to_ >#< ")"
-                            {-# LINE 2679 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 199, column 11)
-                       _inhpart =
-                           ({-# LINE 199 "ExecutionPlan2Hs.ag" #-}
-                            if   Set.null inh_
-                            then empty
-                            else (ppSpaced $ map (\i -> (\x -> x >#< "->") $ typeToHaskellString (Just _lhsInt) []
-                                           $ fromJust $ Map.lookup i _lhsIinhmap) $ Set.toList inh_)
-                            {-# LINE 2688 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 203, column 11)
-                       _synpart =
-                           ({-# LINE 203 "ExecutionPlan2Hs.ag" #-}
-                            if   Set.null syn_
-                            then empty
-                            else (ppCommas $ map (\i -> typeToHaskellString (Just _lhsInt) [] $ fromJust $ Map.lookup i _lhsIsynmap) $ Set.toList syn_) >#< ","
-                            {-# LINE 2696 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 292, column 11)
-                       _lhsOsem_visit =
-                           ({-# LINE 292 "ExecutionPlan2Hs.ag" #-}
-                            (from_, "v" >|< ident_ >#< "::" >#< "T_" >|< _lhsInt >|< "_v" >|< ident_
-                                >-< "v" >|< ident_ >#< (_inhargs     _LHS True) >#< "=" >#< "do"
-                                >-< indent 3 _sem_steps    )
-                            {-# LINE 2704 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 295, column 11)
-                       _inhargs =
-                           ({-# LINE 295 "ExecutionPlan2Hs.ag" #-}
-                            \chn inh -> ppSpaced $ map (\arg -> attrname inh chn arg) $ Set.toList inh_
-                            {-# LINE 2710 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 296, column 11)
-                       _synargs =
-                           ({-# LINE 296 "ExecutionPlan2Hs.ag" #-}
-                            ppSpaced $ map (\arg -> attrname False _LHS arg >#< ",") $ Set.toList syn_
-                            {-# LINE 2716 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 297, column 11)
-                       _nextargs =
-                           ({-# LINE 297 "ExecutionPlan2Hs.ag" #-}
-                            ppSpaced $ Set.toList $ maybe Set.empty id $ Map.lookup to_ _lhsIallintramap
-                            {-# LINE 2722 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 298, column 11)
-                       _sem_steps =
-                           ({-# LINE 298 "ExecutionPlan2Hs.ag" #-}
-                            _stepsIsem_steps
-                            >-< "return" >#< "(" >#< _synargs     >#< "st" >|< to_ >#< _nextargs     >#< ")"
-                            {-# LINE 2729 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 387, column 11)
-                       _lhsOchildvisit =
-                           ({-# LINE 387 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton ident_ $ \chn -> "(" >#< ppSpaced (
-                            map (\x -> attrname True chn x >#< ",") $ Set.toList syn_) >#< locname chn
-                            >#< ")" >#< "<-" >#< "inv_" >|< _lhsInt >|< "_s" >|< from_ >#< locname chn
-                            >#< "K_" >|< _lhsInt >|< "_v" >|< ident_ >#< _inhargs     chn False
-                            {-# LINE 2738 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 413, column 11)
-                       _lhsOintramap =
-                           ({-# LINE 413 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton from_ $ (_uses     `Set.union` _nextintra    ) `Set.difference` _defs
-                            {-# LINE 2744 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 414, column 11)
-                       _nextintra =
-                           ({-# LINE 414 "ExecutionPlan2Hs.ag" #-}
-                            maybe Set.empty id $ Map.lookup to_ _lhsIallintramap
-                            {-# LINE 2750 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 415, column 11)
-                       _uses =
-                           ({-# LINE 415 "ExecutionPlan2Hs.ag" #-}
-                            _stepsIuses
-                            {-# LINE 2756 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 416, column 11)
-                       _defs =
-                           ({-# LINE 416 "ExecutionPlan2Hs.ag" #-}
-                            _stepsIdefs `Set.union` (Set.map (lhsname True) inh_) `Set.union` _lhsIterminaldefs
-                            {-# LINE 2762 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 440, column 11)
-                       _lhsOvisitdefs =
-                           ({-# LINE 440 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton ident_ syn_
-                            {-# LINE 2768 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- "ExecutionPlan2Hs.ag"(line 441, column 11)
-                       _lhsOvisituses =
-                           ({-# LINE 441 "ExecutionPlan2Hs.ag" #-}
-                            Map.singleton ident_ inh_
-                            {-# LINE 2774 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                       _lhsOusedrules =
-                           ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                            _stepsIusedrules
-                            {-# LINE 2780 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOallchildvisit =
-                           ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIallchildvisit
-                            {-# LINE 2786 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOavisitdefs =
-                           ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIavisitdefs
-                            {-# LINE 2792 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOavisituses =
-                           ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIavisituses
-                            {-# LINE 2798 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOchildintros =
-                           ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIchildintros
-                            {-# LINE 2804 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOmrules =
-                           ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                            _lhsImrules
-                            {-# LINE 2810 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOruledefs =
-                           ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIruledefs
-                            {-# LINE 2816 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _stepsOruleuses =
-                           ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                            _lhsIruleuses
-                            {-# LINE 2822 "ExecutionPlan2Hs.hs" #-}
-                            )
-                       ( _stepsIdefs,_stepsIsem_steps,_stepsIusedrules,_stepsIuses) =
-                           steps_ _stepsOallchildvisit _stepsOavisitdefs _stepsOavisituses _stepsOchildintros _stepsOmrules _stepsOruledefs _stepsOruleuses 
-                   in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses))) )
--- VisitStep ---------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         childintros          : Map.Map Identifier PP_Doc
-         mrules               : Map.Map Identifier PP_Doc
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-      synthesized attributes:
-         defs                 : Set.Set String
-         sem_steps            : PP_Doc
-         usedrules            : Set.Set Identifier
-         uses                 : Set.Set String
-   alternatives:
-      alternative ChildIntro:
-         child child          : {Identifier}
-      alternative ChildVisit:
-         child child          : {Identifier}
-         child nonterm        : {NontermIdent}
-         child visit          : {VisitIdentifier}
-      alternative Sem:
-         child name           : {Identifier}
-      alternative Sim:
-         child steps          : VisitSteps 
--}
--- cata
-sem_VisitStep :: VisitStep  ->
-                 T_VisitStep 
-sem_VisitStep (ChildIntro _child )  =
-    (sem_VisitStep_ChildIntro _child )
-sem_VisitStep (ChildVisit _child _nonterm _visit )  =
-    (sem_VisitStep_ChildVisit _child _nonterm _visit )
-sem_VisitStep (Sem _name )  =
-    (sem_VisitStep_Sem _name )
-sem_VisitStep (Sim _steps )  =
-    (sem_VisitStep_Sim (sem_VisitSteps _steps ) )
--- semantic domain
-newtype T_VisitStep  = T_VisitStep ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                    (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                    (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                    (Map.Map Identifier PP_Doc) ->
-                                    (Map.Map Identifier PP_Doc) ->
-                                    (Map.Map Identifier (Set.Set String)) ->
-                                    (Map.Map Identifier (Set.Set String)) ->
-                                    ( (Set.Set String),PP_Doc,(Set.Set Identifier),(Set.Set String)))
-data Inh_VisitStep  = Inh_VisitStep {allchildvisit_Inh_VisitStep :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_VisitStep :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_VisitStep :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_VisitStep :: (Map.Map Identifier PP_Doc),mrules_Inh_VisitStep :: (Map.Map Identifier PP_Doc),ruledefs_Inh_VisitStep :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_VisitStep :: (Map.Map Identifier (Set.Set String))}
-data Syn_VisitStep  = Syn_VisitStep {defs_Syn_VisitStep :: (Set.Set String),sem_steps_Syn_VisitStep :: PP_Doc,usedrules_Syn_VisitStep :: (Set.Set Identifier),uses_Syn_VisitStep :: (Set.Set String)}
-wrap_VisitStep :: T_VisitStep  ->
-                  Inh_VisitStep  ->
-                  Syn_VisitStep 
-wrap_VisitStep (T_VisitStep sem ) (Inh_VisitStep _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses )  =
-    (let ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses 
-     in  (Syn_VisitStep _lhsOdefs _lhsOsem_steps _lhsOusedrules _lhsOuses ))
-sem_VisitStep_ChildIntro :: Identifier ->
-                            T_VisitStep 
-sem_VisitStep_ChildIntro child_  =
-    (T_VisitStep (\ _lhsIallchildvisit
-                    _lhsIavisitdefs
-                    _lhsIavisituses
-                    _lhsIchildintros
-                    _lhsImrules
-                    _lhsIruledefs
-                    _lhsIruleuses ->
-                      (let _lhsOsem_steps :: PP_Doc
-                           _lhsOdefs :: (Set.Set String)
-                           _lhsOusedrules :: (Set.Set Identifier)
-                           _lhsOuses :: (Set.Set String)
-                           -- "ExecutionPlan2Hs.ag"(line 307, column 16)
-                           _lhsOsem_steps =
-                               ({-# LINE 307 "ExecutionPlan2Hs.ag" #-}
-                                maybe (error $ "Child " ++ show child_ ++ " not found in: " ++ show _lhsIchildintros) id $ Map.lookup child_ _lhsIchildintros
-                                {-# LINE 2901 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 458, column 16)
-                           _lhsOdefs =
-                               ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
-                                Set.singleton $ locname child_
-                                {-# LINE 2907 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                           _lhsOusedrules =
-                               ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                                Set.empty
-                                {-# LINE 2913 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 454, column 38)
-                           _lhsOuses =
-                               ({-# LINE 454 "ExecutionPlan2Hs.ag" #-}
-                                Set.empty
-                                {-# LINE 2919 "ExecutionPlan2Hs.hs" #-}
-                                )
-                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
-sem_VisitStep_ChildVisit :: Identifier ->
-                            NontermIdent ->
-                            VisitIdentifier ->
-                            T_VisitStep 
-sem_VisitStep_ChildVisit child_ nonterm_ visit_  =
-    (T_VisitStep (\ _lhsIallchildvisit
-                    _lhsIavisitdefs
-                    _lhsIavisituses
-                    _lhsIchildintros
-                    _lhsImrules
-                    _lhsIruledefs
-                    _lhsIruleuses ->
-                      (let _lhsOsem_steps :: PP_Doc
-                           _lhsOdefs :: (Set.Set String)
-                           _lhsOuses :: (Set.Set String)
-                           _lhsOusedrules :: (Set.Set Identifier)
-                           -- "ExecutionPlan2Hs.ag"(line 308, column 16)
-                           _lhsOsem_steps =
-                               ({-# LINE 308 "ExecutionPlan2Hs.ag" #-}
-                                (maybe (error "Visit not found") id $ Map.lookup visit_ _lhsIallchildvisit) $ child_
-                                {-# LINE 2942 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 459, column 16)
-                           _lhsOdefs =
-                               ({-# LINE 459 "ExecutionPlan2Hs.ag" #-}
-                                maybe (error "Visit not found") (Set.map $ attrname True child_) $ Map.lookup visit_ _lhsIavisitdefs
-                                {-# LINE 2948 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 460, column 16)
-                           _lhsOuses =
-                               ({-# LINE 460 "ExecutionPlan2Hs.ag" #-}
-                                Set.insert (locname child_) $
-                                maybe (error "Visit not found") (Set.map $ attrname False child_) $ Map.lookup visit_ _lhsIavisituses
-                                {-# LINE 2955 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                           _lhsOusedrules =
-                               ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                                Set.empty
-                                {-# LINE 2961 "ExecutionPlan2Hs.hs" #-}
-                                )
-                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
-sem_VisitStep_Sem :: Identifier ->
-                     T_VisitStep 
-sem_VisitStep_Sem name_  =
-    (T_VisitStep (\ _lhsIallchildvisit
-                    _lhsIavisitdefs
-                    _lhsIavisituses
-                    _lhsIchildintros
-                    _lhsImrules
-                    _lhsIruledefs
-                    _lhsIruleuses ->
-                      (let _lhsOusedrules :: (Set.Set Identifier)
-                           _lhsOsem_steps :: PP_Doc
-                           _lhsOdefs :: (Set.Set String)
-                           _lhsOuses :: (Set.Set String)
-                           -- "ExecutionPlan2Hs.ag"(line 179, column 9)
-                           _lhsOusedrules =
-                               ({-# LINE 179 "ExecutionPlan2Hs.ag" #-}
-                                Set.singleton name_
-                                {-# LINE 2982 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 306, column 16)
-                           _lhsOsem_steps =
-                               ({-# LINE 306 "ExecutionPlan2Hs.ag" #-}
-                                maybe (error "Rule not found") id $ Map.lookup name_ _lhsImrules
-                                {-# LINE 2988 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 456, column 16)
-                           _lhsOdefs =
-                               ({-# LINE 456 "ExecutionPlan2Hs.ag" #-}
-                                maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruledefs
-                                {-# LINE 2994 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- "ExecutionPlan2Hs.ag"(line 457, column 16)
-                           _lhsOuses =
-                               ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
-                                maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruleuses
-                                {-# LINE 3000 "ExecutionPlan2Hs.hs" #-}
-                                )
-                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
-sem_VisitStep_Sim :: T_VisitSteps  ->
-                     T_VisitStep 
-sem_VisitStep_Sim (T_VisitSteps steps_ )  =
-    (T_VisitStep (\ _lhsIallchildvisit
-                    _lhsIavisitdefs
-                    _lhsIavisituses
-                    _lhsIchildintros
-                    _lhsImrules
-                    _lhsIruledefs
-                    _lhsIruleuses ->
-                      (let _lhsOdefs :: (Set.Set String)
-                           _lhsOsem_steps :: PP_Doc
-                           _lhsOusedrules :: (Set.Set Identifier)
-                           _lhsOuses :: (Set.Set String)
-                           _stepsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                           _stepsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                           _stepsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                           _stepsOchildintros :: (Map.Map Identifier PP_Doc)
-                           _stepsOmrules :: (Map.Map Identifier PP_Doc)
-                           _stepsOruledefs :: (Map.Map Identifier (Set.Set String))
-                           _stepsOruleuses :: (Map.Map Identifier (Set.Set String))
-                           _stepsIdefs :: (Set.Set String)
-                           _stepsIsem_steps :: PP_Doc
-                           _stepsIusedrules :: (Set.Set Identifier)
-                           _stepsIuses :: (Set.Set String)
-                           -- use rule "ExecutionPlan2Hs.ag"(line 453, column 38)
-                           _lhsOdefs =
-                               ({-# LINE 453 "ExecutionPlan2Hs.ag" #-}
-                                _stepsIdefs
-                                {-# LINE 3032 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 304, column 43)
-                           _lhsOsem_steps =
-                               ({-# LINE 304 "ExecutionPlan2Hs.ag" #-}
-                                _stepsIsem_steps
-                                {-# LINE 3038 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                           _lhsOusedrules =
-                               ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                                _stepsIusedrules
-                                {-# LINE 3044 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- use rule "ExecutionPlan2Hs.ag"(line 454, column 38)
-                           _lhsOuses =
-                               ({-# LINE 454 "ExecutionPlan2Hs.ag" #-}
-                                _stepsIuses
-                                {-# LINE 3050 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOallchildvisit =
-                               ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIallchildvisit
-                                {-# LINE 3056 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOavisitdefs =
-                               ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIavisitdefs
-                                {-# LINE 3062 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOavisituses =
-                               ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIavisituses
-                                {-# LINE 3068 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOchildintros =
-                               ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIchildintros
-                                {-# LINE 3074 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOmrules =
-                               ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                                _lhsImrules
-                                {-# LINE 3080 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOruledefs =
-                               ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIruledefs
-                                {-# LINE 3086 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           -- copy rule (down)
-                           _stepsOruleuses =
-                               ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                                _lhsIruleuses
-                                {-# LINE 3092 "ExecutionPlan2Hs.hs" #-}
-                                )
-                           ( _stepsIdefs,_stepsIsem_steps,_stepsIusedrules,_stepsIuses) =
-                               steps_ _stepsOallchildvisit _stepsOavisitdefs _stepsOavisituses _stepsOchildintros _stepsOmrules _stepsOruledefs _stepsOruleuses 
-                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
--- VisitSteps --------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         childintros          : Map.Map Identifier PP_Doc
-         mrules               : Map.Map Identifier PP_Doc
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-      synthesized attributes:
-         defs                 : Set.Set String
-         sem_steps            : PP_Doc
-         usedrules            : Set.Set Identifier
-         uses                 : Set.Set String
-   alternatives:
-      alternative Cons:
-         child hd             : VisitStep 
-         child tl             : VisitSteps 
-      alternative Nil:
--}
--- cata
-sem_VisitSteps :: VisitSteps  ->
-                  T_VisitSteps 
-sem_VisitSteps list  =
-    (Prelude.foldr sem_VisitSteps_Cons sem_VisitSteps_Nil (Prelude.map sem_VisitStep list) )
--- semantic domain
-newtype T_VisitSteps  = T_VisitSteps ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                                      (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                      (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                                      (Map.Map Identifier PP_Doc) ->
-                                      (Map.Map Identifier PP_Doc) ->
-                                      (Map.Map Identifier (Set.Set String)) ->
-                                      (Map.Map Identifier (Set.Set String)) ->
-                                      ( (Set.Set String),PP_Doc,(Set.Set Identifier),(Set.Set String)))
-data Inh_VisitSteps  = Inh_VisitSteps {allchildvisit_Inh_VisitSteps :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_VisitSteps :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_VisitSteps :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_VisitSteps :: (Map.Map Identifier PP_Doc),mrules_Inh_VisitSteps :: (Map.Map Identifier PP_Doc),ruledefs_Inh_VisitSteps :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_VisitSteps :: (Map.Map Identifier (Set.Set String))}
-data Syn_VisitSteps  = Syn_VisitSteps {defs_Syn_VisitSteps :: (Set.Set String),sem_steps_Syn_VisitSteps :: PP_Doc,usedrules_Syn_VisitSteps :: (Set.Set Identifier),uses_Syn_VisitSteps :: (Set.Set String)}
-wrap_VisitSteps :: T_VisitSteps  ->
-                   Inh_VisitSteps  ->
-                   Syn_VisitSteps 
-wrap_VisitSteps (T_VisitSteps sem ) (Inh_VisitSteps _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses )  =
-    (let ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses 
-     in  (Syn_VisitSteps _lhsOdefs _lhsOsem_steps _lhsOusedrules _lhsOuses ))
-sem_VisitSteps_Cons :: T_VisitStep  ->
-                       T_VisitSteps  ->
-                       T_VisitSteps 
-sem_VisitSteps_Cons (T_VisitStep hd_ ) (T_VisitSteps tl_ )  =
-    (T_VisitSteps (\ _lhsIallchildvisit
-                     _lhsIavisitdefs
-                     _lhsIavisituses
-                     _lhsIchildintros
-                     _lhsImrules
-                     _lhsIruledefs
-                     _lhsIruleuses ->
-                       (let _lhsOdefs :: (Set.Set String)
-                            _lhsOsem_steps :: PP_Doc
-                            _lhsOusedrules :: (Set.Set Identifier)
-                            _lhsOuses :: (Set.Set String)
-                            _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                            _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                            _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                            _hdOchildintros :: (Map.Map Identifier PP_Doc)
-                            _hdOmrules :: (Map.Map Identifier PP_Doc)
-                            _hdOruledefs :: (Map.Map Identifier (Set.Set String))
-                            _hdOruleuses :: (Map.Map Identifier (Set.Set String))
-                            _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                            _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                            _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                            _tlOchildintros :: (Map.Map Identifier PP_Doc)
-                            _tlOmrules :: (Map.Map Identifier PP_Doc)
-                            _tlOruledefs :: (Map.Map Identifier (Set.Set String))
-                            _tlOruleuses :: (Map.Map Identifier (Set.Set String))
-                            _hdIdefs :: (Set.Set String)
-                            _hdIsem_steps :: PP_Doc
-                            _hdIusedrules :: (Set.Set Identifier)
-                            _hdIuses :: (Set.Set String)
-                            _tlIdefs :: (Set.Set String)
-                            _tlIsem_steps :: PP_Doc
-                            _tlIusedrules :: (Set.Set Identifier)
-                            _tlIuses :: (Set.Set String)
-                            -- use rule "ExecutionPlan2Hs.ag"(line 453, column 38)
-                            _lhsOdefs =
-                                ({-# LINE 453 "ExecutionPlan2Hs.ag" #-}
-                                 _hdIdefs `Set.union` _tlIdefs
-                                 {-# LINE 3182 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 304, column 43)
-                            _lhsOsem_steps =
-                                ({-# LINE 304 "ExecutionPlan2Hs.ag" #-}
-                                 _hdIsem_steps >-< _tlIsem_steps
-                                 {-# LINE 3188 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                            _lhsOusedrules =
-                                ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                                 _hdIusedrules `Set.union` _tlIusedrules
-                                 {-# LINE 3194 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 454, column 38)
-                            _lhsOuses =
-                                ({-# LINE 454 "ExecutionPlan2Hs.ag" #-}
-                                 _hdIuses `Set.union` _tlIuses
-                                 {-# LINE 3200 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOallchildvisit =
-                                ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIallchildvisit
-                                 {-# LINE 3206 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOavisitdefs =
-                                ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIavisitdefs
-                                 {-# LINE 3212 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOavisituses =
-                                ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIavisituses
-                                 {-# LINE 3218 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOchildintros =
-                                ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIchildintros
-                                 {-# LINE 3224 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOmrules =
-                                ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsImrules
-                                 {-# LINE 3230 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOruledefs =
-                                ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIruledefs
-                                 {-# LINE 3236 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _hdOruleuses =
-                                ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIruleuses
-                                 {-# LINE 3242 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOallchildvisit =
-                                ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIallchildvisit
-                                 {-# LINE 3248 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOavisitdefs =
-                                ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIavisitdefs
-                                 {-# LINE 3254 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOavisituses =
-                                ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIavisituses
-                                 {-# LINE 3260 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOchildintros =
-                                ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIchildintros
-                                 {-# LINE 3266 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOmrules =
-                                ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsImrules
-                                 {-# LINE 3272 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOruledefs =
-                                ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIruledefs
-                                 {-# LINE 3278 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _tlOruleuses =
-                                ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                                 _lhsIruleuses
-                                 {-# LINE 3284 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            ( _hdIdefs,_hdIsem_steps,_hdIusedrules,_hdIuses) =
-                                hd_ _hdOallchildvisit _hdOavisitdefs _hdOavisituses _hdOchildintros _hdOmrules _hdOruledefs _hdOruleuses 
-                            ( _tlIdefs,_tlIsem_steps,_tlIusedrules,_tlIuses) =
-                                tl_ _tlOallchildvisit _tlOavisitdefs _tlOavisituses _tlOchildintros _tlOmrules _tlOruledefs _tlOruleuses 
-                        in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
-sem_VisitSteps_Nil :: T_VisitSteps 
-sem_VisitSteps_Nil  =
-    (T_VisitSteps (\ _lhsIallchildvisit
-                     _lhsIavisitdefs
-                     _lhsIavisituses
-                     _lhsIchildintros
-                     _lhsImrules
-                     _lhsIruledefs
-                     _lhsIruleuses ->
-                       (let _lhsOdefs :: (Set.Set String)
-                            _lhsOsem_steps :: PP_Doc
-                            _lhsOusedrules :: (Set.Set Identifier)
-                            _lhsOuses :: (Set.Set String)
-                            -- use rule "ExecutionPlan2Hs.ag"(line 453, column 38)
-                            _lhsOdefs =
-                                ({-# LINE 453 "ExecutionPlan2Hs.ag" #-}
-                                 Set.empty
-                                 {-# LINE 3308 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 304, column 43)
-                            _lhsOsem_steps =
-                                ({-# LINE 304 "ExecutionPlan2Hs.ag" #-}
-                                 empty
-                                 {-# LINE 3314 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                            _lhsOusedrules =
-                                ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                                 Set.empty
-                                 {-# LINE 3320 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                            -- use rule "ExecutionPlan2Hs.ag"(line 454, column 38)
-                            _lhsOuses =
-                                ({-# LINE 454 "ExecutionPlan2Hs.ag" #-}
-                                 Set.empty
-                                 {-# LINE 3326 "ExecutionPlan2Hs.hs" #-}
-                                 )
-                        in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
--- Visits ------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         allintramap          : Map.Map StateIdentifier (Set.Set String)
-         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
-         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
-         childintros          : Map.Map Identifier PP_Doc
-         inhmap               : Attributes
-         mrules               : Map.Map Identifier PP_Doc
-         nt                   : NontermIdent
-         ruledefs             : Map.Map Identifier (Set.Set String)
-         ruleuses             : Map.Map Identifier (Set.Set String)
-         synmap               : Attributes
-         terminaldefs         : Set.Set String
-      synthesized attributes:
-         allvisits            : [(VisitIdentifier,StateIdentifier, StateIdentifier)]
-         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
-         intramap             : Map.Map StateIdentifier (Set.Set String)
-         sem_visit            :  [(StateIdentifier,PP_Doc)] 
-         t_visits             : PP_Doc
-         usedrules            : Set.Set Identifier
-         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
-         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
-   alternatives:
-      alternative Cons:
-         child hd             : Visit 
-         child tl             : Visits 
-      alternative Nil:
--}
--- cata
-sem_Visits :: Visits  ->
-              T_Visits 
-sem_Visits list  =
-    (Prelude.foldr sem_Visits_Cons sem_Visits_Nil (Prelude.map sem_Visit list) )
--- semantic domain
-newtype T_Visits  = T_Visits ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
-                              (Map.Map StateIdentifier (Set.Set String)) ->
-                              (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                              (Map.Map VisitIdentifier (Set.Set Identifier)) ->
-                              (Map.Map Identifier PP_Doc) ->
-                              Attributes ->
-                              (Map.Map Identifier PP_Doc) ->
-                              NontermIdent ->
-                              (Map.Map Identifier (Set.Set String)) ->
-                              (Map.Map Identifier (Set.Set String)) ->
-                              Attributes ->
-                              (Set.Set String) ->
-                              ( ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(Map.Map StateIdentifier (Set.Set String)),( [(StateIdentifier,PP_Doc)] ),PP_Doc,(Set.Set Identifier),(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
-data Inh_Visits  = Inh_Visits {allchildvisit_Inh_Visits :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allintramap_Inh_Visits :: (Map.Map StateIdentifier (Set.Set String)),avisitdefs_Inh_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_Visits :: (Map.Map Identifier PP_Doc),inhmap_Inh_Visits :: Attributes,mrules_Inh_Visits :: (Map.Map Identifier PP_Doc),nt_Inh_Visits :: NontermIdent,ruledefs_Inh_Visits :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_Visits :: (Map.Map Identifier (Set.Set String)),synmap_Inh_Visits :: Attributes,terminaldefs_Inh_Visits :: (Set.Set String)}
-data Syn_Visits  = Syn_Visits {allvisits_Syn_Visits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)]),childvisit_Syn_Visits :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),intramap_Syn_Visits :: (Map.Map StateIdentifier (Set.Set String)),sem_visit_Syn_Visits :: ( [(StateIdentifier,PP_Doc)] ),t_visits_Syn_Visits :: PP_Doc,usedrules_Syn_Visits :: (Set.Set Identifier),visitdefs_Syn_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier))}
-wrap_Visits :: T_Visits  ->
-               Inh_Visits  ->
-               Syn_Visits 
-wrap_Visits (T_Visits sem ) (Inh_Visits _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs )  =
-    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs 
-     in  (Syn_Visits _lhsOallvisits _lhsOchildvisit _lhsOintramap _lhsOsem_visit _lhsOt_visits _lhsOusedrules _lhsOvisitdefs _lhsOvisituses ))
-sem_Visits_Cons :: T_Visit  ->
-                   T_Visits  ->
-                   T_Visits 
-sem_Visits_Cons (T_Visit hd_ ) (T_Visits tl_ )  =
-    (T_Visits (\ _lhsIallchildvisit
-                 _lhsIallintramap
-                 _lhsIavisitdefs
-                 _lhsIavisituses
-                 _lhsIchildintros
-                 _lhsIinhmap
-                 _lhsImrules
-                 _lhsInt
-                 _lhsIruledefs
-                 _lhsIruleuses
-                 _lhsIsynmap
-                 _lhsIterminaldefs ->
-                   (let _lhsOallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                        _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _lhsOsem_visit :: ( [(StateIdentifier,PP_Doc)] )
-                        _lhsOt_visits :: PP_Doc
-                        _lhsOusedrules :: (Set.Set Identifier)
-                        _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _hdOallintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _hdOchildintros :: (Map.Map Identifier PP_Doc)
-                        _hdOinhmap :: Attributes
-                        _hdOmrules :: (Map.Map Identifier PP_Doc)
-                        _hdOnt :: NontermIdent
-                        _hdOruledefs :: (Map.Map Identifier (Set.Set String))
-                        _hdOruleuses :: (Map.Map Identifier (Set.Set String))
-                        _hdOsynmap :: Attributes
-                        _hdOterminaldefs :: (Set.Set String)
-                        _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _tlOallintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _tlOchildintros :: (Map.Map Identifier PP_Doc)
-                        _tlOinhmap :: Attributes
-                        _tlOmrules :: (Map.Map Identifier PP_Doc)
-                        _tlOnt :: NontermIdent
-                        _tlOruledefs :: (Map.Map Identifier (Set.Set String))
-                        _tlOruleuses :: (Map.Map Identifier (Set.Set String))
-                        _tlOsynmap :: Attributes
-                        _tlOterminaldefs :: (Set.Set String)
-                        _hdIallvisits :: ((VisitIdentifier,StateIdentifier, StateIdentifier))
-                        _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _hdIintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _hdIsem_visit :: (  (StateIdentifier,PP_Doc)  )
-                        _hdIt_visits :: PP_Doc
-                        _hdIusedrules :: (Set.Set Identifier)
-                        _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _tlIallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                        _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _tlIintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _tlIsem_visit :: ( [(StateIdentifier,PP_Doc)] )
-                        _tlIt_visits :: PP_Doc
-                        _tlIusedrules :: (Set.Set Identifier)
-                        _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        -- use rule "ExecutionPlan2Hs.ag"(line 137, column 29)
-                        _lhsOallvisits =
-                            ({-# LINE 137 "ExecutionPlan2Hs.ag" #-}
-                             _hdIallvisits : _tlIallvisits
-                             {-# LINE 3455 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                        _lhsOchildvisit =
-                            ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                             _hdIchildvisit `Map.union` _tlIchildvisit
-                             {-# LINE 3461 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 398, column 30)
-                        _lhsOintramap =
-                            ({-# LINE 398 "ExecutionPlan2Hs.ag" #-}
-                             _hdIintramap `uwSetUnion` _tlIintramap
-                             {-# LINE 3467 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 289, column 29)
-                        _lhsOsem_visit =
-                            ({-# LINE 289 "ExecutionPlan2Hs.ag" #-}
-                             _hdIsem_visit : _tlIsem_visit
-                             {-# LINE 3473 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 188, column 54)
-                        _lhsOt_visits =
-                            ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                             _hdIt_visits >-< _tlIt_visits
-                             {-# LINE 3479 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                        _lhsOusedrules =
-                            ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                             _hdIusedrules `Set.union` _tlIusedrules
-                             {-# LINE 3485 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                        _lhsOvisitdefs =
-                            ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                             _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
-                             {-# LINE 3491 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                        _lhsOvisituses =
-                            ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                             _hdIvisituses `uwSetUnion` _tlIvisituses
-                             {-# LINE 3497 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOallchildvisit =
-                            ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIallchildvisit
-                             {-# LINE 3503 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOallintramap =
-                            ({-# LINE 397 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIallintramap
-                             {-# LINE 3509 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOavisitdefs =
-                            ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIavisitdefs
-                             {-# LINE 3515 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOavisituses =
-                            ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIavisituses
-                             {-# LINE 3521 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOchildintros =
-                            ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIchildintros
-                             {-# LINE 3527 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOinhmap =
-                            ({-# LINE 128 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIinhmap
-                             {-# LINE 3533 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOmrules =
-                            ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                             _lhsImrules
-                             {-# LINE 3539 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOnt =
-                            ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                             _lhsInt
-                             {-# LINE 3545 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOruledefs =
-                            ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIruledefs
-                             {-# LINE 3551 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOruleuses =
-                            ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIruleuses
-                             {-# LINE 3557 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOsynmap =
-                            ({-# LINE 129 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIsynmap
-                             {-# LINE 3563 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _hdOterminaldefs =
-                            ({-# LINE 400 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIterminaldefs
-                             {-# LINE 3569 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOallchildvisit =
-                            ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIallchildvisit
-                             {-# LINE 3575 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOallintramap =
-                            ({-# LINE 397 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIallintramap
-                             {-# LINE 3581 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOavisitdefs =
-                            ({-# LINE 446 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIavisitdefs
-                             {-# LINE 3587 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOavisituses =
-                            ({-# LINE 447 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIavisituses
-                             {-# LINE 3593 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOchildintros =
-                            ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIchildintros
-                             {-# LINE 3599 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOinhmap =
-                            ({-# LINE 128 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIinhmap
-                             {-# LINE 3605 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOmrules =
-                            ({-# LINE 303 "ExecutionPlan2Hs.ag" #-}
-                             _lhsImrules
-                             {-# LINE 3611 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOnt =
-                            ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                             _lhsInt
-                             {-# LINE 3617 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOruledefs =
-                            ({-# LINE 421 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIruledefs
-                             {-# LINE 3623 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOruleuses =
-                            ({-# LINE 422 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIruleuses
-                             {-# LINE 3629 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOsynmap =
-                            ({-# LINE 129 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIsynmap
-                             {-# LINE 3635 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _tlOterminaldefs =
-                            ({-# LINE 400 "ExecutionPlan2Hs.ag" #-}
-                             _lhsIterminaldefs
-                             {-# LINE 3641 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        ( _hdIallvisits,_hdIchildvisit,_hdIintramap,_hdIsem_visit,_hdIt_visits,_hdIusedrules,_hdIvisitdefs,_hdIvisituses) =
-                            hd_ _hdOallchildvisit _hdOallintramap _hdOavisitdefs _hdOavisituses _hdOchildintros _hdOinhmap _hdOmrules _hdOnt _hdOruledefs _hdOruleuses _hdOsynmap _hdOterminaldefs 
-                        ( _tlIallvisits,_tlIchildvisit,_tlIintramap,_tlIsem_visit,_tlIt_visits,_tlIusedrules,_tlIvisitdefs,_tlIvisituses) =
-                            tl_ _tlOallchildvisit _tlOallintramap _tlOavisitdefs _tlOavisituses _tlOchildintros _tlOinhmap _tlOmrules _tlOnt _tlOruledefs _tlOruleuses _tlOsynmap _tlOterminaldefs 
-                    in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses))) )
-sem_Visits_Nil :: T_Visits 
-sem_Visits_Nil  =
-    (T_Visits (\ _lhsIallchildvisit
-                 _lhsIallintramap
-                 _lhsIavisitdefs
-                 _lhsIavisituses
-                 _lhsIchildintros
-                 _lhsIinhmap
-                 _lhsImrules
-                 _lhsInt
-                 _lhsIruledefs
-                 _lhsIruleuses
-                 _lhsIsynmap
-                 _lhsIterminaldefs ->
-                   (let _lhsOallvisits :: ([(VisitIdentifier,StateIdentifier, StateIdentifier)])
-                        _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
-                        _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
-                        _lhsOsem_visit :: ( [(StateIdentifier,PP_Doc)] )
-                        _lhsOt_visits :: PP_Doc
-                        _lhsOusedrules :: (Set.Set Identifier)
-                        _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
-                        -- use rule "ExecutionPlan2Hs.ag"(line 137, column 29)
-                        _lhsOallvisits =
-                            ({-# LINE 137 "ExecutionPlan2Hs.ag" #-}
-                             []
-                             {-# LINE 3674 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 379, column 36)
-                        _lhsOchildvisit =
-                            ({-# LINE 379 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 3680 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 398, column 30)
-                        _lhsOintramap =
-                            ({-# LINE 398 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 3686 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 289, column 29)
-                        _lhsOsem_visit =
-                            ({-# LINE 289 "ExecutionPlan2Hs.ag" #-}
-                             []
-                             {-# LINE 3692 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 188, column 54)
-                        _lhsOt_visits =
-                            ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
-                             empty
-                             {-# LINE 3698 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 175, column 56)
-                        _lhsOusedrules =
-                            ({-# LINE 175 "ExecutionPlan2Hs.ag" #-}
-                             Set.empty
-                             {-# LINE 3704 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 436, column 36)
-                        _lhsOvisitdefs =
-                            ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 3710 "ExecutionPlan2Hs.hs" #-}
-                             )
-                        -- use rule "ExecutionPlan2Hs.ag"(line 437, column 36)
-                        _lhsOvisituses =
-                            ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
-                             Map.empty
-                             {-# LINE 3716 "ExecutionPlan2Hs.hs" #-}
+-- UUAGC 0.9.38.6 (ExecutionPlan2Hs.ag)
+module ExecutionPlan2Hs where
+{-# LINE 7 "ExecutionPlan2Hs.ag" #-}
+
+import ExecutionPlan
+import Pretty
+import PPUtil
+import Options
+import Data.Maybe
+import Debug.Trace
+import System.IO
+import System.Directory
+
+import TokenDef
+import HsToken
+
+import qualified Data.Set as Set
+import qualified Data.Map as Map
+{-# LINE 22 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 2 "./ExecutionPlan.ag" #-}
+
+-- VisitSyntax.ag imports
+import Patterns    (Pattern(..),Patterns)
+import Expression  (Expression(..))
+import CommonTypes
+
+import qualified Data.Set as Set
+{-# LINE 32 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 2 "./Patterns.ag" #-}
+
+-- Patterns.ag imports
+import UU.Scanner.Position(Pos)
+import CommonTypes (ConstructorIdent,Identifier)
+{-# LINE 39 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 2 "./Expression.ag" #-}
+
+import UU.Scanner.Position(Pos)
+import HsToken
+{-# LINE 45 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 2 "./HsToken.ag" #-}
+
+import CommonTypes
+import UU.Scanner.Position(Pos)
+{-# LINE 51 "../src-derived/ExecutionPlan2Hs.hs" #-}
+{-# LINE 204 "ExecutionPlan2Hs.ag" #-}
+type VisitStateState = (VisitIdentifier,StateIdentifier, StateIdentifier)
+{-# LINE 54 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 475 "ExecutionPlan2Hs.ag" #-}
+
+uwSetUnion :: (Ord a, Ord b) => Map.Map a (Set.Set b) -> Map.Map a (Set.Set b) -> Map.Map a (Set.Set b)
+uwSetUnion = Map.unionWith Set.union
+{-# LINE 60 "../src-derived/ExecutionPlan2Hs.hs" #-}
+
+{-# LINE 644 "ExecutionPlan2Hs.ag" #-}
+
+renderDocs :: [PP_Doc] -> String
+renderDocs pps = foldr (.) id (map (\d -> (disp d 50000) . ( '\n':) ) pps) ""
+
+writeModule :: FilePath -> [PP_Doc] -> IO ()
+writeModule path docs
+  = do bExists <- doesFileExist path
+       if bExists
+        then do input <- readFile path
+                seq (length input) (return ())
+                if input /= output
+                 then dumpIt
+                 else return ()
+        else dumpIt
+  where
+    output = renderDocs docs
+    dumpIt = writeFile path output
+{-# LINE 80 "../src-derived/ExecutionPlan2Hs.hs" #-}
+-- EChild ------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         nt                   : NontermIdent
+         options              : Options
+      synthesized attributes:
+         argnames             :   PP_Doc  
+         argnamesw            :  PP_Doc 
+         argtps               :   PP_Doc  
+         childintros          : Map.Map Identifier PP_Doc
+         datatype             : PP_Doc
+         terminaldefs         : Set.Set String
+   alternatives:
+      alternative EChild:
+         child name           : {Identifier}
+         child tp             : {Type}
+         child virtual        : {Maybe (Maybe Type)}
+         visit 0:
+            local addStrict   : _
+            local argnames    : _
+-}
+-- cata
+sem_EChild :: EChild  ->
+              T_EChild 
+sem_EChild (EChild _name _tp _virtual )  =
+    (sem_EChild_EChild _name _tp _virtual )
+-- semantic domain
+newtype T_EChild  = T_EChild (NontermIdent ->
+                              Options ->
+                              ( (  PP_Doc  ),( PP_Doc ),(  PP_Doc  ),(Map.Map Identifier PP_Doc),PP_Doc,(Set.Set String)))
+data Inh_EChild  = Inh_EChild {nt_Inh_EChild :: NontermIdent,options_Inh_EChild :: Options}
+data Syn_EChild  = Syn_EChild {argnames_Syn_EChild :: (  PP_Doc  ),argnamesw_Syn_EChild :: ( PP_Doc ),argtps_Syn_EChild :: (  PP_Doc  ),childintros_Syn_EChild :: (Map.Map Identifier PP_Doc),datatype_Syn_EChild :: PP_Doc,terminaldefs_Syn_EChild :: (Set.Set String)}
+wrap_EChild :: T_EChild  ->
+               Inh_EChild  ->
+               Syn_EChild 
+wrap_EChild (T_EChild sem ) (Inh_EChild _lhsInt _lhsIoptions )  =
+    (let ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs) = sem _lhsInt _lhsIoptions 
+     in  (Syn_EChild _lhsOargnames _lhsOargnamesw _lhsOargtps _lhsOchildintros _lhsOdatatype _lhsOterminaldefs ))
+sem_EChild_EChild :: Identifier ->
+                     Type ->
+                     (Maybe (Maybe Type)) ->
+                     T_EChild 
+sem_EChild_EChild name_ tp_ virtual_  =
+    (T_EChild (\ _lhsInt
+                 _lhsIoptions ->
+                   (let _lhsOdatatype :: PP_Doc
+                        _lhsOargnamesw :: ( PP_Doc )
+                        _lhsOargtps :: (  PP_Doc  )
+                        _lhsOchildintros :: (Map.Map Identifier PP_Doc)
+                        _lhsOterminaldefs :: (Set.Set String)
+                        _lhsOargnames :: (  PP_Doc  )
+                        -- "ExecutionPlan2Hs.ag"(line 127, column 12)
+                        _lhsOdatatype =
+                            ({-# LINE 127 "ExecutionPlan2Hs.ag" #-}
+                             if isJust virtual_
+                             then empty
+                             else _addStrict     $ pp_parens $ typeToHaskellString (Just _lhsInt) [] tp_
+                             {-# LINE 139 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 130, column 12)
+                        _addStrict =
+                            ({-# LINE 130 "ExecutionPlan2Hs.ag" #-}
+                             \x -> if strictData _lhsIoptions then "!" >|< x else x
+                             {-# LINE 145 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 177, column 12)
+                        _lhsOargnamesw =
+                            ({-# LINE 177 "ExecutionPlan2Hs.ag" #-}
+                             if isJust virtual_
+                             then empty
+                             else if isNonterminal tp_
+                                  then "(" >#< "sem_" >|< extractNonterminal tp_ >#< "field_" >|< name_ >#< ")"
+                                  else text $ locname name_
+                             {-# LINE 155 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 324, column 12)
+                        _lhsOargtps =
+                            ({-# LINE 324 "ExecutionPlan2Hs.ag" #-}
+                             if isJust virtual_
+                             then empty
+                             else if isNonterminal tp_
+                                  then ("T_" >|< extractNonterminal tp_) >#< "->"
+                                  else (text $ show tp_) >#< "->"
+                             {-# LINE 165 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 329, column 12)
+                        _argnames =
+                            ({-# LINE 329 "ExecutionPlan2Hs.ag" #-}
+                             if isJust virtual_
+                             then empty
+                             else if isNonterminal tp_
+                                  then "field_" >|< name_
+                                  else text $ locname name_
+                             {-# LINE 175 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 390, column 12)
+                        _lhsOchildintros =
+                            ({-# LINE 390 "ExecutionPlan2Hs.ag" #-}
+                             Map.singleton name_ $ locname name_ >#< "<-" >#< "return" >#< "$" >#<
+                             if isJust virtual_
+                             then "sem_" >|< extractNonterminal tp_ >#< instname name_
+                             else "field_" >|< name_
+                             {-# LINE 184 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- "ExecutionPlan2Hs.ag"(line 486, column 12)
+                        _lhsOterminaldefs =
+                            ({-# LINE 486 "ExecutionPlan2Hs.ag" #-}
+                             if isJust virtual_ || isNonterminal tp_
+                             then Set.empty
+                             else Set.singleton $ locname name_
+                             {-# LINE 192 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (from local)
+                        _lhsOargnames =
+                            ({-# LINE 319 "ExecutionPlan2Hs.ag" #-}
+                             _argnames
+                             {-# LINE 198 "ExecutionPlan2Hs.hs" #-}
+                             )
+                    in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
+-- EChildren ---------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         nt                   : NontermIdent
+         options              : Options
+      synthesized attributes:
+         argnames             :  [PP_Doc] 
+         argnamesw            : [PP_Doc]
+         argtps               :  [PP_Doc] 
+         childintros          : Map.Map Identifier PP_Doc
+         datatype             : [PP_Doc]
+         terminaldefs         : Set.Set String
+   alternatives:
+      alternative Cons:
+         child hd             : EChild 
+         child tl             : EChildren 
+      alternative Nil:
+-}
+-- cata
+sem_EChildren :: EChildren  ->
+                 T_EChildren 
+sem_EChildren list  =
+    (Prelude.foldr sem_EChildren_Cons sem_EChildren_Nil (Prelude.map sem_EChild list) )
+-- semantic domain
+newtype T_EChildren  = T_EChildren (NontermIdent ->
+                                    Options ->
+                                    ( ( [PP_Doc] ),([PP_Doc]),( [PP_Doc] ),(Map.Map Identifier PP_Doc),([PP_Doc]),(Set.Set String)))
+data Inh_EChildren  = Inh_EChildren {nt_Inh_EChildren :: NontermIdent,options_Inh_EChildren :: Options}
+data Syn_EChildren  = Syn_EChildren {argnames_Syn_EChildren :: ( [PP_Doc] ),argnamesw_Syn_EChildren :: ([PP_Doc]),argtps_Syn_EChildren :: ( [PP_Doc] ),childintros_Syn_EChildren :: (Map.Map Identifier PP_Doc),datatype_Syn_EChildren :: ([PP_Doc]),terminaldefs_Syn_EChildren :: (Set.Set String)}
+wrap_EChildren :: T_EChildren  ->
+                  Inh_EChildren  ->
+                  Syn_EChildren 
+wrap_EChildren (T_EChildren sem ) (Inh_EChildren _lhsInt _lhsIoptions )  =
+    (let ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs) = sem _lhsInt _lhsIoptions 
+     in  (Syn_EChildren _lhsOargnames _lhsOargnamesw _lhsOargtps _lhsOchildintros _lhsOdatatype _lhsOterminaldefs ))
+sem_EChildren_Cons :: T_EChild  ->
+                      T_EChildren  ->
+                      T_EChildren 
+sem_EChildren_Cons (T_EChild hd_ ) (T_EChildren tl_ )  =
+    (T_EChildren (\ _lhsInt
+                    _lhsIoptions ->
+                      (let _lhsOargnames :: ( [PP_Doc] )
+                           _lhsOargnamesw :: ([PP_Doc])
+                           _lhsOargtps :: ( [PP_Doc] )
+                           _lhsOchildintros :: (Map.Map Identifier PP_Doc)
+                           _lhsOdatatype :: ([PP_Doc])
+                           _lhsOterminaldefs :: (Set.Set String)
+                           _hdOnt :: NontermIdent
+                           _hdOoptions :: Options
+                           _tlOnt :: NontermIdent
+                           _tlOoptions :: Options
+                           _hdIargnames :: (  PP_Doc  )
+                           _hdIargnamesw :: ( PP_Doc )
+                           _hdIargtps :: (  PP_Doc  )
+                           _hdIchildintros :: (Map.Map Identifier PP_Doc)
+                           _hdIdatatype :: PP_Doc
+                           _hdIterminaldefs :: (Set.Set String)
+                           _tlIargnames :: ( [PP_Doc] )
+                           _tlIargnamesw :: ([PP_Doc])
+                           _tlIargtps :: ( [PP_Doc] )
+                           _tlIchildintros :: (Map.Map Identifier PP_Doc)
+                           _tlIdatatype :: ([PP_Doc])
+                           _tlIterminaldefs :: (Set.Set String)
+                           -- use rule "ExecutionPlan2Hs.ag"(line 321, column 31)
+                           _lhsOargnames =
+                               ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
+                                _hdIargnames : _tlIargnames
+                                {-# LINE 269 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 174, column 32)
+                           _lhsOargnamesw =
+                               ({-# LINE 174 "ExecutionPlan2Hs.ag" #-}
+                                _hdIargnamesw : _tlIargnamesw
+                                {-# LINE 275 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 320, column 31)
+                           _lhsOargtps =
+                               ({-# LINE 320 "ExecutionPlan2Hs.ag" #-}
+                                _hdIargtps : _tlIargtps
+                                {-# LINE 281 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 381, column 41)
+                           _lhsOchildintros =
+                               ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
+                                _hdIchildintros `Map.union` _tlIchildintros
+                                {-# LINE 287 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 124, column 51)
+                           _lhsOdatatype =
+                               ({-# LINE 124 "ExecutionPlan2Hs.ag" #-}
+                                _hdIdatatype : _tlIdatatype
+                                {-# LINE 293 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 483, column 42)
+                           _lhsOterminaldefs =
+                               ({-# LINE 483 "ExecutionPlan2Hs.ag" #-}
+                                _hdIterminaldefs `Set.union` _tlIterminaldefs
+                                {-# LINE 299 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _hdOnt =
+                               ({-# LINE 123 "ExecutionPlan2Hs.ag" #-}
+                                _lhsInt
+                                {-# LINE 305 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _hdOoptions =
+                               ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIoptions
+                                {-# LINE 311 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _tlOnt =
+                               ({-# LINE 124 "ExecutionPlan2Hs.ag" #-}
+                                _lhsInt
+                                {-# LINE 317 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _tlOoptions =
+                               ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIoptions
+                                {-# LINE 323 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           ( _hdIargnames,_hdIargnamesw,_hdIargtps,_hdIchildintros,_hdIdatatype,_hdIterminaldefs) =
+                               hd_ _hdOnt _hdOoptions 
+                           ( _tlIargnames,_tlIargnamesw,_tlIargtps,_tlIchildintros,_tlIdatatype,_tlIterminaldefs) =
+                               tl_ _tlOnt _tlOoptions 
+                       in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
+sem_EChildren_Nil :: T_EChildren 
+sem_EChildren_Nil  =
+    (T_EChildren (\ _lhsInt
+                    _lhsIoptions ->
+                      (let _lhsOargnames :: ( [PP_Doc] )
+                           _lhsOargnamesw :: ([PP_Doc])
+                           _lhsOargtps :: ( [PP_Doc] )
+                           _lhsOchildintros :: (Map.Map Identifier PP_Doc)
+                           _lhsOdatatype :: ([PP_Doc])
+                           _lhsOterminaldefs :: (Set.Set String)
+                           -- use rule "ExecutionPlan2Hs.ag"(line 321, column 31)
+                           _lhsOargnames =
+                               ({-# LINE 321 "ExecutionPlan2Hs.ag" #-}
+                                []
+                                {-# LINE 344 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 174, column 32)
+                           _lhsOargnamesw =
+                               ({-# LINE 174 "ExecutionPlan2Hs.ag" #-}
+                                []
+                                {-# LINE 350 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 320, column 31)
+                           _lhsOargtps =
+                               ({-# LINE 320 "ExecutionPlan2Hs.ag" #-}
+                                []
+                                {-# LINE 356 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 381, column 41)
+                           _lhsOchildintros =
+                               ({-# LINE 381 "ExecutionPlan2Hs.ag" #-}
+                                Map.empty
+                                {-# LINE 362 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 124, column 51)
+                           _lhsOdatatype =
+                               ({-# LINE 124 "ExecutionPlan2Hs.ag" #-}
+                                []
+                                {-# LINE 368 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 483, column 42)
+                           _lhsOterminaldefs =
+                               ({-# LINE 483 "ExecutionPlan2Hs.ag" #-}
+                                Set.empty
+                                {-# LINE 374 "ExecutionPlan2Hs.hs" #-}
+                                )
+                       in  ( _lhsOargnames,_lhsOargnamesw,_lhsOargtps,_lhsOchildintros,_lhsOdatatype,_lhsOterminaldefs))) )
+-- ENonterminal ------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         derivings            : Derivings
+         importBlocks         : PP_Doc
+         inhmap               : Map.Map NontermIdent Attributes
+         mainFile             : String
+         mainName             : String
+         moduleHeader         : String -> String -> String -> Bool -> String
+         options              : Options
+         optionsLine          : String
+         pragmaBlocks         : String
+         synmap               : Map.Map NontermIdent Attributes
+         textBlocks           : PP_Doc
+         typeSyns             : TypeSyns
+         wrappers             : Set.Set NontermIdent
+      synthesized attributes:
+         appendCommon         :  PP_Doc 
+         appendMain           :  PP_Doc 
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         genProdIO            : IO ()
+         imports              : [PP_Doc]
+         output               : PP_Doc
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative ENonterminal:
+         child nt             : {NontermIdent}
+         child params         : {[Identifier]}
+         child initial        : {StateIdentifier}
+         child initialv       : {Maybe VisitIdentifier}
+         child prods          : EProductions 
+         visit 0:
+            local datatype    : _
+            local derivings   : _
+            local fsemname    : _
+            local semname     : _
+            local frecarg     : _
+            local sem_nt      : _
+            local outedges    : _
+            local inedges     : _
+            local allstates   : _
+            local t_type      : _
+            local t_init      : _
+            local t_states    : _
+            local k_type      : _
+            local k_states    : _
+            local wr_inh      : _
+            local wr_syn      : _
+            local genwrap     : _
+            local wr_inhs     : _
+            local wr_syns     : _
+            local inhlist     : _
+            local synlist     : _
+            local wrapname    : _
+            local inhname     : _
+            local synname     : _
+            local wrapper     : _
+-}
+-- cata
+sem_ENonterminal :: ENonterminal  ->
+                    T_ENonterminal 
+sem_ENonterminal (ENonterminal _nt _params _initial _initialv _prods )  =
+    (sem_ENonterminal_ENonterminal _nt _params _initial _initialv (sem_EProductions _prods ) )
+-- semantic domain
+newtype T_ENonterminal  = T_ENonterminal ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                          Derivings ->
+                                          PP_Doc ->
+                                          (Map.Map NontermIdent Attributes) ->
+                                          String ->
+                                          String ->
+                                          (String -> String -> String -> Bool -> String) ->
+                                          Options ->
+                                          String ->
+                                          String ->
+                                          (Map.Map NontermIdent Attributes) ->
+                                          PP_Doc ->
+                                          TypeSyns ->
+                                          (Set.Set NontermIdent) ->
+                                          ( ( PP_Doc ),( PP_Doc ),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(IO ()),([PP_Doc]),PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_ENonterminal  = Inh_ENonterminal {allchildvisit_Inh_ENonterminal :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),derivings_Inh_ENonterminal :: Derivings,importBlocks_Inh_ENonterminal :: PP_Doc,inhmap_Inh_ENonterminal :: (Map.Map NontermIdent Attributes),mainFile_Inh_ENonterminal :: String,mainName_Inh_ENonterminal :: String,moduleHeader_Inh_ENonterminal :: (String -> String -> String -> Bool -> String),options_Inh_ENonterminal :: Options,optionsLine_Inh_ENonterminal :: String,pragmaBlocks_Inh_ENonterminal :: String,synmap_Inh_ENonterminal :: (Map.Map NontermIdent Attributes),textBlocks_Inh_ENonterminal :: PP_Doc,typeSyns_Inh_ENonterminal :: TypeSyns,wrappers_Inh_ENonterminal :: (Set.Set NontermIdent)}
+data Syn_ENonterminal  = Syn_ENonterminal {appendCommon_Syn_ENonterminal :: ( PP_Doc ),appendMain_Syn_ENonterminal :: ( PP_Doc ),childvisit_Syn_ENonterminal :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),genProdIO_Syn_ENonterminal :: (IO ()),imports_Syn_ENonterminal :: ([PP_Doc]),output_Syn_ENonterminal :: PP_Doc,visitdefs_Syn_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_ENonterminal :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_ENonterminal :: T_ENonterminal  ->
+                     Inh_ENonterminal  ->
+                     Syn_ENonterminal 
+wrap_ENonterminal (T_ENonterminal sem ) (Inh_ENonterminal _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIderivings _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks _lhsItypeSyns _lhsIwrappers )  =
+    (let ( _lhsOappendCommon,_lhsOappendMain,_lhsOchildvisit,_lhsOgenProdIO,_lhsOimports,_lhsOoutput,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIderivings _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks _lhsItypeSyns _lhsIwrappers 
+     in  (Syn_ENonterminal _lhsOappendCommon _lhsOappendMain _lhsOchildvisit _lhsOgenProdIO _lhsOimports _lhsOoutput _lhsOvisitdefs _lhsOvisituses ))
+sem_ENonterminal_ENonterminal :: NontermIdent ->
+                                 ([Identifier]) ->
+                                 StateIdentifier ->
+                                 (Maybe VisitIdentifier) ->
+                                 T_EProductions  ->
+                                 T_ENonterminal 
+sem_ENonterminal_ENonterminal nt_ params_ initial_ initialv_ (T_EProductions prods_ )  =
+    (T_ENonterminal (\ _lhsIallchildvisit
+                       _lhsIavisitdefs
+                       _lhsIavisituses
+                       _lhsIderivings
+                       _lhsIimportBlocks
+                       _lhsIinhmap
+                       _lhsImainFile
+                       _lhsImainName
+                       _lhsImoduleHeader
+                       _lhsIoptions
+                       _lhsIoptionsLine
+                       _lhsIpragmaBlocks
+                       _lhsIsynmap
+                       _lhsItextBlocks
+                       _lhsItypeSyns
+                       _lhsIwrappers ->
+                         (let _prodsOrename :: Bool
+                              _lhsOoutput :: PP_Doc
+                              _prodsOinhmap :: Attributes
+                              _prodsOsynmap :: Attributes
+                              _prodsOnt :: NontermIdent
+                              _prodsOinitial :: StateIdentifier
+                              _prodsOallstates :: (Set.Set StateIdentifier)
+                              _lhsOappendMain :: ( PP_Doc )
+                              _lhsOappendCommon :: ( PP_Doc )
+                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _lhsOgenProdIO :: (IO ())
+                              _lhsOimports :: ([PP_Doc])
+                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _prodsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _prodsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _prodsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _prodsOimportBlocks :: PP_Doc
+                              _prodsOmainFile :: String
+                              _prodsOmainName :: String
+                              _prodsOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                              _prodsOoptions :: Options
+                              _prodsOoptionsLine :: String
+                              _prodsOpragmaBlocks :: String
+                              _prodsOtextBlocks :: PP_Doc
+                              _prodsIallvisits :: ([VisitStateState])
+                              _prodsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _prodsIdatatype :: ([PP_Doc])
+                              _prodsIgenProdIO :: (IO ())
+                              _prodsIimports :: ([PP_Doc])
+                              _prodsIsem_nt :: PP_Doc
+                              _prodsIsem_prod :: PP_Doc
+                              _prodsIt_visits :: PP_Doc
+                              _prodsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _prodsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              -- "ExecutionPlan2Hs.ag"(line 45, column 18)
+                              _prodsOrename =
+                                  ({-# LINE 45 "ExecutionPlan2Hs.ag" #-}
+                                   rename _lhsIoptions
+                                   {-# LINE 533 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 62, column 18)
+                              _lhsOoutput =
+                                  ({-# LINE 62 "ExecutionPlan2Hs.ag" #-}
+                                   ("-- " ++ getName nt_ ++ " " ++ replicate (60 - length (getName nt_)) '-')
+                                   >-< (if dataTypes _lhsIoptions
+                                        then "-- data"
+                                             >-< _datatype
+                                             >-< ""
+                                        else empty)
+                                   >-< (if nt_ `Set.member` _lhsIwrappers
+                                        then "-- wrapper"
+                                             >-< _wr_inh
+                                             >-< _wr_syn
+                                             >-< _wrapper
+                                             >-< ""
+                                        else empty)
+                                   >-< (if   folds _lhsIoptions
+                                        then "-- cata"
+                                             >-< _sem_nt
+                                             >-< ""
+                                        else empty)
+                                   >-< (if   semfuns _lhsIoptions
+                                        then "-- semantic domain"
+                                             >-< _t_init
+                                             >-< _t_states
+                                             >-< _k_states
+                                             >-< _prodsIt_visits
+                                             >-< _prodsIsem_prod
+                                             >-< ""
+                                        else empty)
+                                   {-# LINE 565 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 101, column 18)
+                              _datatype =
+                                  ({-# LINE 101 "ExecutionPlan2Hs.ag" #-}
+                                   case lookup nt_ _lhsItypeSyns of
+                                      Nothing -> "data" >#< nt_ >#< (vlist $ ("=" >#< head _prodsIdatatype)
+                                                  : (map ("|" >#<) $ tail _prodsIdatatype)) >#< _derivings
+                                      Just (List t) -> "type" >#< nt_ >#< "=" >#< "[" >#< show t >#< "]"
+                                      Just (Maybe t) -> "type" >#< nt_ >#< "=" >#< "Maybe" >#< show t
+                                      Just (Tuple ts) -> "type" >#< nt_ >#< "=" >#< pp_parens (ppCommas $ map (show . snd) ts)
+                                      Just (Either l r) -> "type" >#< nt_ >#< "=" >#< "Either" >#< show l >#< show r
+                                      Just (Map k v) -> "type" >#< nt_ >#< "=" >#< "Data.Map.Map" >#< pp_parens (show k) >#< show v
+                                      Just (IntMap t) -> "type" >#< nt_ >#< "=" >#< "Data.IntMap.IntMap" >#< show t
+                                   {-# LINE 579 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 111, column 18)
+                              _derivings =
+                                  ({-# LINE 111 "ExecutionPlan2Hs.ag" #-}
+                                   case Map.lookup nt_ _lhsIderivings of
+                                      Nothing -> empty
+                                      Just s  -> if   Set.null s
+                                                 then empty
+                                                 else "deriving" >#< (pp_parens $ ppCommas $ map pp $ Set.toList s)
+                                   {-# LINE 589 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 136, column 18)
+                              _fsemname =
+                                  ({-# LINE 136 "ExecutionPlan2Hs.ag" #-}
+                                   \x -> "sem_" ++ show x
+                                   {-# LINE 595 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 137, column 18)
+                              _semname =
+                                  ({-# LINE 137 "ExecutionPlan2Hs.ag" #-}
+                                   _fsemname     nt_
+                                   {-# LINE 601 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 138, column 18)
+                              _frecarg =
+                                  ({-# LINE 138 "ExecutionPlan2Hs.ag" #-}
+                                   \t x -> case t of
+                                              NT nt _ -> pp_parens (_fsemname nt >#< x)
+                                              _       -> pp x
+                                   {-# LINE 609 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 141, column 18)
+                              _sem_nt =
+                                  ({-# LINE 141 "ExecutionPlan2Hs.ag" #-}
+                                   _semname     >#< "::" >#< nt_ >#< "->" >#< _t_type
+                                   >-< case lookup nt_ _lhsItypeSyns of
+                                          Nothing -> _prodsIsem_nt
+                                          Just (List t) -> _semname     >#< "list" >#< "=" >#< "Prelude.foldr" >#< _semname     >|< "_Cons"
+                                                           >#< _semname     >|< "_Nil"
+                                                           >#< case t of
+                                                                  NT nt _ -> pp_parens ("Prelude.map" >#< _fsemname nt >#< "list")
+                                                                  _ -> pp "list"
+                                          Just (Maybe t) -> _semname     >#< "Prelude.Nothing" >#< "=" >#< _semname     >|< "_Nothing"
+                                                            >-< _semname     >#< pp_parens ("Prelude.Just just") >#< "="
+                                                            >#< _semname     >|< "_Just" >#< _frecarg t "just"
+                                          Just (Tuple ts) -> _semname     >#< pp_parens (ppCommas $ map fst ts) >#< "="
+                                                             >#< _semname     >|< "_Tuple" >#< ppSpaced (map (\t -> _frecarg (snd t) (show $ fst t)) ts)
+                                          Just (Either l r) -> _semname     >#< "(Prelude.Left left)" >#< "=" >#< _semname     >|< "_Left" >#< _frecarg l "left"
+                                                               >-< _semname     >#< "(Prelude.Right right)" >#< "=" >#< _semname     >|< "_Right" >#< _frecarg r "right"
+                                          Just (Map k v) -> _semname     >#< "m" >#< "=" >#< "Data.Map.foldrWithKey"
+                                                            >#< _semname     >|< "_Entry" >#< _semname     >|< "_Nil"
+                                                            >#< case v of
+                                                                   NT nt _ -> pp_parens ("Data.Map.map" >#< _fsemname nt >#< "m")
+                                                                   _ -> pp "m"
+                                          Just (IntMap v) -> _semname     >#< "m" >#< "=" >#< "Data.IntMap.foldWithKey"
+                                                             >#< _semname     >|< "_Entry" >#< _semname     >|< "_Nil"
+                                                             >#< case v of
+                                                                    NT nt _ -> pp_parens ("Data.IntMap.map" >#< _fsemname nt >#< "m")
+                                                                    _ -> pp "m"
+                                   {-# LINE 639 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 198, column 19)
+                              (Just _prodsOinhmap ) =
+                                  ({-# LINE 198 "ExecutionPlan2Hs.ag" #-}
+                                   Map.lookup nt_ _lhsIinhmap
+                                   {-# LINE 645 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 199, column 19)
+                              (Just _prodsOsynmap ) =
+                                  ({-# LINE 199 "ExecutionPlan2Hs.ag" #-}
+                                   Map.lookup nt_ _lhsIsynmap
+                                   {-# LINE 651 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 220, column 18)
+                              _outedges =
+                                  ({-# LINE 220 "ExecutionPlan2Hs.ag" #-}
+                                   Set.fromList $ map (\(_,f,_) -> f) _prodsIallvisits
+                                   {-# LINE 657 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 221, column 18)
+                              _inedges =
+                                  ({-# LINE 221 "ExecutionPlan2Hs.ag" #-}
+                                   Set.fromList $ map (\(_,_,t) -> t) _prodsIallvisits
+                                   {-# LINE 663 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 222, column 18)
+                              _allstates =
+                                  ({-# LINE 222 "ExecutionPlan2Hs.ag" #-}
+                                   Set.insert initial_ $ _inedges     `Set.union` _outedges
+                                   {-# LINE 669 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 223, column 18)
+                              _t_type =
+                                  ({-# LINE 223 "ExecutionPlan2Hs.ag" #-}
+                                   "T_" ++ show nt_
+                                   {-# LINE 675 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 224, column 18)
+                              _t_init =
+                                  ({-# LINE 224 "ExecutionPlan2Hs.ag" #-}
+                                   "type" >#< _t_type     >#< "=" >#< _t_type     >|< "_s" >|< initial_
+                                   {-# LINE 681 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 225, column 18)
+                              _t_states =
+                                  ({-# LINE 225 "ExecutionPlan2Hs.ag" #-}
+                                   vlist $ map (\st ->
+                                      let nt_st = nt_ >|< "_s" >|< st
+                                          t_st  = "T_" >|< nt_st
+                                          k_st  = "K_" >|< nt_st
+                                          c_st  = "C_" >|< nt_st
+                                          inv_st  = "inv_" >|< nt_st
+                                      in  "data" >#< t_st >#< "where" >#< c_st >#< "::" >#< "{" >#< inv_st >#< "::"
+                                                 >#< "!" >|< pp_parens ("forall t." >#< k_st >#< "t" >#< "->" >#< "t") >#< "}"
+                                                 >#< "->" >#< t_st
+                                          ) $ Set.toList _allstates
+                                   {-# LINE 696 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 238, column 18)
+                              _k_type =
+                                  ({-# LINE 238 "ExecutionPlan2Hs.ag" #-}
+                                   "K_" ++ show nt_
+                                   {-# LINE 702 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 239, column 18)
+                              _k_states =
+                                  ({-# LINE 239 "ExecutionPlan2Hs.ag" #-}
+                                   vlist $ map (\st ->
+                                      let nt_st = nt_ >|< "_s" >|< st
+                                          k_st  = "K_" >|< nt_st
+                                          outg  = filter (\(v,f,t) -> f == st) _prodsIallvisits
+                                          visitlist = vlist $ map (\(v,f,t) ->
+                                              _k_type     >|< "_v" >|< v >#< "::" >#< k_st >#< _t_type     >|< "_v" >|< v
+                                               ) outg
+                                      in  "data" >#< k_st >#< "k" >#< "where"
+                                          >-< indent 3 visitlist) $ Set.toList _allstates
+                                   {-# LINE 716 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 259, column 18)
+                              _prodsOnt =
+                                  ({-# LINE 259 "ExecutionPlan2Hs.ag" #-}
+                                   nt_
+                                   {-# LINE 722 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 276, column 18)
+                              _wr_inh =
+                                  ({-# LINE 276 "ExecutionPlan2Hs.ag" #-}
+                                   _genwrap     "Inh" _wr_inhs
+                                   {-# LINE 728 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 277, column 18)
+                              _wr_syn =
+                                  ({-# LINE 277 "ExecutionPlan2Hs.ag" #-}
+                                   _genwrap     "Syn" _wr_syns
+                                   {-# LINE 734 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 278, column 18)
+                              _genwrap =
+                                  ({-# LINE 278 "ExecutionPlan2Hs.ag" #-}
+                                   \nm attr -> "data" >#< nm >|< "_" >|< nt_ >#< "=" >#< nm >|< "_" >|< nt_ >#< "{"
+                                               >#< (ppCommas $ map (\(i,t) -> i >|< "_" >|< nm >|< "_" >|< nt_ >#< "::"
+                                               >#< typeToHaskellString (Just nt_) [] t) attr) >#< "}"
+                                   {-# LINE 742 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 281, column 18)
+                              _wr_inhs =
+                                  ({-# LINE 281 "ExecutionPlan2Hs.ag" #-}
+                                   Map.toList $ fromJust $ Map.lookup nt_ _lhsIinhmap
+                                   {-# LINE 748 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 282, column 18)
+                              _wr_syns =
+                                  ({-# LINE 282 "ExecutionPlan2Hs.ag" #-}
+                                   Map.toList $ fromJust $ Map.lookup nt_ _lhsIsynmap
+                                   {-# LINE 754 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 283, column 18)
+                              _inhlist =
+                                  ({-# LINE 283 "ExecutionPlan2Hs.ag" #-}
+                                   map (lhsname True . fst) _wr_inhs
+                                   {-# LINE 760 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 284, column 18)
+                              _synlist =
+                                  ({-# LINE 284 "ExecutionPlan2Hs.ag" #-}
+                                   map (lhsname False . fst) _wr_syns
+                                   {-# LINE 766 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 285, column 18)
+                              _wrapname =
+                                  ({-# LINE 285 "ExecutionPlan2Hs.ag" #-}
+                                   "wrap_" ++ show nt_
+                                   {-# LINE 772 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 286, column 18)
+                              _inhname =
+                                  ({-# LINE 286 "ExecutionPlan2Hs.ag" #-}
+                                   "Inh_" ++ show nt_
+                                   {-# LINE 778 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 287, column 18)
+                              _synname =
+                                  ({-# LINE 287 "ExecutionPlan2Hs.ag" #-}
+                                   "Syn_" ++ show nt_
+                                   {-# LINE 784 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 288, column 18)
+                              _wrapper =
+                                  ({-# LINE 288 "ExecutionPlan2Hs.ag" #-}
+                                   (_wrapname     >#< "::" >#< _t_type     >#< "->"
+                                    >#< _inhname     >#< "->" >#< _synname    )
+                                   >-<
+                                   (_wrapname     >#< "sem" >#< "(" >#< _inhname
+                                    >#< ppSpaced _inhlist     >#< ")" >#< "=")
+                                   >-<
+                                   indent 3 (case initialv_ of
+                                     Nothing -> _synname     >#< " { }"
+                                     Just initv ->
+                                        "let" >#< "(" >#< ppCommas _synlist     >#< "," >#< "_" >#< ")" >#< "="
+                                              >#< "Control.Monad.Identity.runIdentity"
+                                              >#< pp_parens ("inv_" >|< nt_ >|< "_s" >|< initial_
+                                              >#< "sem" >#< _k_type     >|< "_v" >|< initv
+                                              >#< ppSpaced _inhlist    )
+                                        >-<
+                                        "in " >#< "(" >#< _synname     >#< ppSpaced _synlist     >#< ")")
+                                   {-# LINE 805 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 315, column 18)
+                              _prodsOinitial =
+                                  ({-# LINE 315 "ExecutionPlan2Hs.ag" #-}
+                                   initial_
+                                   {-# LINE 811 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 316, column 18)
+                              _prodsOallstates =
+                                  ({-# LINE 316 "ExecutionPlan2Hs.ag" #-}
+                                   _allstates
+                                   {-# LINE 817 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 613, column 18)
+                              _lhsOappendMain =
+                                  ({-# LINE 613 "ExecutionPlan2Hs.ag" #-}
+                                   (if nt_ `Set.member` _lhsIwrappers
+                                    then     _wr_inh
+                                         >-< _wr_syn
+                                         >-< _wrapper
+                                    else empty)
+                                   >-< _sem_nt
+                                   {-# LINE 828 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 619, column 18)
+                              _lhsOappendCommon =
+                                  ({-# LINE 619 "ExecutionPlan2Hs.ag" #-}
+                                   (if dataTypes _lhsIoptions then _datatype     else empty)
+                                   >-< _t_init
+                                   >-< _t_states
+                                   >-< _k_states
+                                   >-< _prodsIt_visits
+                                   {-# LINE 838 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                              _lhsOchildvisit =
+                                  ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                   _prodsIchildvisit
+                                   {-# LINE 844 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 627, column 49)
+                              _lhsOgenProdIO =
+                                  ({-# LINE 627 "ExecutionPlan2Hs.ag" #-}
+                                   _prodsIgenProdIO
+                                   {-# LINE 850 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 626, column 47)
+                              _lhsOimports =
+                                  ({-# LINE 626 "ExecutionPlan2Hs.ag" #-}
+                                   _prodsIimports
+                                   {-# LINE 856 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                              _lhsOvisitdefs =
+                                  ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                   _prodsIvisitdefs
+                                   {-# LINE 862 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                              _lhsOvisituses =
+                                  ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                   _prodsIvisituses
+                                   {-# LINE 868 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOallchildvisit =
+                                  ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIallchildvisit
+                                   {-# LINE 874 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOavisitdefs =
+                                  ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisitdefs
+                                   {-# LINE 880 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOavisituses =
+                                  ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisituses
+                                   {-# LINE 886 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOimportBlocks =
+                                  ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIimportBlocks
+                                   {-# LINE 892 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOmainFile =
+                                  ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainFile
+                                   {-# LINE 898 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOmainName =
+                                  ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainName
+                                   {-# LINE 904 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOmoduleHeader =
+                                  ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImoduleHeader
+                                   {-# LINE 910 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOoptions =
+                                  ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptions
+                                   {-# LINE 916 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOoptionsLine =
+                                  ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptionsLine
+                                   {-# LINE 922 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOpragmaBlocks =
+                                  ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIpragmaBlocks
+                                   {-# LINE 928 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _prodsOtextBlocks =
+                                  ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsItextBlocks
+                                   {-# LINE 934 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              ( _prodsIallvisits,_prodsIchildvisit,_prodsIdatatype,_prodsIgenProdIO,_prodsIimports,_prodsIsem_nt,_prodsIsem_prod,_prodsIt_visits,_prodsIvisitdefs,_prodsIvisituses) =
+                                  prods_ _prodsOallchildvisit _prodsOallstates _prodsOavisitdefs _prodsOavisituses _prodsOimportBlocks _prodsOinhmap _prodsOinitial _prodsOmainFile _prodsOmainName _prodsOmoduleHeader _prodsOnt _prodsOoptions _prodsOoptionsLine _prodsOpragmaBlocks _prodsOrename _prodsOsynmap _prodsOtextBlocks 
+                          in  ( _lhsOappendCommon,_lhsOappendMain,_lhsOchildvisit,_lhsOgenProdIO,_lhsOimports,_lhsOoutput,_lhsOvisitdefs,_lhsOvisituses))) )
+-- ENonterminals -----------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         derivings            : Derivings
+         importBlocks         : PP_Doc
+         inhmap               : Map.Map NontermIdent Attributes
+         mainFile             : String
+         mainName             : String
+         moduleHeader         : String -> String -> String -> Bool -> String
+         options              : Options
+         optionsLine          : String
+         pragmaBlocks         : String
+         synmap               : Map.Map NontermIdent Attributes
+         textBlocks           : PP_Doc
+         typeSyns             : TypeSyns
+         wrappers             : Set.Set NontermIdent
+      synthesized attributes:
+         appendCommon         : [PP_Doc]
+         appendMain           : [PP_Doc]
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         genProdIO            : IO ()
+         imports              : [PP_Doc]
+         output               : PP_Doc
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative Cons:
+         child hd             : ENonterminal 
+         child tl             : ENonterminals 
+      alternative Nil:
+-}
+-- cata
+sem_ENonterminals :: ENonterminals  ->
+                     T_ENonterminals 
+sem_ENonterminals list  =
+    (Prelude.foldr sem_ENonterminals_Cons sem_ENonterminals_Nil (Prelude.map sem_ENonterminal list) )
+-- semantic domain
+newtype T_ENonterminals  = T_ENonterminals ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                            Derivings ->
+                                            PP_Doc ->
+                                            (Map.Map NontermIdent Attributes) ->
+                                            String ->
+                                            String ->
+                                            (String -> String -> String -> Bool -> String) ->
+                                            Options ->
+                                            String ->
+                                            String ->
+                                            (Map.Map NontermIdent Attributes) ->
+                                            PP_Doc ->
+                                            TypeSyns ->
+                                            (Set.Set NontermIdent) ->
+                                            ( ([PP_Doc]),([PP_Doc]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(IO ()),([PP_Doc]),PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_ENonterminals  = Inh_ENonterminals {allchildvisit_Inh_ENonterminals :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),derivings_Inh_ENonterminals :: Derivings,importBlocks_Inh_ENonterminals :: PP_Doc,inhmap_Inh_ENonterminals :: (Map.Map NontermIdent Attributes),mainFile_Inh_ENonterminals :: String,mainName_Inh_ENonterminals :: String,moduleHeader_Inh_ENonterminals :: (String -> String -> String -> Bool -> String),options_Inh_ENonterminals :: Options,optionsLine_Inh_ENonterminals :: String,pragmaBlocks_Inh_ENonterminals :: String,synmap_Inh_ENonterminals :: (Map.Map NontermIdent Attributes),textBlocks_Inh_ENonterminals :: PP_Doc,typeSyns_Inh_ENonterminals :: TypeSyns,wrappers_Inh_ENonterminals :: (Set.Set NontermIdent)}
+data Syn_ENonterminals  = Syn_ENonterminals {appendCommon_Syn_ENonterminals :: ([PP_Doc]),appendMain_Syn_ENonterminals :: ([PP_Doc]),childvisit_Syn_ENonterminals :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),genProdIO_Syn_ENonterminals :: (IO ()),imports_Syn_ENonterminals :: ([PP_Doc]),output_Syn_ENonterminals :: PP_Doc,visitdefs_Syn_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_ENonterminals :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_ENonterminals :: T_ENonterminals  ->
+                      Inh_ENonterminals  ->
+                      Syn_ENonterminals 
+wrap_ENonterminals (T_ENonterminals sem ) (Inh_ENonterminals _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIderivings _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks _lhsItypeSyns _lhsIwrappers )  =
+    (let ( _lhsOappendCommon,_lhsOappendMain,_lhsOchildvisit,_lhsOgenProdIO,_lhsOimports,_lhsOoutput,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIderivings _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks _lhsItypeSyns _lhsIwrappers 
+     in  (Syn_ENonterminals _lhsOappendCommon _lhsOappendMain _lhsOchildvisit _lhsOgenProdIO _lhsOimports _lhsOoutput _lhsOvisitdefs _lhsOvisituses ))
+sem_ENonterminals_Cons :: T_ENonterminal  ->
+                          T_ENonterminals  ->
+                          T_ENonterminals 
+sem_ENonterminals_Cons (T_ENonterminal hd_ ) (T_ENonterminals tl_ )  =
+    (T_ENonterminals (\ _lhsIallchildvisit
+                        _lhsIavisitdefs
+                        _lhsIavisituses
+                        _lhsIderivings
+                        _lhsIimportBlocks
+                        _lhsIinhmap
+                        _lhsImainFile
+                        _lhsImainName
+                        _lhsImoduleHeader
+                        _lhsIoptions
+                        _lhsIoptionsLine
+                        _lhsIpragmaBlocks
+                        _lhsIsynmap
+                        _lhsItextBlocks
+                        _lhsItypeSyns
+                        _lhsIwrappers ->
+                          (let _lhsOappendCommon :: ([PP_Doc])
+                               _lhsOappendMain :: ([PP_Doc])
+                               _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _lhsOgenProdIO :: (IO ())
+                               _lhsOimports :: ([PP_Doc])
+                               _lhsOoutput :: PP_Doc
+                               _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _hdOderivings :: Derivings
+                               _hdOimportBlocks :: PP_Doc
+                               _hdOinhmap :: (Map.Map NontermIdent Attributes)
+                               _hdOmainFile :: String
+                               _hdOmainName :: String
+                               _hdOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                               _hdOoptions :: Options
+                               _hdOoptionsLine :: String
+                               _hdOpragmaBlocks :: String
+                               _hdOsynmap :: (Map.Map NontermIdent Attributes)
+                               _hdOtextBlocks :: PP_Doc
+                               _hdOtypeSyns :: TypeSyns
+                               _hdOwrappers :: (Set.Set NontermIdent)
+                               _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _tlOderivings :: Derivings
+                               _tlOimportBlocks :: PP_Doc
+                               _tlOinhmap :: (Map.Map NontermIdent Attributes)
+                               _tlOmainFile :: String
+                               _tlOmainName :: String
+                               _tlOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                               _tlOoptions :: Options
+                               _tlOoptionsLine :: String
+                               _tlOpragmaBlocks :: String
+                               _tlOsynmap :: (Map.Map NontermIdent Attributes)
+                               _tlOtextBlocks :: PP_Doc
+                               _tlOtypeSyns :: TypeSyns
+                               _tlOwrappers :: (Set.Set NontermIdent)
+                               _hdIappendCommon :: ( PP_Doc )
+                               _hdIappendMain :: ( PP_Doc )
+                               _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _hdIgenProdIO :: (IO ())
+                               _hdIimports :: ([PP_Doc])
+                               _hdIoutput :: PP_Doc
+                               _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _tlIappendCommon :: ([PP_Doc])
+                               _tlIappendMain :: ([PP_Doc])
+                               _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _tlIgenProdIO :: (IO ())
+                               _tlIimports :: ([PP_Doc])
+                               _tlIoutput :: PP_Doc
+                               _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               -- use rule "ExecutionPlan2Hs.ag"(line 610, column 51)
+                               _lhsOappendCommon =
+                                   ({-# LINE 610 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIappendCommon : _tlIappendCommon
+                                    {-# LINE 1085 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 610, column 51)
+                               _lhsOappendMain =
+                                   ({-# LINE 610 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIappendMain : _tlIappendMain
+                                    {-# LINE 1091 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                               _lhsOchildvisit =
+                                   ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIchildvisit `Map.union` _tlIchildvisit
+                                    {-# LINE 1097 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 627, column 49)
+                               _lhsOgenProdIO =
+                                   ({-# LINE 627 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIgenProdIO >> _tlIgenProdIO
+                                    {-# LINE 1103 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 626, column 47)
+                               _lhsOimports =
+                                   ({-# LINE 626 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIimports ++ _tlIimports
+                                    {-# LINE 1109 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 56, column 45)
+                               _lhsOoutput =
+                                   ({-# LINE 56 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIoutput >-< _tlIoutput
+                                    {-# LINE 1115 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                               _lhsOvisitdefs =
+                                   ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
+                                    {-# LINE 1121 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                               _lhsOvisituses =
+                                   ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                    _hdIvisituses `uwSetUnion` _tlIvisituses
+                                    {-# LINE 1127 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOallchildvisit =
+                                   ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIallchildvisit
+                                    {-# LINE 1133 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOavisitdefs =
+                                   ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIavisitdefs
+                                    {-# LINE 1139 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOavisituses =
+                                   ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIavisituses
+                                    {-# LINE 1145 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOderivings =
+                                   ({-# LINE 94 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIderivings
+                                    {-# LINE 1151 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOimportBlocks =
+                                   ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIimportBlocks
+                                    {-# LINE 1157 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOinhmap =
+                                   ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIinhmap
+                                    {-# LINE 1163 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOmainFile =
+                                   ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainFile
+                                    {-# LINE 1169 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOmainName =
+                                   ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainName
+                                    {-# LINE 1175 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOmoduleHeader =
+                                   ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImoduleHeader
+                                    {-# LINE 1181 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOoptions =
+                                   ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptions
+                                    {-# LINE 1187 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOoptionsLine =
+                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptionsLine
+                                    {-# LINE 1193 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOpragmaBlocks =
+                                   ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIpragmaBlocks
+                                    {-# LINE 1199 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOsynmap =
+                                   ({-# LINE 189 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIsynmap
+                                    {-# LINE 1205 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOtextBlocks =
+                                   ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsItextBlocks
+                                    {-# LINE 1211 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOtypeSyns =
+                                   ({-# LINE 93 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsItypeSyns
+                                    {-# LINE 1217 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _hdOwrappers =
+                                   ({-# LINE 55 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIwrappers
+                                    {-# LINE 1223 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOallchildvisit =
+                                   ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIallchildvisit
+                                    {-# LINE 1229 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOavisitdefs =
+                                   ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIavisitdefs
+                                    {-# LINE 1235 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOavisituses =
+                                   ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIavisituses
+                                    {-# LINE 1241 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOderivings =
+                                   ({-# LINE 94 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIderivings
+                                    {-# LINE 1247 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOimportBlocks =
+                                   ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIimportBlocks
+                                    {-# LINE 1253 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOinhmap =
+                                   ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIinhmap
+                                    {-# LINE 1259 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOmainFile =
+                                   ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainFile
+                                    {-# LINE 1265 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOmainName =
+                                   ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainName
+                                    {-# LINE 1271 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOmoduleHeader =
+                                   ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImoduleHeader
+                                    {-# LINE 1277 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOoptions =
+                                   ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptions
+                                    {-# LINE 1283 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOoptionsLine =
+                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptionsLine
+                                    {-# LINE 1289 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOpragmaBlocks =
+                                   ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIpragmaBlocks
+                                    {-# LINE 1295 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOsynmap =
+                                   ({-# LINE 189 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIsynmap
+                                    {-# LINE 1301 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOtextBlocks =
+                                   ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsItextBlocks
+                                    {-# LINE 1307 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOtypeSyns =
+                                   ({-# LINE 93 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsItypeSyns
+                                    {-# LINE 1313 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _tlOwrappers =
+                                   ({-# LINE 55 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIwrappers
+                                    {-# LINE 1319 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               ( _hdIappendCommon,_hdIappendMain,_hdIchildvisit,_hdIgenProdIO,_hdIimports,_hdIoutput,_hdIvisitdefs,_hdIvisituses) =
+                                   hd_ _hdOallchildvisit _hdOavisitdefs _hdOavisituses _hdOderivings _hdOimportBlocks _hdOinhmap _hdOmainFile _hdOmainName _hdOmoduleHeader _hdOoptions _hdOoptionsLine _hdOpragmaBlocks _hdOsynmap _hdOtextBlocks _hdOtypeSyns _hdOwrappers 
+                               ( _tlIappendCommon,_tlIappendMain,_tlIchildvisit,_tlIgenProdIO,_tlIimports,_tlIoutput,_tlIvisitdefs,_tlIvisituses) =
+                                   tl_ _tlOallchildvisit _tlOavisitdefs _tlOavisituses _tlOderivings _tlOimportBlocks _tlOinhmap _tlOmainFile _tlOmainName _tlOmoduleHeader _tlOoptions _tlOoptionsLine _tlOpragmaBlocks _tlOsynmap _tlOtextBlocks _tlOtypeSyns _tlOwrappers 
+                           in  ( _lhsOappendCommon,_lhsOappendMain,_lhsOchildvisit,_lhsOgenProdIO,_lhsOimports,_lhsOoutput,_lhsOvisitdefs,_lhsOvisituses))) )
+sem_ENonterminals_Nil :: T_ENonterminals 
+sem_ENonterminals_Nil  =
+    (T_ENonterminals (\ _lhsIallchildvisit
+                        _lhsIavisitdefs
+                        _lhsIavisituses
+                        _lhsIderivings
+                        _lhsIimportBlocks
+                        _lhsIinhmap
+                        _lhsImainFile
+                        _lhsImainName
+                        _lhsImoduleHeader
+                        _lhsIoptions
+                        _lhsIoptionsLine
+                        _lhsIpragmaBlocks
+                        _lhsIsynmap
+                        _lhsItextBlocks
+                        _lhsItypeSyns
+                        _lhsIwrappers ->
+                          (let _lhsOappendCommon :: ([PP_Doc])
+                               _lhsOappendMain :: ([PP_Doc])
+                               _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _lhsOgenProdIO :: (IO ())
+                               _lhsOimports :: ([PP_Doc])
+                               _lhsOoutput :: PP_Doc
+                               _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               -- use rule "ExecutionPlan2Hs.ag"(line 610, column 51)
+                               _lhsOappendCommon =
+                                   ({-# LINE 610 "ExecutionPlan2Hs.ag" #-}
+                                    []
+                                    {-# LINE 1356 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 610, column 51)
+                               _lhsOappendMain =
+                                   ({-# LINE 610 "ExecutionPlan2Hs.ag" #-}
+                                    []
+                                    {-# LINE 1362 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                               _lhsOchildvisit =
+                                   ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                    Map.empty
+                                    {-# LINE 1368 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 627, column 49)
+                               _lhsOgenProdIO =
+                                   ({-# LINE 627 "ExecutionPlan2Hs.ag" #-}
+                                    return ()
+                                    {-# LINE 1374 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 626, column 47)
+                               _lhsOimports =
+                                   ({-# LINE 626 "ExecutionPlan2Hs.ag" #-}
+                                    []
+                                    {-# LINE 1380 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 56, column 45)
+                               _lhsOoutput =
+                                   ({-# LINE 56 "ExecutionPlan2Hs.ag" #-}
+                                    empty
+                                    {-# LINE 1386 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                               _lhsOvisitdefs =
+                                   ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                    Map.empty
+                                    {-# LINE 1392 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                               _lhsOvisituses =
+                                   ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                    Map.empty
+                                    {-# LINE 1398 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                           in  ( _lhsOappendCommon,_lhsOappendMain,_lhsOchildvisit,_lhsOgenProdIO,_lhsOimports,_lhsOoutput,_lhsOvisitdefs,_lhsOvisituses))) )
+-- EProduction -------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         allstates            : Set.Set StateIdentifier
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         importBlocks         : PP_Doc
+         inhmap               : Attributes
+         initial              : StateIdentifier
+         mainFile             : String
+         mainName             : String
+         moduleHeader         : String -> String -> String -> Bool -> String
+         nt                   : NontermIdent
+         options              : Options
+         optionsLine          : String
+         pragmaBlocks         : String
+         rename               : Bool
+         synmap               : Attributes
+         textBlocks           : PP_Doc
+      synthesized attributes:
+         allvisits            : [VisitStateState]
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         datatype             : PP_Doc
+         genProdIO            : IO ()
+         imports              : [PP_Doc]
+         sem_nt               : PP_Doc
+         sem_prod             : PP_Doc
+         t_visits             : PP_Doc
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative EProduction:
+         child con            : {ConstructorIdent}
+         child rules          : ERules 
+         child children       : EChildren 
+         child visits         : Visits 
+         visit 0:
+            local args        : _
+            local semname     : _
+            local sem_prod    : _
+            local statefns    : _
+            local stargs      : _
+            local stks        : _
+            local stvisits    : _
+            local stvs        : _
+            local moduleName  : _
+            local suffix      : _
+            local outputfile  : _
+-}
+-- cata
+sem_EProduction :: EProduction  ->
+                   T_EProduction 
+sem_EProduction (EProduction _con _rules _children _visits )  =
+    (sem_EProduction_EProduction _con (sem_ERules _rules ) (sem_EChildren _children ) (sem_Visits _visits ) )
+-- semantic domain
+newtype T_EProduction  = T_EProduction ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                        (Set.Set StateIdentifier) ->
+                                        (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                        (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                        PP_Doc ->
+                                        Attributes ->
+                                        StateIdentifier ->
+                                        String ->
+                                        String ->
+                                        (String -> String -> String -> Bool -> String) ->
+                                        NontermIdent ->
+                                        Options ->
+                                        String ->
+                                        String ->
+                                        Bool ->
+                                        Attributes ->
+                                        PP_Doc ->
+                                        ( ([VisitStateState]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),PP_Doc,(IO ()),([PP_Doc]),PP_Doc,PP_Doc,PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_EProduction  = Inh_EProduction {allchildvisit_Inh_EProduction :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allstates_Inh_EProduction :: (Set.Set StateIdentifier),avisitdefs_Inh_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),importBlocks_Inh_EProduction :: PP_Doc,inhmap_Inh_EProduction :: Attributes,initial_Inh_EProduction :: StateIdentifier,mainFile_Inh_EProduction :: String,mainName_Inh_EProduction :: String,moduleHeader_Inh_EProduction :: (String -> String -> String -> Bool -> String),nt_Inh_EProduction :: NontermIdent,options_Inh_EProduction :: Options,optionsLine_Inh_EProduction :: String,pragmaBlocks_Inh_EProduction :: String,rename_Inh_EProduction :: Bool,synmap_Inh_EProduction :: Attributes,textBlocks_Inh_EProduction :: PP_Doc}
+data Syn_EProduction  = Syn_EProduction {allvisits_Syn_EProduction :: ([VisitStateState]),childvisit_Syn_EProduction :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),datatype_Syn_EProduction :: PP_Doc,genProdIO_Syn_EProduction :: (IO ()),imports_Syn_EProduction :: ([PP_Doc]),sem_nt_Syn_EProduction :: PP_Doc,sem_prod_Syn_EProduction :: PP_Doc,t_visits_Syn_EProduction :: PP_Doc,visitdefs_Syn_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_EProduction :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_EProduction :: T_EProduction  ->
+                    Inh_EProduction  ->
+                    Syn_EProduction 
+wrap_EProduction (T_EProduction sem ) (Inh_EProduction _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIimportBlocks _lhsIinhmap _lhsIinitial _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsInt _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIrename _lhsIsynmap _lhsItextBlocks )  =
+    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOgenProdIO,_lhsOimports,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIimportBlocks _lhsIinhmap _lhsIinitial _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsInt _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIrename _lhsIsynmap _lhsItextBlocks 
+     in  (Syn_EProduction _lhsOallvisits _lhsOchildvisit _lhsOdatatype _lhsOgenProdIO _lhsOimports _lhsOsem_nt _lhsOsem_prod _lhsOt_visits _lhsOvisitdefs _lhsOvisituses ))
+sem_EProduction_EProduction :: ConstructorIdent ->
+                               T_ERules  ->
+                               T_EChildren  ->
+                               T_Visits  ->
+                               T_EProduction 
+sem_EProduction_EProduction con_ (T_ERules rules_ ) (T_EChildren children_ ) (T_Visits visits_ )  =
+    (T_EProduction (\ _lhsIallchildvisit
+                      _lhsIallstates
+                      _lhsIavisitdefs
+                      _lhsIavisituses
+                      _lhsIimportBlocks
+                      _lhsIinhmap
+                      _lhsIinitial
+                      _lhsImainFile
+                      _lhsImainName
+                      _lhsImoduleHeader
+                      _lhsInt
+                      _lhsIoptions
+                      _lhsIoptionsLine
+                      _lhsIpragmaBlocks
+                      _lhsIrename
+                      _lhsIsynmap
+                      _lhsItextBlocks ->
+                        (let _lhsOdatatype :: PP_Doc
+                             _lhsOsem_nt :: PP_Doc
+                             _visitsOmrules :: (Map.Map Identifier PP_Doc)
+                             _visitsOchildintros :: (Map.Map Identifier PP_Doc)
+                             _rulesOusedrules :: (Set.Set Identifier)
+                             _visitsOallintramap :: (Map.Map StateIdentifier (Set.Set String))
+                             _visitsOterminaldefs :: (Set.Set String)
+                             _visitsOruledefs :: (Map.Map Identifier (Set.Set String))
+                             _visitsOruleuses :: (Map.Map Identifier (Set.Set String))
+                             _lhsOimports :: ([PP_Doc])
+                             _lhsOgenProdIO :: (IO ())
+                             _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                             _lhsOt_visits :: PP_Doc
+                             _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             _lhsOallvisits :: ([VisitStateState])
+                             _lhsOsem_prod :: PP_Doc
+                             _rulesOoptions :: Options
+                             _childrenOnt :: NontermIdent
+                             _childrenOoptions :: Options
+                             _visitsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                             _visitsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             _visitsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             _visitsOinhmap :: Attributes
+                             _visitsOnt :: NontermIdent
+                             _visitsOoptions :: Options
+                             _visitsOsynmap :: Attributes
+                             _rulesImrules :: (Map.Map Identifier PP_Doc)
+                             _rulesIruledefs :: (Map.Map Identifier (Set.Set String))
+                             _rulesIruleuses :: (Map.Map Identifier (Set.Set String))
+                             _rulesIsem_rules :: PP_Doc
+                             _childrenIargnames :: ( [PP_Doc] )
+                             _childrenIargnamesw :: ([PP_Doc])
+                             _childrenIargtps :: ( [PP_Doc] )
+                             _childrenIchildintros :: (Map.Map Identifier PP_Doc)
+                             _childrenIdatatype :: ([PP_Doc])
+                             _childrenIterminaldefs :: (Set.Set String)
+                             _visitsIallvisits :: ([VisitStateState])
+                             _visitsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                             _visitsIintramap :: (Map.Map StateIdentifier (Set.Set String))
+                             _visitsIsem_visit :: ( [(StateIdentifier,PP_Doc)] )
+                             _visitsIt_visits :: PP_Doc
+                             _visitsIusedrules :: (Set.Set Identifier)
+                             _visitsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             _visitsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                             -- "ExecutionPlan2Hs.ag"(line 121, column 17)
+                             _lhsOdatatype =
+                                 ({-# LINE 121 "ExecutionPlan2Hs.ag" #-}
+                                  conname _lhsIrename _lhsInt con_ >#< ppSpaced _childrenIdatatype
+                                  {-# LINE 1556 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 170, column 17)
+                             _lhsOsem_nt =
+                                 ({-# LINE 170 "ExecutionPlan2Hs.ag" #-}
+                                  "sem_" >|< _lhsInt >#< "(" >#< conname _lhsIrename _lhsInt con_ >#< ppSpaced _childrenIargnames >#< ")"
+                                  >#< "=" >#< "sem_" >|< _lhsInt >|< "_" >|< con_ >#< ppSpaced _childrenIargnamesw
+                                  {-# LINE 1563 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 336, column 17)
+                             _args =
+                                 ({-# LINE 336 "ExecutionPlan2Hs.ag" #-}
+                                  _childrenIargnames
+                                  {-# LINE 1569 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 337, column 17)
+                             _semname =
+                                 ({-# LINE 337 "ExecutionPlan2Hs.ag" #-}
+                                  "sem_" ++ show _lhsInt ++ "_" ++ show con_
+                                  {-# LINE 1575 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 338, column 17)
+                             _sem_prod =
+                                 ({-# LINE 338 "ExecutionPlan2Hs.ag" #-}
+                                  _semname     >#< "::" >#< ppSpaced _childrenIargtps >#< "T_" >|< _lhsInt
+                                  >-< _semname     >#< ppSpaced _args     >#< "="
+                                  >#< "st" >|< _lhsIinitial >#< "where"
+                                  >-< (indent 3 $ vlist _statefns     >-< _rulesIsem_rules)
+                                  {-# LINE 1584 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 342, column 17)
+                             _statefns =
+                                 ({-# LINE 342 "ExecutionPlan2Hs.ag" #-}
+                                  map (\st -> "st" >|< st >#< _stargs     st >#< "=" >#<
+                                              "C_" >|< _lhsInt >|< "_s" >|< st >#< "k" >|< st >#< "where"
+                                              >-< indent 3 (_stks     st >-< _stvs     st)
+                                      ) $ Set.toList _lhsIallstates
+                                  {-# LINE 1593 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 346, column 17)
+                             _stargs =
+                                 ({-# LINE 346 "ExecutionPlan2Hs.ag" #-}
+                                  \st -> ppSpaced $ Set.toList $ maybe Set.empty id $ Map.lookup st _visitsIintramap
+                                  {-# LINE 1599 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 347, column 17)
+                             _stks =
+                                 ({-# LINE 347 "ExecutionPlan2Hs.ag" #-}
+                                  \st -> "k" >|< st >#< "::" >#< "K_" >|< _lhsInt >|< "_s" >|< st >#< "t" >#< "->" >#< "t"
+                                         >-< vlist (map (\(v,f,t) -> "k" >|< st >#< "K_" >|< _lhsInt >|< "_v" >|< v >#< "="
+                                                                     >#< "v" >|< v) $ _stvisits     st)
+                                     >-< if null (_stvisits     st)
+                                         then "k" >|< st >#< "_" >#< "=" >#< "error \"unreachable\""
+                                         else empty
+                                  {-# LINE 1610 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 353, column 17)
+                             _stvisits =
+                                 ({-# LINE 353 "ExecutionPlan2Hs.ag" #-}
+                                  \st -> filter (\(v,f,t) -> f == st) _visitsIallvisits
+                                  {-# LINE 1616 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 354, column 17)
+                             _stvs =
+                                 ({-# LINE 354 "ExecutionPlan2Hs.ag" #-}
+                                  \st -> vlist $ map snd $ filter (\(f,pp) -> f == st) _visitsIsem_visit
+                                  {-# LINE 1622 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 355, column 17)
+                             _visitsOmrules =
+                                 ({-# LINE 355 "ExecutionPlan2Hs.ag" #-}
+                                  _rulesImrules
+                                  {-# LINE 1628 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 387, column 17)
+                             _visitsOchildintros =
+                                 ({-# LINE 387 "ExecutionPlan2Hs.ag" #-}
+                                  _childrenIchildintros
+                                  {-# LINE 1634 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 403, column 17)
+                             _rulesOusedrules =
+                                 ({-# LINE 403 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIusedrules
+                                  {-# LINE 1640 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 491, column 17)
+                             _visitsOallintramap =
+                                 ({-# LINE 491 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIintramap
+                                  {-# LINE 1646 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 492, column 17)
+                             _visitsOterminaldefs =
+                                 ({-# LINE 492 "ExecutionPlan2Hs.ag" #-}
+                                  _childrenIterminaldefs
+                                  {-# LINE 1652 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 511, column 17)
+                             _visitsOruledefs =
+                                 ({-# LINE 511 "ExecutionPlan2Hs.ag" #-}
+                                  _rulesIruledefs
+                                  {-# LINE 1658 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 512, column 17)
+                             _visitsOruleuses =
+                                 ({-# LINE 512 "ExecutionPlan2Hs.ag" #-}
+                                  _rulesIruleuses
+                                  {-# LINE 1664 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 630, column 17)
+                             _lhsOimports =
+                                 ({-# LINE 630 "ExecutionPlan2Hs.ag" #-}
+                                  [pp $ "import " ++ _moduleName    ]
+                                  {-# LINE 1670 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 631, column 17)
+                             _moduleName =
+                                 ({-# LINE 631 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsImainName ++ _suffix
+                                  {-# LINE 1676 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 632, column 17)
+                             _suffix =
+                                 ({-# LINE 632 "ExecutionPlan2Hs.ag" #-}
+                                  "_" ++ show _lhsInt ++ "_" ++ show con_
+                                  {-# LINE 1682 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 633, column 17)
+                             _outputfile =
+                                 ({-# LINE 633 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsImainFile ++ _suffix     ++ ".hs"
+                                  {-# LINE 1688 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- "ExecutionPlan2Hs.ag"(line 634, column 17)
+                             _lhsOgenProdIO =
+                                 ({-# LINE 634 "ExecutionPlan2Hs.ag" #-}
+                                  writeModule _outputfile
+                                    [ pp "{-# LANGUAGE Rank2Types, GADTs, EmptyDataDecls #-}"
+                                    , pp $ _lhsIpragmaBlocks
+                                    , pp $ _lhsIoptionsLine
+                                    , pp $ _lhsImoduleHeader _lhsImainName _suffix     _semname     True
+                                    , pp $ "import Control.Monad.Identity"
+                                    , pp $ "import " ++ _lhsImainName ++ "_common"
+                                    , _sem_prod
+                                    ]
+                                  {-# LINE 1702 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                             _lhsOchildvisit =
+                                 ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIchildvisit
+                                  {-# LINE 1708 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- use rule "ExecutionPlan2Hs.ag"(line 253, column 54)
+                             _lhsOt_visits =
+                                 ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIt_visits
+                                  {-# LINE 1714 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                             _lhsOvisitdefs =
+                                 ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIvisitdefs
+                                  {-# LINE 1720 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                             _lhsOvisituses =
+                                 ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIvisituses
+                                  {-# LINE 1726 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (up)
+                             _lhsOallvisits =
+                                 ({-# LINE 209 "ExecutionPlan2Hs.ag" #-}
+                                  _visitsIallvisits
+                                  {-# LINE 1732 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (from local)
+                             _lhsOsem_prod =
+                                 ({-# LINE 309 "ExecutionPlan2Hs.ag" #-}
+                                  _sem_prod
+                                  {-# LINE 1738 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _rulesOoptions =
+                                 ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIoptions
+                                  {-# LINE 1744 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _childrenOnt =
+                                 ({-# LINE 124 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsInt
+                                  {-# LINE 1750 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _childrenOoptions =
+                                 ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIoptions
+                                  {-# LINE 1756 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOallchildvisit =
+                                 ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIallchildvisit
+                                  {-# LINE 1762 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOavisitdefs =
+                                 ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIavisitdefs
+                                  {-# LINE 1768 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOavisituses =
+                                 ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIavisituses
+                                  {-# LINE 1774 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOinhmap =
+                                 ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIinhmap
+                                  {-# LINE 1780 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOnt =
+                                 ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsInt
+                                  {-# LINE 1786 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOoptions =
+                                 ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIoptions
+                                  {-# LINE 1792 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _visitsOsynmap =
+                                 ({-# LINE 195 "ExecutionPlan2Hs.ag" #-}
+                                  _lhsIsynmap
+                                  {-# LINE 1798 "ExecutionPlan2Hs.hs" #-}
+                                  )
+                             ( _rulesImrules,_rulesIruledefs,_rulesIruleuses,_rulesIsem_rules) =
+                                 rules_ _rulesOoptions _rulesOusedrules 
+                             ( _childrenIargnames,_childrenIargnamesw,_childrenIargtps,_childrenIchildintros,_childrenIdatatype,_childrenIterminaldefs) =
+                                 children_ _childrenOnt _childrenOoptions 
+                             ( _visitsIallvisits,_visitsIchildvisit,_visitsIintramap,_visitsIsem_visit,_visitsIt_visits,_visitsIusedrules,_visitsIvisitdefs,_visitsIvisituses) =
+                                 visits_ _visitsOallchildvisit _visitsOallintramap _visitsOavisitdefs _visitsOavisituses _visitsOchildintros _visitsOinhmap _visitsOmrules _visitsOnt _visitsOoptions _visitsOruledefs _visitsOruleuses _visitsOsynmap _visitsOterminaldefs 
+                         in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOgenProdIO,_lhsOimports,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
+-- EProductions ------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         allstates            : Set.Set StateIdentifier
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         importBlocks         : PP_Doc
+         inhmap               : Attributes
+         initial              : StateIdentifier
+         mainFile             : String
+         mainName             : String
+         moduleHeader         : String -> String -> String -> Bool -> String
+         nt                   : NontermIdent
+         options              : Options
+         optionsLine          : String
+         pragmaBlocks         : String
+         rename               : Bool
+         synmap               : Attributes
+         textBlocks           : PP_Doc
+      synthesized attributes:
+         allvisits            : [VisitStateState]
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         datatype             : [PP_Doc]
+         genProdIO            : IO ()
+         imports              : [PP_Doc]
+         sem_nt               : PP_Doc
+         sem_prod             : PP_Doc
+         t_visits             : PP_Doc
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative Cons:
+         child hd             : EProduction 
+         child tl             : EProductions 
+      alternative Nil:
+-}
+-- cata
+sem_EProductions :: EProductions  ->
+                    T_EProductions 
+sem_EProductions list  =
+    (Prelude.foldr sem_EProductions_Cons sem_EProductions_Nil (Prelude.map sem_EProduction list) )
+-- semantic domain
+newtype T_EProductions  = T_EProductions ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                          (Set.Set StateIdentifier) ->
+                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                          (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                          PP_Doc ->
+                                          Attributes ->
+                                          StateIdentifier ->
+                                          String ->
+                                          String ->
+                                          (String -> String -> String -> Bool -> String) ->
+                                          NontermIdent ->
+                                          Options ->
+                                          String ->
+                                          String ->
+                                          Bool ->
+                                          Attributes ->
+                                          PP_Doc ->
+                                          ( ([VisitStateState]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),([PP_Doc]),(IO ()),([PP_Doc]),PP_Doc,PP_Doc,PP_Doc,(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_EProductions  = Inh_EProductions {allchildvisit_Inh_EProductions :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allstates_Inh_EProductions :: (Set.Set StateIdentifier),avisitdefs_Inh_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),importBlocks_Inh_EProductions :: PP_Doc,inhmap_Inh_EProductions :: Attributes,initial_Inh_EProductions :: StateIdentifier,mainFile_Inh_EProductions :: String,mainName_Inh_EProductions :: String,moduleHeader_Inh_EProductions :: (String -> String -> String -> Bool -> String),nt_Inh_EProductions :: NontermIdent,options_Inh_EProductions :: Options,optionsLine_Inh_EProductions :: String,pragmaBlocks_Inh_EProductions :: String,rename_Inh_EProductions :: Bool,synmap_Inh_EProductions :: Attributes,textBlocks_Inh_EProductions :: PP_Doc}
+data Syn_EProductions  = Syn_EProductions {allvisits_Syn_EProductions :: ([VisitStateState]),childvisit_Syn_EProductions :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),datatype_Syn_EProductions :: ([PP_Doc]),genProdIO_Syn_EProductions :: (IO ()),imports_Syn_EProductions :: ([PP_Doc]),sem_nt_Syn_EProductions :: PP_Doc,sem_prod_Syn_EProductions :: PP_Doc,t_visits_Syn_EProductions :: PP_Doc,visitdefs_Syn_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_EProductions :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_EProductions :: T_EProductions  ->
+                     Inh_EProductions  ->
+                     Syn_EProductions 
+wrap_EProductions (T_EProductions sem ) (Inh_EProductions _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIimportBlocks _lhsIinhmap _lhsIinitial _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsInt _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIrename _lhsIsynmap _lhsItextBlocks )  =
+    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOgenProdIO,_lhsOimports,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallstates _lhsIavisitdefs _lhsIavisituses _lhsIimportBlocks _lhsIinhmap _lhsIinitial _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsInt _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIrename _lhsIsynmap _lhsItextBlocks 
+     in  (Syn_EProductions _lhsOallvisits _lhsOchildvisit _lhsOdatatype _lhsOgenProdIO _lhsOimports _lhsOsem_nt _lhsOsem_prod _lhsOt_visits _lhsOvisitdefs _lhsOvisituses ))
+sem_EProductions_Cons :: T_EProduction  ->
+                         T_EProductions  ->
+                         T_EProductions 
+sem_EProductions_Cons (T_EProduction hd_ ) (T_EProductions tl_ )  =
+    (T_EProductions (\ _lhsIallchildvisit
+                       _lhsIallstates
+                       _lhsIavisitdefs
+                       _lhsIavisituses
+                       _lhsIimportBlocks
+                       _lhsIinhmap
+                       _lhsIinitial
+                       _lhsImainFile
+                       _lhsImainName
+                       _lhsImoduleHeader
+                       _lhsInt
+                       _lhsIoptions
+                       _lhsIoptionsLine
+                       _lhsIpragmaBlocks
+                       _lhsIrename
+                       _lhsIsynmap
+                       _lhsItextBlocks ->
+                         (let _lhsOallvisits :: ([VisitStateState])
+                              _lhsOt_visits :: PP_Doc
+                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _lhsOdatatype :: ([PP_Doc])
+                              _lhsOgenProdIO :: (IO ())
+                              _lhsOimports :: ([PP_Doc])
+                              _lhsOsem_nt :: PP_Doc
+                              _lhsOsem_prod :: PP_Doc
+                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _hdOallstates :: (Set.Set StateIdentifier)
+                              _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _hdOimportBlocks :: PP_Doc
+                              _hdOinhmap :: Attributes
+                              _hdOinitial :: StateIdentifier
+                              _hdOmainFile :: String
+                              _hdOmainName :: String
+                              _hdOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                              _hdOnt :: NontermIdent
+                              _hdOoptions :: Options
+                              _hdOoptionsLine :: String
+                              _hdOpragmaBlocks :: String
+                              _hdOrename :: Bool
+                              _hdOsynmap :: Attributes
+                              _hdOtextBlocks :: PP_Doc
+                              _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _tlOallstates :: (Set.Set StateIdentifier)
+                              _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _tlOimportBlocks :: PP_Doc
+                              _tlOinhmap :: Attributes
+                              _tlOinitial :: StateIdentifier
+                              _tlOmainFile :: String
+                              _tlOmainName :: String
+                              _tlOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                              _tlOnt :: NontermIdent
+                              _tlOoptions :: Options
+                              _tlOoptionsLine :: String
+                              _tlOpragmaBlocks :: String
+                              _tlOrename :: Bool
+                              _tlOsynmap :: Attributes
+                              _tlOtextBlocks :: PP_Doc
+                              _hdIallvisits :: ([VisitStateState])
+                              _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _hdIdatatype :: PP_Doc
+                              _hdIgenProdIO :: (IO ())
+                              _hdIimports :: ([PP_Doc])
+                              _hdIsem_nt :: PP_Doc
+                              _hdIsem_prod :: PP_Doc
+                              _hdIt_visits :: PP_Doc
+                              _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _tlIallvisits :: ([VisitStateState])
+                              _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _tlIdatatype :: ([PP_Doc])
+                              _tlIgenProdIO :: (IO ())
+                              _tlIimports :: ([PP_Doc])
+                              _tlIsem_nt :: PP_Doc
+                              _tlIsem_prod :: PP_Doc
+                              _tlIt_visits :: PP_Doc
+                              _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              -- "ExecutionPlan2Hs.ag"(line 215, column 10)
+                              _lhsOallvisits =
+                                  ({-# LINE 215 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIallvisits
+                                   {-# LINE 1966 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- "ExecutionPlan2Hs.ag"(line 256, column 10)
+                              _lhsOt_visits =
+                                  ({-# LINE 256 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIt_visits
+                                   {-# LINE 1972 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                              _lhsOchildvisit =
+                                  ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIchildvisit `Map.union` _tlIchildvisit
+                                   {-# LINE 1978 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 118, column 34)
+                              _lhsOdatatype =
+                                  ({-# LINE 118 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIdatatype : _tlIdatatype
+                                   {-# LINE 1984 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 627, column 49)
+                              _lhsOgenProdIO =
+                                  ({-# LINE 627 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIgenProdIO >> _tlIgenProdIO
+                                   {-# LINE 1990 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 626, column 47)
+                              _lhsOimports =
+                                  ({-# LINE 626 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIimports ++ _tlIimports
+                                   {-# LINE 1996 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 168, column 44)
+                              _lhsOsem_nt =
+                                  ({-# LINE 168 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIsem_nt >-< _tlIsem_nt
+                                   {-# LINE 2002 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 310, column 34)
+                              _lhsOsem_prod =
+                                  ({-# LINE 310 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIsem_prod >-< _tlIsem_prod
+                                   {-# LINE 2008 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                              _lhsOvisitdefs =
+                                  ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
+                                   {-# LINE 2014 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                              _lhsOvisituses =
+                                  ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                   _hdIvisituses `uwSetUnion` _tlIvisituses
+                                   {-# LINE 2020 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOallchildvisit =
+                                  ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIallchildvisit
+                                   {-# LINE 2026 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOallstates =
+                                  ({-# LINE 313 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIallstates
+                                   {-# LINE 2032 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOavisitdefs =
+                                  ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisitdefs
+                                   {-# LINE 2038 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOavisituses =
+                                  ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisituses
+                                   {-# LINE 2044 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOimportBlocks =
+                                  ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIimportBlocks
+                                   {-# LINE 2050 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOinhmap =
+                                  ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIinhmap
+                                   {-# LINE 2056 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOinitial =
+                                  ({-# LINE 312 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIinitial
+                                   {-# LINE 2062 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOmainFile =
+                                  ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainFile
+                                   {-# LINE 2068 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOmainName =
+                                  ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainName
+                                   {-# LINE 2074 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOmoduleHeader =
+                                  ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImoduleHeader
+                                   {-# LINE 2080 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOnt =
+                                  ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsInt
+                                   {-# LINE 2086 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOoptions =
+                                  ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptions
+                                   {-# LINE 2092 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOoptionsLine =
+                                  ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptionsLine
+                                   {-# LINE 2098 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOpragmaBlocks =
+                                  ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIpragmaBlocks
+                                   {-# LINE 2104 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOrename =
+                                  ({-# LINE 42 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIrename
+                                   {-# LINE 2110 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOsynmap =
+                                  ({-# LINE 195 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIsynmap
+                                   {-# LINE 2116 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOtextBlocks =
+                                  ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsItextBlocks
+                                   {-# LINE 2122 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOallchildvisit =
+                                  ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIallchildvisit
+                                   {-# LINE 2128 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOallstates =
+                                  ({-# LINE 313 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIallstates
+                                   {-# LINE 2134 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOavisitdefs =
+                                  ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisitdefs
+                                   {-# LINE 2140 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOavisituses =
+                                  ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIavisituses
+                                   {-# LINE 2146 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOimportBlocks =
+                                  ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIimportBlocks
+                                   {-# LINE 2152 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOinhmap =
+                                  ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIinhmap
+                                   {-# LINE 2158 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOinitial =
+                                  ({-# LINE 312 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIinitial
+                                   {-# LINE 2164 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOmainFile =
+                                  ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainFile
+                                   {-# LINE 2170 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOmainName =
+                                  ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImainName
+                                   {-# LINE 2176 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOmoduleHeader =
+                                  ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsImoduleHeader
+                                   {-# LINE 2182 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOnt =
+                                  ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsInt
+                                   {-# LINE 2188 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOoptions =
+                                  ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptions
+                                   {-# LINE 2194 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOoptionsLine =
+                                  ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIoptionsLine
+                                   {-# LINE 2200 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOpragmaBlocks =
+                                  ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIpragmaBlocks
+                                   {-# LINE 2206 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOrename =
+                                  ({-# LINE 42 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIrename
+                                   {-# LINE 2212 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOsynmap =
+                                  ({-# LINE 195 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsIsynmap
+                                   {-# LINE 2218 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOtextBlocks =
+                                  ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                   _lhsItextBlocks
+                                   {-# LINE 2224 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              ( _hdIallvisits,_hdIchildvisit,_hdIdatatype,_hdIgenProdIO,_hdIimports,_hdIsem_nt,_hdIsem_prod,_hdIt_visits,_hdIvisitdefs,_hdIvisituses) =
+                                  hd_ _hdOallchildvisit _hdOallstates _hdOavisitdefs _hdOavisituses _hdOimportBlocks _hdOinhmap _hdOinitial _hdOmainFile _hdOmainName _hdOmoduleHeader _hdOnt _hdOoptions _hdOoptionsLine _hdOpragmaBlocks _hdOrename _hdOsynmap _hdOtextBlocks 
+                              ( _tlIallvisits,_tlIchildvisit,_tlIdatatype,_tlIgenProdIO,_tlIimports,_tlIsem_nt,_tlIsem_prod,_tlIt_visits,_tlIvisitdefs,_tlIvisituses) =
+                                  tl_ _tlOallchildvisit _tlOallstates _tlOavisitdefs _tlOavisituses _tlOimportBlocks _tlOinhmap _tlOinitial _tlOmainFile _tlOmainName _tlOmoduleHeader _tlOnt _tlOoptions _tlOoptionsLine _tlOpragmaBlocks _tlOrename _tlOsynmap _tlOtextBlocks 
+                          in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOgenProdIO,_lhsOimports,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
+sem_EProductions_Nil :: T_EProductions 
+sem_EProductions_Nil  =
+    (T_EProductions (\ _lhsIallchildvisit
+                       _lhsIallstates
+                       _lhsIavisitdefs
+                       _lhsIavisituses
+                       _lhsIimportBlocks
+                       _lhsIinhmap
+                       _lhsIinitial
+                       _lhsImainFile
+                       _lhsImainName
+                       _lhsImoduleHeader
+                       _lhsInt
+                       _lhsIoptions
+                       _lhsIoptionsLine
+                       _lhsIpragmaBlocks
+                       _lhsIrename
+                       _lhsIsynmap
+                       _lhsItextBlocks ->
+                         (let _lhsOallvisits :: ([VisitStateState])
+                              _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                              _lhsOdatatype :: ([PP_Doc])
+                              _lhsOgenProdIO :: (IO ())
+                              _lhsOimports :: ([PP_Doc])
+                              _lhsOsem_nt :: PP_Doc
+                              _lhsOsem_prod :: PP_Doc
+                              _lhsOt_visits :: PP_Doc
+                              _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                              -- "ExecutionPlan2Hs.ag"(line 216, column 10)
+                              _lhsOallvisits =
+                                  ({-# LINE 216 "ExecutionPlan2Hs.ag" #-}
+                                   error "Every nonterminal should have at least 1 production"
+                                   {-# LINE 2264 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                              _lhsOchildvisit =
+                                  ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                                   Map.empty
+                                   {-# LINE 2270 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 118, column 34)
+                              _lhsOdatatype =
+                                  ({-# LINE 118 "ExecutionPlan2Hs.ag" #-}
+                                   []
+                                   {-# LINE 2276 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 627, column 49)
+                              _lhsOgenProdIO =
+                                  ({-# LINE 627 "ExecutionPlan2Hs.ag" #-}
+                                   return ()
+                                   {-# LINE 2282 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 626, column 47)
+                              _lhsOimports =
+                                  ({-# LINE 626 "ExecutionPlan2Hs.ag" #-}
+                                   []
+                                   {-# LINE 2288 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 168, column 44)
+                              _lhsOsem_nt =
+                                  ({-# LINE 168 "ExecutionPlan2Hs.ag" #-}
+                                   empty
+                                   {-# LINE 2294 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 310, column 34)
+                              _lhsOsem_prod =
+                                  ({-# LINE 310 "ExecutionPlan2Hs.ag" #-}
+                                   empty
+                                   {-# LINE 2300 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 253, column 54)
+                              _lhsOt_visits =
+                                  ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                                   empty
+                                   {-# LINE 2306 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                              _lhsOvisitdefs =
+                                  ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                                   Map.empty
+                                   {-# LINE 2312 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                              -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                              _lhsOvisituses =
+                                  ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                                   Map.empty
+                                   {-# LINE 2318 "ExecutionPlan2Hs.hs" #-}
+                                   )
+                          in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOdatatype,_lhsOgenProdIO,_lhsOimports,_lhsOsem_nt,_lhsOsem_prod,_lhsOt_visits,_lhsOvisitdefs,_lhsOvisituses))) )
+-- ERule -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         options              : Options
+         usedrules            : Set.Set Identifier
+      synthesized attributes:
+         mrules               : Map.Map Identifier PP_Doc
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+         sem_rules            : PP_Doc
+   alternatives:
+      alternative ERule:
+         child name           : {Identifier}
+         child pattern        : Pattern 
+         child rhs            : Expression 
+         child owrt           : {Bool}
+         child origin         : {String}
+         child explicit       : {Bool}
+         visit 0:
+            local attrlst     : _
+            local addbang     : _
+-}
+-- cata
+sem_ERule :: ERule  ->
+             T_ERule 
+sem_ERule (ERule _name _pattern _rhs _owrt _origin _explicit )  =
+    (sem_ERule_ERule _name (sem_Pattern _pattern ) (sem_Expression _rhs ) _owrt _origin _explicit )
+-- semantic domain
+newtype T_ERule  = T_ERule (Options ->
+                            (Set.Set Identifier) ->
+                            ( (Map.Map Identifier PP_Doc),(Map.Map Identifier (Set.Set String)),(Map.Map Identifier (Set.Set String)),PP_Doc))
+data Inh_ERule  = Inh_ERule {options_Inh_ERule :: Options,usedrules_Inh_ERule :: (Set.Set Identifier)}
+data Syn_ERule  = Syn_ERule {mrules_Syn_ERule :: (Map.Map Identifier PP_Doc),ruledefs_Syn_ERule :: (Map.Map Identifier (Set.Set String)),ruleuses_Syn_ERule :: (Map.Map Identifier (Set.Set String)),sem_rules_Syn_ERule :: PP_Doc}
+wrap_ERule :: T_ERule  ->
+              Inh_ERule  ->
+              Syn_ERule 
+wrap_ERule (T_ERule sem ) (Inh_ERule _lhsIoptions _lhsIusedrules )  =
+    (let ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules) = sem _lhsIoptions _lhsIusedrules 
+     in  (Syn_ERule _lhsOmrules _lhsOruledefs _lhsOruleuses _lhsOsem_rules ))
+sem_ERule_ERule :: Identifier ->
+                   T_Pattern  ->
+                   T_Expression  ->
+                   Bool ->
+                   String ->
+                   Bool ->
+                   T_ERule 
+sem_ERule_ERule name_ (T_Pattern pattern_ ) (T_Expression rhs_ ) owrt_ origin_ explicit_  =
+    (T_ERule (\ _lhsIoptions
+                _lhsIusedrules ->
+                  (let _lhsOsem_rules :: PP_Doc
+                       _lhsOmrules :: (Map.Map Identifier PP_Doc)
+                       _patternOaddtilde :: (PP_Doc -> PP_Doc)
+                       _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
+                       _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
+                       _patternIattrs :: (Set.Set String)
+                       _patternIcopy :: Pattern 
+                       _patternIsem_lhs :: ( PP_Doc )
+                       _rhsIattrs :: (Set.Set String)
+                       _rhsIsemfunc :: PP_Doc
+                       -- "ExecutionPlan2Hs.ag"(line 410, column 11)
+                       _lhsOsem_rules =
+                           ({-# LINE 410 "ExecutionPlan2Hs.ag" #-}
+                            if Set.member name_ _lhsIusedrules
+                            then (name_ >#< "=" >#<
+                                 (if Set.null _rhsIattrs
+                                  then empty
+                                  else "\\" >|< _attrlst     >#< "->")
+                                 >#< _rhsIsemfunc)
+                            else empty
+                            {-# LINE 2391 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 417, column 11)
+                       _attrlst =
+                           ({-# LINE 417 "ExecutionPlan2Hs.ag" #-}
+                            ppSpaced $ Set.toList _rhsIattrs
+                            {-# LINE 2397 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 418, column 11)
+                       _lhsOmrules =
+                           ({-# LINE 418 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton name_ $ _addbang     _patternIsem_lhs >#< "<-" >#< "return" >#< "$" >#< name_ >#< _attrlst
+                            {-# LINE 2403 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 419, column 11)
+                       _patternOaddtilde =
+                           ({-# LINE 419 "ExecutionPlan2Hs.ag" #-}
+                            \x -> if cases _lhsIoptions then x else "~" >|< x
+                            {-# LINE 2409 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 420, column 11)
+                       _addbang =
+                           ({-# LINE 420 "ExecutionPlan2Hs.ag" #-}
+                            \x -> if bangpats _lhsIoptions then "!" >|< x else x
+                            {-# LINE 2415 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 507, column 11)
+                       _lhsOruledefs =
+                           ({-# LINE 507 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton name_ _patternIattrs
+                            {-# LINE 2421 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 508, column 11)
+                       _lhsOruleuses =
+                           ({-# LINE 508 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton name_ _rhsIattrs
+                            {-# LINE 2427 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       ( _patternIattrs,_patternIcopy,_patternIsem_lhs) =
+                           pattern_ _patternOaddtilde 
+                       ( _rhsIattrs,_rhsIsemfunc) =
+                           rhs_ 
+                   in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
+-- ERules ------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         options              : Options
+         usedrules            : Set.Set Identifier
+      synthesized attributes:
+         mrules               : Map.Map Identifier PP_Doc
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+         sem_rules            : PP_Doc
+   alternatives:
+      alternative Cons:
+         child hd             : ERule 
+         child tl             : ERules 
+      alternative Nil:
+-}
+-- cata
+sem_ERules :: ERules  ->
+              T_ERules 
+sem_ERules list  =
+    (Prelude.foldr sem_ERules_Cons sem_ERules_Nil (Prelude.map sem_ERule list) )
+-- semantic domain
+newtype T_ERules  = T_ERules (Options ->
+                              (Set.Set Identifier) ->
+                              ( (Map.Map Identifier PP_Doc),(Map.Map Identifier (Set.Set String)),(Map.Map Identifier (Set.Set String)),PP_Doc))
+data Inh_ERules  = Inh_ERules {options_Inh_ERules :: Options,usedrules_Inh_ERules :: (Set.Set Identifier)}
+data Syn_ERules  = Syn_ERules {mrules_Syn_ERules :: (Map.Map Identifier PP_Doc),ruledefs_Syn_ERules :: (Map.Map Identifier (Set.Set String)),ruleuses_Syn_ERules :: (Map.Map Identifier (Set.Set String)),sem_rules_Syn_ERules :: PP_Doc}
+wrap_ERules :: T_ERules  ->
+               Inh_ERules  ->
+               Syn_ERules 
+wrap_ERules (T_ERules sem ) (Inh_ERules _lhsIoptions _lhsIusedrules )  =
+    (let ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules) = sem _lhsIoptions _lhsIusedrules 
+     in  (Syn_ERules _lhsOmrules _lhsOruledefs _lhsOruleuses _lhsOsem_rules ))
+sem_ERules_Cons :: T_ERule  ->
+                   T_ERules  ->
+                   T_ERules 
+sem_ERules_Cons (T_ERule hd_ ) (T_ERules tl_ )  =
+    (T_ERules (\ _lhsIoptions
+                 _lhsIusedrules ->
+                   (let _lhsOmrules :: (Map.Map Identifier PP_Doc)
+                        _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
+                        _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
+                        _lhsOsem_rules :: PP_Doc
+                        _hdOoptions :: Options
+                        _hdOusedrules :: (Set.Set Identifier)
+                        _tlOoptions :: Options
+                        _tlOusedrules :: (Set.Set Identifier)
+                        _hdImrules :: (Map.Map Identifier PP_Doc)
+                        _hdIruledefs :: (Map.Map Identifier (Set.Set String))
+                        _hdIruleuses :: (Map.Map Identifier (Set.Set String))
+                        _hdIsem_rules :: PP_Doc
+                        _tlImrules :: (Map.Map Identifier PP_Doc)
+                        _tlIruledefs :: (Map.Map Identifier (Set.Set String))
+                        _tlIruleuses :: (Map.Map Identifier (Set.Set String))
+                        _tlIsem_rules :: PP_Doc
+                        -- use rule "ExecutionPlan2Hs.ag"(line 407, column 32)
+                        _lhsOmrules =
+                            ({-# LINE 407 "ExecutionPlan2Hs.ag" #-}
+                             _hdImrules `Map.union` _tlImrules
+                             {-# LINE 2494 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 500, column 34)
+                        _lhsOruledefs =
+                            ({-# LINE 500 "ExecutionPlan2Hs.ag" #-}
+                             _hdIruledefs `uwSetUnion` _tlIruledefs
+                             {-# LINE 2500 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 501, column 34)
+                        _lhsOruleuses =
+                            ({-# LINE 501 "ExecutionPlan2Hs.ag" #-}
+                             _hdIruleuses `uwSetUnion` _tlIruleuses
+                             {-# LINE 2506 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 406, column 35)
+                        _lhsOsem_rules =
+                            ({-# LINE 406 "ExecutionPlan2Hs.ag" #-}
+                             _hdIsem_rules >-< _tlIsem_rules
+                             {-# LINE 2512 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOoptions =
+                            ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIoptions
+                             {-# LINE 2518 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOusedrules =
+                            ({-# LINE 397 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIusedrules
+                             {-# LINE 2524 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOoptions =
+                            ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIoptions
+                             {-# LINE 2530 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOusedrules =
+                            ({-# LINE 397 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIusedrules
+                             {-# LINE 2536 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        ( _hdImrules,_hdIruledefs,_hdIruleuses,_hdIsem_rules) =
+                            hd_ _hdOoptions _hdOusedrules 
+                        ( _tlImrules,_tlIruledefs,_tlIruleuses,_tlIsem_rules) =
+                            tl_ _tlOoptions _tlOusedrules 
+                    in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
+sem_ERules_Nil :: T_ERules 
+sem_ERules_Nil  =
+    (T_ERules (\ _lhsIoptions
+                 _lhsIusedrules ->
+                   (let _lhsOmrules :: (Map.Map Identifier PP_Doc)
+                        _lhsOruledefs :: (Map.Map Identifier (Set.Set String))
+                        _lhsOruleuses :: (Map.Map Identifier (Set.Set String))
+                        _lhsOsem_rules :: PP_Doc
+                        -- use rule "ExecutionPlan2Hs.ag"(line 407, column 32)
+                        _lhsOmrules =
+                            ({-# LINE 407 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 2555 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 500, column 34)
+                        _lhsOruledefs =
+                            ({-# LINE 500 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 2561 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 501, column 34)
+                        _lhsOruleuses =
+                            ({-# LINE 501 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 2567 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 406, column 35)
+                        _lhsOsem_rules =
+                            ({-# LINE 406 "ExecutionPlan2Hs.ag" #-}
+                             empty
+                             {-# LINE 2573 "ExecutionPlan2Hs.hs" #-}
+                             )
+                    in  ( _lhsOmrules,_lhsOruledefs,_lhsOruleuses,_lhsOsem_rules))) )
+-- ExecutionPlan -----------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         importBlocks         : PP_Doc
+         inhmap               : Map.Map NontermIdent Attributes
+         mainFile             : String
+         mainName             : String
+         moduleHeader         : String -> String -> String -> Bool -> String
+         options              : Options
+         optionsLine          : String
+         pragmaBlocks         : String
+         synmap               : Map.Map NontermIdent Attributes
+         textBlocks           : PP_Doc
+      synthesized attributes:
+         genIO                : IO ()
+         output               : PP_Doc
+   alternatives:
+      alternative ExecutionPlan:
+         child nonts          : ENonterminals 
+         child typeSyns       : {TypeSyns}
+         child wrappers       : {Set.Set NontermIdent}
+         child derivings      : {Derivings}
+         visit 0:
+            local mainModuleFile : _
+            local genMainModule : _
+            local commonFile  : _
+            local genCommonModule : _
+-}
+-- cata
+sem_ExecutionPlan :: ExecutionPlan  ->
+                     T_ExecutionPlan 
+sem_ExecutionPlan (ExecutionPlan _nonts _typeSyns _wrappers _derivings )  =
+    (sem_ExecutionPlan_ExecutionPlan (sem_ENonterminals _nonts ) _typeSyns _wrappers _derivings )
+-- semantic domain
+newtype T_ExecutionPlan  = T_ExecutionPlan (PP_Doc ->
+                                            (Map.Map NontermIdent Attributes) ->
+                                            String ->
+                                            String ->
+                                            (String -> String -> String -> Bool -> String) ->
+                                            Options ->
+                                            String ->
+                                            String ->
+                                            (Map.Map NontermIdent Attributes) ->
+                                            PP_Doc ->
+                                            ( (IO ()),PP_Doc))
+data Inh_ExecutionPlan  = Inh_ExecutionPlan {importBlocks_Inh_ExecutionPlan :: PP_Doc,inhmap_Inh_ExecutionPlan :: (Map.Map NontermIdent Attributes),mainFile_Inh_ExecutionPlan :: String,mainName_Inh_ExecutionPlan :: String,moduleHeader_Inh_ExecutionPlan :: (String -> String -> String -> Bool -> String),options_Inh_ExecutionPlan :: Options,optionsLine_Inh_ExecutionPlan :: String,pragmaBlocks_Inh_ExecutionPlan :: String,synmap_Inh_ExecutionPlan :: (Map.Map NontermIdent Attributes),textBlocks_Inh_ExecutionPlan :: PP_Doc}
+data Syn_ExecutionPlan  = Syn_ExecutionPlan {genIO_Syn_ExecutionPlan :: (IO ()),output_Syn_ExecutionPlan :: PP_Doc}
+wrap_ExecutionPlan :: T_ExecutionPlan  ->
+                      Inh_ExecutionPlan  ->
+                      Syn_ExecutionPlan 
+wrap_ExecutionPlan (T_ExecutionPlan sem ) (Inh_ExecutionPlan _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks )  =
+    (let ( _lhsOgenIO,_lhsOoutput) = sem _lhsIimportBlocks _lhsIinhmap _lhsImainFile _lhsImainName _lhsImoduleHeader _lhsIoptions _lhsIoptionsLine _lhsIpragmaBlocks _lhsIsynmap _lhsItextBlocks 
+     in  (Syn_ExecutionPlan _lhsOgenIO _lhsOoutput ))
+sem_ExecutionPlan_ExecutionPlan :: T_ENonterminals  ->
+                                   TypeSyns ->
+                                   (Set.Set NontermIdent) ->
+                                   Derivings ->
+                                   T_ExecutionPlan 
+sem_ExecutionPlan_ExecutionPlan (T_ENonterminals nonts_ ) typeSyns_ wrappers_ derivings_  =
+    (T_ExecutionPlan (\ _lhsIimportBlocks
+                        _lhsIinhmap
+                        _lhsImainFile
+                        _lhsImainName
+                        _lhsImoduleHeader
+                        _lhsIoptions
+                        _lhsIoptionsLine
+                        _lhsIpragmaBlocks
+                        _lhsIsynmap
+                        _lhsItextBlocks ->
+                          (let _lhsOoutput :: PP_Doc
+                               _nontsOwrappers :: (Set.Set NontermIdent)
+                               _nontsOtypeSyns :: TypeSyns
+                               _nontsOderivings :: Derivings
+                               _nontsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _nontsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _nontsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _lhsOgenIO :: (IO ())
+                               _nontsOimportBlocks :: PP_Doc
+                               _nontsOinhmap :: (Map.Map NontermIdent Attributes)
+                               _nontsOmainFile :: String
+                               _nontsOmainName :: String
+                               _nontsOmoduleHeader :: (String -> String -> String -> Bool -> String)
+                               _nontsOoptions :: Options
+                               _nontsOoptionsLine :: String
+                               _nontsOpragmaBlocks :: String
+                               _nontsOsynmap :: (Map.Map NontermIdent Attributes)
+                               _nontsOtextBlocks :: PP_Doc
+                               _nontsIappendCommon :: ([PP_Doc])
+                               _nontsIappendMain :: ([PP_Doc])
+                               _nontsIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                               _nontsIgenProdIO :: (IO ())
+                               _nontsIimports :: ([PP_Doc])
+                               _nontsIoutput :: PP_Doc
+                               _nontsIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               _nontsIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                               -- "ExecutionPlan2Hs.ag"(line 53, column 19)
+                               _lhsOoutput =
+                                   ({-# LINE 53 "ExecutionPlan2Hs.ag" #-}
+                                    _nontsIoutput
+                                    {-# LINE 2676 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 59, column 19)
+                               _nontsOwrappers =
+                                   ({-# LINE 59 "ExecutionPlan2Hs.ag" #-}
+                                    wrappers_
+                                    {-# LINE 2682 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 97, column 19)
+                               _nontsOtypeSyns =
+                                   ({-# LINE 97 "ExecutionPlan2Hs.ag" #-}
+                                    typeSyns_
+                                    {-# LINE 2688 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 98, column 19)
+                               _nontsOderivings =
+                                   ({-# LINE 98 "ExecutionPlan2Hs.ag" #-}
+                                    derivings_
+                                    {-# LINE 2694 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 463, column 19)
+                               _nontsOallchildvisit =
+                                   ({-# LINE 463 "ExecutionPlan2Hs.ag" #-}
+                                    _nontsIchildvisit
+                                    {-# LINE 2700 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 532, column 19)
+                               _nontsOavisitdefs =
+                                   ({-# LINE 532 "ExecutionPlan2Hs.ag" #-}
+                                    _nontsIvisitdefs
+                                    {-# LINE 2706 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 533, column 19)
+                               _nontsOavisituses =
+                                   ({-# LINE 533 "ExecutionPlan2Hs.ag" #-}
+                                    _nontsIvisituses
+                                    {-# LINE 2712 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 581, column 19)
+                               _lhsOgenIO =
+                                   ({-# LINE 581 "ExecutionPlan2Hs.ag" #-}
+                                    do _genMainModule
+                                       _genCommonModule
+                                       _nontsIgenProdIO
+                                    {-# LINE 2720 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 584, column 19)
+                               _mainModuleFile =
+                                   ({-# LINE 584 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainFile ++ ".hs"
+                                    {-# LINE 2726 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 585, column 19)
+                               _genMainModule =
+                                   ({-# LINE 585 "ExecutionPlan2Hs.ag" #-}
+                                    writeModule _mainModuleFile
+                                      ( [ pp $ "{-# LANGUAGE Rank2Types, GADTs, EmptyDataDecls #-}"
+                                        , pp $ _lhsIpragmaBlocks
+                                        , pp $ _lhsIoptionsLine
+                                        , pp $ _lhsImoduleHeader _lhsImainName "" "" False
+                                        , pp $ "import Control.Monad.Identity"
+                                        , pp $ "import " ++ _lhsImainName ++ "_common"
+                                        ]
+                                        ++ _nontsIimports
+                                        ++ _nontsIappendMain
+                                      )
+                                    {-# LINE 2742 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 596, column 19)
+                               _commonFile =
+                                   ({-# LINE 596 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainFile ++ "_common.hs"
+                                    {-# LINE 2748 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- "ExecutionPlan2Hs.ag"(line 597, column 19)
+                               _genCommonModule =
+                                   ({-# LINE 597 "ExecutionPlan2Hs.ag" #-}
+                                    writeModule _commonFile
+                                      ( [ pp $ "{-# LANGUAGE Rank2Types, GADTs, EmptyDataDecls #-}"
+                                        , pp $ _lhsIpragmaBlocks
+                                        , pp $ _lhsIoptionsLine
+                                        , pp $ _lhsImoduleHeader _lhsImainName "_common" "" True
+                                        , pp $ "import Control.Monad.Identity"
+                                        , _lhsIimportBlocks
+                                        , _lhsItextBlocks
+                                        ]
+                                        ++ _nontsIappendCommon
+                                      )
+                                    {-# LINE 2764 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOimportBlocks =
+                                   ({-# LINE 25 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIimportBlocks
+                                    {-# LINE 2770 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOinhmap =
+                                   ({-# LINE 188 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIinhmap
+                                    {-# LINE 2776 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOmainFile =
+                                   ({-# LINE 29 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainFile
+                                    {-# LINE 2782 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOmainName =
+                                   ({-# LINE 31 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImainName
+                                    {-# LINE 2788 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOmoduleHeader =
+                                   ({-# LINE 28 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsImoduleHeader
+                                    {-# LINE 2794 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOoptions =
+                                   ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptions
+                                    {-# LINE 2800 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOoptionsLine =
+                                   ({-# LINE 30 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIoptionsLine
+                                    {-# LINE 2806 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOpragmaBlocks =
+                                   ({-# LINE 26 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIpragmaBlocks
+                                    {-# LINE 2812 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOsynmap =
+                                   ({-# LINE 189 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsIsynmap
+                                    {-# LINE 2818 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               -- copy rule (down)
+                               _nontsOtextBlocks =
+                                   ({-# LINE 27 "ExecutionPlan2Hs.ag" #-}
+                                    _lhsItextBlocks
+                                    {-# LINE 2824 "ExecutionPlan2Hs.hs" #-}
+                                    )
+                               ( _nontsIappendCommon,_nontsIappendMain,_nontsIchildvisit,_nontsIgenProdIO,_nontsIimports,_nontsIoutput,_nontsIvisitdefs,_nontsIvisituses) =
+                                   nonts_ _nontsOallchildvisit _nontsOavisitdefs _nontsOavisituses _nontsOderivings _nontsOimportBlocks _nontsOinhmap _nontsOmainFile _nontsOmainName _nontsOmoduleHeader _nontsOoptions _nontsOoptionsLine _nontsOpragmaBlocks _nontsOsynmap _nontsOtextBlocks _nontsOtypeSyns _nontsOwrappers 
+                           in  ( _lhsOgenIO,_lhsOoutput))) )
+-- Expression --------------------------------------------------
+{-
+   visit 0:
+      synthesized attributes:
+         attrs                : Set.Set String
+         semfunc              : PP_Doc
+   alternatives:
+      alternative Expression:
+         child pos            : {Pos}
+         child tks            : {[HsToken]}
+-}
+-- cata
+sem_Expression :: Expression  ->
+                  T_Expression 
+sem_Expression (Expression _pos _tks )  =
+    (sem_Expression_Expression _pos _tks )
+-- semantic domain
+newtype T_Expression  = T_Expression (( (Set.Set String),PP_Doc))
+data Inh_Expression  = Inh_Expression {}
+data Syn_Expression  = Syn_Expression {attrs_Syn_Expression :: (Set.Set String),semfunc_Syn_Expression :: PP_Doc}
+wrap_Expression :: T_Expression  ->
+                   Inh_Expression  ->
+                   Syn_Expression 
+wrap_Expression (T_Expression sem ) (Inh_Expression )  =
+    (let ( _lhsOattrs,_lhsOsemfunc) = sem 
+     in  (Syn_Expression _lhsOattrs _lhsOsemfunc ))
+sem_Expression_Expression :: Pos ->
+                             ([HsToken]) ->
+                             T_Expression 
+sem_Expression_Expression pos_ tks_  =
+    (T_Expression (let _lhsOattrs :: (Set.Set String)
+                       _lhsOsemfunc :: PP_Doc
+                       -- "ExecutionPlan2Hs.ag"(line 448, column 16)
+                       _lhsOattrs =
+                           ({-# LINE 448 "ExecutionPlan2Hs.ag" #-}
+                            Set.unions $ map (\tok -> attrs_Syn_HsToken (wrap_HsToken (sem_HsToken tok) Inh_HsToken)) tks_
+                            {-# LINE 2865 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 449, column 16)
+                       _lhsOsemfunc =
+                           ({-# LINE 449 "ExecutionPlan2Hs.ag" #-}
+                            vlist $ showTokens $ map (\tok -> tok_Syn_HsToken (wrap_HsToken (sem_HsToken tok) Inh_HsToken)) tks_
+                            {-# LINE 2871 "ExecutionPlan2Hs.hs" #-}
+                            )
+                   in  ( _lhsOattrs,_lhsOsemfunc)) )
+-- HsToken -----------------------------------------------------
+{-
+   visit 0:
+      synthesized attributes:
+         attrs                : Set.Set String
+         tok                  : (Pos,String)
+   alternatives:
+      alternative AGField:
+         child field          : {Identifier}
+         child attr           : {Identifier}
+         child pos            : {Pos}
+         child rdesc          : {Maybe String}
+         visit 0:
+            local addTrace    : _
+      alternative AGLocal:
+         child var            : {Identifier}
+         child pos            : {Pos}
+         child rdesc          : {Maybe String}
+         visit 0:
+            local tok         : _
+      alternative CharToken:
+         child value          : {String}
+         child pos            : {Pos}
+      alternative Err:
+         child mesg           : {String}
+         child pos            : {Pos}
+      alternative HsToken:
+         child value          : {String}
+         child pos            : {Pos}
+      alternative StrToken:
+         child value          : {String}
+         child pos            : {Pos}
+-}
+-- cata
+sem_HsToken :: HsToken  ->
+               T_HsToken 
+sem_HsToken (AGField _field _attr _pos _rdesc )  =
+    (sem_HsToken_AGField _field _attr _pos _rdesc )
+sem_HsToken (AGLocal _var _pos _rdesc )  =
+    (sem_HsToken_AGLocal _var _pos _rdesc )
+sem_HsToken (CharToken _value _pos )  =
+    (sem_HsToken_CharToken _value _pos )
+sem_HsToken (Err _mesg _pos )  =
+    (sem_HsToken_Err _mesg _pos )
+sem_HsToken (HsToken _value _pos )  =
+    (sem_HsToken_HsToken _value _pos )
+sem_HsToken (StrToken _value _pos )  =
+    (sem_HsToken_StrToken _value _pos )
+-- semantic domain
+newtype T_HsToken  = T_HsToken (( (Set.Set String),((Pos,String))))
+data Inh_HsToken  = Inh_HsToken {}
+data Syn_HsToken  = Syn_HsToken {attrs_Syn_HsToken :: (Set.Set String),tok_Syn_HsToken :: ((Pos,String))}
+wrap_HsToken :: T_HsToken  ->
+                Inh_HsToken  ->
+                Syn_HsToken 
+wrap_HsToken (T_HsToken sem ) (Inh_HsToken )  =
+    (let ( _lhsOattrs,_lhsOtok) = sem 
+     in  (Syn_HsToken _lhsOattrs _lhsOtok ))
+sem_HsToken_AGField :: Identifier ->
+                       Identifier ->
+                       Pos ->
+                       (Maybe String) ->
+                       T_HsToken 
+sem_HsToken_AGField field_ attr_ pos_ rdesc_  =
+    (T_HsToken (let _lhsOattrs :: (Set.Set String)
+                    _lhsOtok :: ((Pos,String))
+                    -- "ExecutionPlan2Hs.ag"(line 443, column 15)
+                    _lhsOattrs =
+                        ({-# LINE 443 "ExecutionPlan2Hs.ag" #-}
+                         Set.singleton $ attrname True field_ attr_
+                         {-# LINE 2944 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- "ExecutionPlan2Hs.ag"(line 559, column 8)
+                    _addTrace =
+                        ({-# LINE 559 "ExecutionPlan2Hs.ag" #-}
+                         case rdesc_ of
+                           Just d  -> \x -> "(trace " ++ show (d ++ " -> " ++ show field_ ++ "." ++ show attr_) ++ " (" ++ x ++ "))"
+                           Nothing -> id
+                         {-# LINE 2952 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- "ExecutionPlan2Hs.ag"(line 562, column 8)
+                    _lhsOtok =
+                        ({-# LINE 562 "ExecutionPlan2Hs.ag" #-}
+                         (pos_, _addTrace     $ attrname True field_ attr_)
+                         {-# LINE 2958 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+sem_HsToken_AGLocal :: Identifier ->
+                       Pos ->
+                       (Maybe String) ->
+                       T_HsToken 
+sem_HsToken_AGLocal var_ pos_ rdesc_  =
+    (T_HsToken (let _lhsOattrs :: (Set.Set String)
+                    _lhsOtok :: ((Pos,String))
+                    -- "ExecutionPlan2Hs.ag"(line 442, column 15)
+                    _lhsOattrs =
+                        ({-# LINE 442 "ExecutionPlan2Hs.ag" #-}
+                         Set.singleton $ locname var_
+                         {-# LINE 2972 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- "ExecutionPlan2Hs.ag"(line 555, column 15)
+                    _tok =
+                        ({-# LINE 555 "ExecutionPlan2Hs.ag" #-}
+                         (pos_,locname var_)
+                         {-# LINE 2978 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- copy rule (from local)
+                    _lhsOtok =
+                        ({-# LINE 557 "ExecutionPlan2Hs.ag" #-}
+                         _tok
+                         {-# LINE 2984 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+sem_HsToken_CharToken :: String ->
+                         Pos ->
+                         T_HsToken 
+sem_HsToken_CharToken value_ pos_  =
+    (T_HsToken (let _lhsOtok :: ((Pos,String))
+                    _lhsOattrs :: (Set.Set String)
+                    -- "ExecutionPlan2Hs.ag"(line 566, column 16)
+                    _lhsOtok =
+                        ({-# LINE 566 "ExecutionPlan2Hs.ag" #-}
+                         (pos_, if null value_
+                                   then ""
+                                   else showCharShort (head value_)
+                         )
+                         {-# LINE 3000 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- use rule "ExecutionPlan2Hs.ag"(line 440, column 37)
+                    _lhsOattrs =
+                        ({-# LINE 440 "ExecutionPlan2Hs.ag" #-}
+                         Set.empty
+                         {-# LINE 3006 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+sem_HsToken_Err :: String ->
+                   Pos ->
+                   T_HsToken 
+sem_HsToken_Err mesg_ pos_  =
+    (T_HsToken (let _lhsOtok :: ((Pos,String))
+                    _lhsOattrs :: (Set.Set String)
+                    -- "ExecutionPlan2Hs.ag"(line 572, column 16)
+                    _lhsOtok =
+                        ({-# LINE 572 "ExecutionPlan2Hs.ag" #-}
+                         (pos_, "")
+                         {-# LINE 3019 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- use rule "ExecutionPlan2Hs.ag"(line 440, column 37)
+                    _lhsOattrs =
+                        ({-# LINE 440 "ExecutionPlan2Hs.ag" #-}
+                         Set.empty
+                         {-# LINE 3025 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+sem_HsToken_HsToken :: String ->
+                       Pos ->
+                       T_HsToken 
+sem_HsToken_HsToken value_ pos_  =
+    (T_HsToken (let _lhsOtok :: ((Pos,String))
+                    _lhsOattrs :: (Set.Set String)
+                    -- "ExecutionPlan2Hs.ag"(line 564, column 14)
+                    _lhsOtok =
+                        ({-# LINE 564 "ExecutionPlan2Hs.ag" #-}
+                         (pos_, value_)
+                         {-# LINE 3038 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- use rule "ExecutionPlan2Hs.ag"(line 440, column 37)
+                    _lhsOattrs =
+                        ({-# LINE 440 "ExecutionPlan2Hs.ag" #-}
+                         Set.empty
+                         {-# LINE 3044 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+sem_HsToken_StrToken :: String ->
+                        Pos ->
+                        T_HsToken 
+sem_HsToken_StrToken value_ pos_  =
+    (T_HsToken (let _lhsOtok :: ((Pos,String))
+                    _lhsOattrs :: (Set.Set String)
+                    -- "ExecutionPlan2Hs.ag"(line 571, column 16)
+                    _lhsOtok =
+                        ({-# LINE 571 "ExecutionPlan2Hs.ag" #-}
+                         (pos_, showStrShort value_)
+                         {-# LINE 3057 "ExecutionPlan2Hs.hs" #-}
+                         )
+                    -- use rule "ExecutionPlan2Hs.ag"(line 440, column 37)
+                    _lhsOattrs =
+                        ({-# LINE 440 "ExecutionPlan2Hs.ag" #-}
+                         Set.empty
+                         {-# LINE 3063 "ExecutionPlan2Hs.hs" #-}
+                         )
+                in  ( _lhsOattrs,_lhsOtok)) )
+-- HsTokens ----------------------------------------------------
+{-
+   visit 0:
+      synthesized attribute:
+         tks                  : [(Pos,String)]
+   alternatives:
+      alternative Cons:
+         child hd             : HsToken 
+         child tl             : HsTokens 
+      alternative Nil:
+-}
+-- cata
+sem_HsTokens :: HsTokens  ->
+                T_HsTokens 
+sem_HsTokens list  =
+    (Prelude.foldr sem_HsTokens_Cons sem_HsTokens_Nil (Prelude.map sem_HsToken list) )
+-- semantic domain
+newtype T_HsTokens  = T_HsTokens (( ([(Pos,String)])))
+data Inh_HsTokens  = Inh_HsTokens {}
+data Syn_HsTokens  = Syn_HsTokens {tks_Syn_HsTokens :: ([(Pos,String)])}
+wrap_HsTokens :: T_HsTokens  ->
+                 Inh_HsTokens  ->
+                 Syn_HsTokens 
+wrap_HsTokens (T_HsTokens sem ) (Inh_HsTokens )  =
+    (let ( _lhsOtks) = sem 
+     in  (Syn_HsTokens _lhsOtks ))
+sem_HsTokens_Cons :: T_HsToken  ->
+                     T_HsTokens  ->
+                     T_HsTokens 
+sem_HsTokens_Cons (T_HsToken hd_ ) (T_HsTokens tl_ )  =
+    (T_HsTokens (let _lhsOtks :: ([(Pos,String)])
+                     _hdIattrs :: (Set.Set String)
+                     _hdItok :: ((Pos,String))
+                     _tlItks :: ([(Pos,String)])
+                     -- "ExecutionPlan2Hs.ag"(line 551, column 10)
+                     _lhsOtks =
+                         ({-# LINE 551 "ExecutionPlan2Hs.ag" #-}
+                          _hdItok : _tlItks
+                          {-# LINE 3104 "ExecutionPlan2Hs.hs" #-}
+                          )
+                     ( _hdIattrs,_hdItok) =
+                         hd_ 
+                     ( _tlItks) =
+                         tl_ 
+                 in  ( _lhsOtks)) )
+sem_HsTokens_Nil :: T_HsTokens 
+sem_HsTokens_Nil  =
+    (T_HsTokens (let _lhsOtks :: ([(Pos,String)])
+                     -- "ExecutionPlan2Hs.ag"(line 552, column 10)
+                     _lhsOtks =
+                         ({-# LINE 552 "ExecutionPlan2Hs.ag" #-}
+                          []
+                          {-# LINE 3118 "ExecutionPlan2Hs.hs" #-}
+                          )
+                 in  ( _lhsOtks)) )
+-- HsTokensRoot ------------------------------------------------
+{-
+   alternatives:
+      alternative HsTokensRoot:
+         child tokens         : HsTokens 
+-}
+-- cata
+sem_HsTokensRoot :: HsTokensRoot  ->
+                    T_HsTokensRoot 
+sem_HsTokensRoot (HsTokensRoot _tokens )  =
+    (sem_HsTokensRoot_HsTokensRoot (sem_HsTokens _tokens ) )
+-- semantic domain
+newtype T_HsTokensRoot  = T_HsTokensRoot (( ))
+data Inh_HsTokensRoot  = Inh_HsTokensRoot {}
+data Syn_HsTokensRoot  = Syn_HsTokensRoot {}
+wrap_HsTokensRoot :: T_HsTokensRoot  ->
+                     Inh_HsTokensRoot  ->
+                     Syn_HsTokensRoot 
+wrap_HsTokensRoot (T_HsTokensRoot sem ) (Inh_HsTokensRoot )  =
+    (let ( ) = sem 
+     in  (Syn_HsTokensRoot ))
+sem_HsTokensRoot_HsTokensRoot :: T_HsTokens  ->
+                                 T_HsTokensRoot 
+sem_HsTokensRoot_HsTokensRoot (T_HsTokens tokens_ )  =
+    (T_HsTokensRoot (let _tokensItks :: ([(Pos,String)])
+                         ( _tokensItks) =
+                             tokens_ 
+                     in  ( )) )
+-- Pattern -----------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         addtilde             : PP_Doc -> PP_Doc
+      synthesized attributes:
+         attrs                : Set.Set String
+         copy                 : SELF 
+         sem_lhs              :  PP_Doc 
+   alternatives:
+      alternative Alias:
+         child field          : {Identifier}
+         child attr           : {Identifier}
+         child pat            : Pattern 
+         child parts          : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Constr:
+         child name           : {ConstructorIdent}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Irrefutable:
+         child pat            : Pattern 
+         visit 0:
+            local copy        : _
+      alternative Product:
+         child pos            : {Pos}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Underscore:
+         child pos            : {Pos}
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Pattern :: Pattern  ->
+               T_Pattern 
+sem_Pattern (Alias _field _attr _pat _parts )  =
+    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
+sem_Pattern (Constr _name _pats )  =
+    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
+sem_Pattern (Irrefutable _pat )  =
+    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
+sem_Pattern (Product _pos _pats )  =
+    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
+sem_Pattern (Underscore _pos )  =
+    (sem_Pattern_Underscore _pos )
+-- semantic domain
+newtype T_Pattern  = T_Pattern ((PP_Doc -> PP_Doc) ->
+                                ( (Set.Set String),Pattern ,( PP_Doc )))
+data Inh_Pattern  = Inh_Pattern {addtilde_Inh_Pattern :: (PP_Doc -> PP_Doc)}
+data Syn_Pattern  = Syn_Pattern {attrs_Syn_Pattern :: (Set.Set String),copy_Syn_Pattern :: Pattern ,sem_lhs_Syn_Pattern :: ( PP_Doc )}
+wrap_Pattern :: T_Pattern  ->
+                Inh_Pattern  ->
+                Syn_Pattern 
+wrap_Pattern (T_Pattern sem ) (Inh_Pattern _lhsIaddtilde )  =
+    (let ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs) = sem _lhsIaddtilde 
+     in  (Syn_Pattern _lhsOattrs _lhsOcopy _lhsOsem_lhs ))
+sem_Pattern_Alias :: Identifier ->
+                     Identifier ->
+                     T_Pattern  ->
+                     T_Patterns  ->
+                     T_Pattern 
+sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
+    (T_Pattern (\ _lhsIaddtilde ->
+                    (let _lhsOsem_lhs :: ( PP_Doc )
+                         _lhsOattrs :: (Set.Set String)
+                         _lhsOcopy :: Pattern 
+                         _patOaddtilde :: (PP_Doc -> PP_Doc)
+                         _partsOaddtilde :: (PP_Doc -> PP_Doc)
+                         _patIattrs :: (Set.Set String)
+                         _patIcopy :: Pattern 
+                         _patIsem_lhs :: ( PP_Doc )
+                         _partsIattrs :: (Set.Set String)
+                         _partsIcopy :: Patterns 
+                         _partsIsem_lhs :: ([PP_Doc])
+                         -- "ExecutionPlan2Hs.ag"(line 430, column 17)
+                         _lhsOsem_lhs =
+                             ({-# LINE 430 "ExecutionPlan2Hs.ag" #-}
+                              text $ attrname False field_ attr_
+                              {-# LINE 3231 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- "ExecutionPlan2Hs.ag"(line 431, column 17)
+                         _lhsOattrs =
+                             ({-# LINE 431 "ExecutionPlan2Hs.ag" #-}
+                              Set.singleton $ attrname False field_ attr_
+                              {-# LINE 3237 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Alias field_ attr_ _patIcopy _partsIcopy
+                              {-# LINE 3243 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3249 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOaddtilde =
+                             ({-# LINE 425 "ExecutionPlan2Hs.ag" #-}
+                              _lhsIaddtilde
+                              {-# LINE 3255 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOaddtilde =
+                             ({-# LINE 425 "ExecutionPlan2Hs.ag" #-}
+                              _lhsIaddtilde
+                              {-# LINE 3261 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         ( _patIattrs,_patIcopy,_patIsem_lhs) =
+                             pat_ _patOaddtilde 
+                         ( _partsIattrs,_partsIcopy,_partsIsem_lhs) =
+                             parts_ _partsOaddtilde 
+                     in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+sem_Pattern_Constr :: ConstructorIdent ->
+                      T_Patterns  ->
+                      T_Pattern 
+sem_Pattern_Constr name_ (T_Patterns pats_ )  =
+    (T_Pattern (\ _lhsIaddtilde ->
+                    (let _lhsOsem_lhs :: ( PP_Doc )
+                         _patsOaddtilde :: (PP_Doc -> PP_Doc)
+                         _lhsOattrs :: (Set.Set String)
+                         _lhsOcopy :: Pattern 
+                         _patsIattrs :: (Set.Set String)
+                         _patsIcopy :: Patterns 
+                         _patsIsem_lhs :: ([PP_Doc])
+                         -- "ExecutionPlan2Hs.ag"(line 434, column 17)
+                         _lhsOsem_lhs =
+                             ({-# LINE 434 "ExecutionPlan2Hs.ag" #-}
+                              _lhsIaddtilde $ pp_parens $ name_ >#< hv_sp _patsIsem_lhs
+                              {-# LINE 3284 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- "ExecutionPlan2Hs.ag"(line 435, column 17)
+                         _patsOaddtilde =
+                             ({-# LINE 435 "ExecutionPlan2Hs.ag" #-}
+                              id
+                              {-# LINE 3290 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                         _lhsOattrs =
+                             ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                              _patsIattrs
+                              {-# LINE 3296 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Constr name_ _patsIcopy
+                              {-# LINE 3302 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3308 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         ( _patsIattrs,_patsIcopy,_patsIsem_lhs) =
+                             pats_ _patsOaddtilde 
+                     in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+sem_Pattern_Irrefutable :: T_Pattern  ->
+                           T_Pattern 
+sem_Pattern_Irrefutable (T_Pattern pat_ )  =
+    (T_Pattern (\ _lhsIaddtilde ->
+                    (let _lhsOsem_lhs :: ( PP_Doc )
+                         _patOaddtilde :: (PP_Doc -> PP_Doc)
+                         _lhsOattrs :: (Set.Set String)
+                         _lhsOcopy :: Pattern 
+                         _patIattrs :: (Set.Set String)
+                         _patIcopy :: Pattern 
+                         _patIsem_lhs :: ( PP_Doc )
+                         -- "ExecutionPlan2Hs.ag"(line 437, column 17)
+                         _lhsOsem_lhs =
+                             ({-# LINE 437 "ExecutionPlan2Hs.ag" #-}
+                              text "~" >|< pp_parens _patIsem_lhs
+                              {-# LINE 3328 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- "ExecutionPlan2Hs.ag"(line 438, column 17)
+                         _patOaddtilde =
+                             ({-# LINE 438 "ExecutionPlan2Hs.ag" #-}
+                              id
+                              {-# LINE 3334 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                         _lhsOattrs =
+                             ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                              _patIattrs
+                              {-# LINE 3340 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Irrefutable _patIcopy
+                              {-# LINE 3346 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3352 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         ( _patIattrs,_patIcopy,_patIsem_lhs) =
+                             pat_ _patOaddtilde 
+                     in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+sem_Pattern_Product :: Pos ->
+                       T_Patterns  ->
+                       T_Pattern 
+sem_Pattern_Product pos_ (T_Patterns pats_ )  =
+    (T_Pattern (\ _lhsIaddtilde ->
+                    (let _lhsOsem_lhs :: ( PP_Doc )
+                         _patsOaddtilde :: (PP_Doc -> PP_Doc)
+                         _lhsOattrs :: (Set.Set String)
+                         _lhsOcopy :: Pattern 
+                         _patsIattrs :: (Set.Set String)
+                         _patsIcopy :: Patterns 
+                         _patsIsem_lhs :: ([PP_Doc])
+                         -- "ExecutionPlan2Hs.ag"(line 432, column 17)
+                         _lhsOsem_lhs =
+                             ({-# LINE 432 "ExecutionPlan2Hs.ag" #-}
+                              _lhsIaddtilde $ pp_block "(" ")" "," _patsIsem_lhs
+                              {-# LINE 3373 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- "ExecutionPlan2Hs.ag"(line 433, column 17)
+                         _patsOaddtilde =
+                             ({-# LINE 433 "ExecutionPlan2Hs.ag" #-}
+                              id
+                              {-# LINE 3379 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                         _lhsOattrs =
+                             ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                              _patsIattrs
+                              {-# LINE 3385 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Product pos_ _patsIcopy
+                              {-# LINE 3391 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3397 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         ( _patsIattrs,_patsIcopy,_patsIsem_lhs) =
+                             pats_ _patsOaddtilde 
+                     in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+sem_Pattern_Underscore :: Pos ->
+                          T_Pattern 
+sem_Pattern_Underscore pos_  =
+    (T_Pattern (\ _lhsIaddtilde ->
+                    (let _lhsOsem_lhs :: ( PP_Doc )
+                         _lhsOattrs :: (Set.Set String)
+                         _lhsOcopy :: Pattern 
+                         -- "ExecutionPlan2Hs.ag"(line 436, column 17)
+                         _lhsOsem_lhs =
+                             ({-# LINE 436 "ExecutionPlan2Hs.ag" #-}
+                              text "_"
+                              {-# LINE 3413 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                         _lhsOattrs =
+                             ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                              Set.empty
+                              {-# LINE 3419 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Underscore pos_
+                              {-# LINE 3425 "ExecutionPlan2Hs.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3431 "ExecutionPlan2Hs.hs" #-}
+                              )
+                     in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+-- Patterns ----------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         addtilde             : PP_Doc -> PP_Doc
+      synthesized attributes:
+         attrs                : Set.Set String
+         copy                 : SELF 
+         sem_lhs              : [PP_Doc]
+   alternatives:
+      alternative Cons:
+         child hd             : Pattern 
+         child tl             : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Nil:
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Patterns :: Patterns  ->
+                T_Patterns 
+sem_Patterns list  =
+    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
+-- semantic domain
+newtype T_Patterns  = T_Patterns ((PP_Doc -> PP_Doc) ->
+                                  ( (Set.Set String),Patterns ,([PP_Doc])))
+data Inh_Patterns  = Inh_Patterns {addtilde_Inh_Patterns :: (PP_Doc -> PP_Doc)}
+data Syn_Patterns  = Syn_Patterns {attrs_Syn_Patterns :: (Set.Set String),copy_Syn_Patterns :: Patterns ,sem_lhs_Syn_Patterns :: ([PP_Doc])}
+wrap_Patterns :: T_Patterns  ->
+                 Inh_Patterns  ->
+                 Syn_Patterns 
+wrap_Patterns (T_Patterns sem ) (Inh_Patterns _lhsIaddtilde )  =
+    (let ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs) = sem _lhsIaddtilde 
+     in  (Syn_Patterns _lhsOattrs _lhsOcopy _lhsOsem_lhs ))
+sem_Patterns_Cons :: T_Pattern  ->
+                     T_Patterns  ->
+                     T_Patterns 
+sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
+    (T_Patterns (\ _lhsIaddtilde ->
+                     (let _lhsOattrs :: (Set.Set String)
+                          _lhsOsem_lhs :: ([PP_Doc])
+                          _lhsOcopy :: Patterns 
+                          _hdOaddtilde :: (PP_Doc -> PP_Doc)
+                          _tlOaddtilde :: (PP_Doc -> PP_Doc)
+                          _hdIattrs :: (Set.Set String)
+                          _hdIcopy :: Pattern 
+                          _hdIsem_lhs :: ( PP_Doc )
+                          _tlIattrs :: (Set.Set String)
+                          _tlIcopy :: Patterns 
+                          _tlIsem_lhs :: ([PP_Doc])
+                          -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                          _lhsOattrs =
+                              ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                               _hdIattrs `Set.union` _tlIattrs
+                               {-# LINE 3489 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- use rule "ExecutionPlan2Hs.ag"(line 424, column 29)
+                          _lhsOsem_lhs =
+                              ({-# LINE 424 "ExecutionPlan2Hs.ag" #-}
+                               _hdIsem_lhs : _tlIsem_lhs
+                               {-# LINE 3495 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- self rule
+                          _copy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               (:) _hdIcopy _tlIcopy
+                               {-# LINE 3501 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOcopy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               _copy
+                               {-# LINE 3507 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOaddtilde =
+                              ({-# LINE 425 "ExecutionPlan2Hs.ag" #-}
+                               _lhsIaddtilde
+                               {-# LINE 3513 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOaddtilde =
+                              ({-# LINE 425 "ExecutionPlan2Hs.ag" #-}
+                               _lhsIaddtilde
+                               {-# LINE 3519 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          ( _hdIattrs,_hdIcopy,_hdIsem_lhs) =
+                              hd_ _hdOaddtilde 
+                          ( _tlIattrs,_tlIcopy,_tlIsem_lhs) =
+                              tl_ _tlOaddtilde 
+                      in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+sem_Patterns_Nil :: T_Patterns 
+sem_Patterns_Nil  =
+    (T_Patterns (\ _lhsIaddtilde ->
+                     (let _lhsOattrs :: (Set.Set String)
+                          _lhsOsem_lhs :: ([PP_Doc])
+                          _lhsOcopy :: Patterns 
+                          -- use rule "ExecutionPlan2Hs.ag"(line 427, column 36)
+                          _lhsOattrs =
+                              ({-# LINE 427 "ExecutionPlan2Hs.ag" #-}
+                               Set.empty
+                               {-# LINE 3536 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- use rule "ExecutionPlan2Hs.ag"(line 424, column 29)
+                          _lhsOsem_lhs =
+                              ({-# LINE 424 "ExecutionPlan2Hs.ag" #-}
+                               []
+                               {-# LINE 3542 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- self rule
+                          _copy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               []
+                               {-# LINE 3548 "ExecutionPlan2Hs.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOcopy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               _copy
+                               {-# LINE 3554 "ExecutionPlan2Hs.hs" #-}
+                               )
+                      in  ( _lhsOattrs,_lhsOcopy,_lhsOsem_lhs))) )
+-- Visit -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         allintramap          : Map.Map StateIdentifier (Set.Set String)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         childintros          : Map.Map Identifier PP_Doc
+         inhmap               : Attributes
+         mrules               : Map.Map Identifier PP_Doc
+         nt                   : NontermIdent
+         options              : Options
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+         synmap               : Attributes
+         terminaldefs         : Set.Set String
+      synthesized attributes:
+         allvisits            :  VisitStateState 
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         intramap             : Map.Map StateIdentifier (Set.Set String)
+         sem_visit            :   (StateIdentifier,PP_Doc)  
+         t_visits             : PP_Doc
+         usedrules            : Set.Set Identifier
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative Visit:
+         child ident          : {VisitIdentifier}
+         child from           : {StateIdentifier}
+         child to             : {StateIdentifier}
+         child inh            : {Set.Set Identifier}
+         child syn            : {Set.Set Identifier}
+         child steps          : VisitSteps 
+         visit 0:
+            local inhpart     : _
+            local synpart     : _
+            local inhargs     : _
+            local synargs     : _
+            local nextargs    : _
+            local sem_steps   : _
+            local addbang     : _
+            local nextintra   : _
+            local uses        : _
+            local defs        : _
+-}
+-- cata
+sem_Visit :: Visit  ->
+             T_Visit 
+sem_Visit (Visit _ident _from _to _inh _syn _steps )  =
+    (sem_Visit_Visit _ident _from _to _inh _syn (sem_VisitSteps _steps ) )
+-- semantic domain
+newtype T_Visit  = T_Visit ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                            (Map.Map StateIdentifier (Set.Set String)) ->
+                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                            (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                            (Map.Map Identifier PP_Doc) ->
+                            Attributes ->
+                            (Map.Map Identifier PP_Doc) ->
+                            NontermIdent ->
+                            Options ->
+                            (Map.Map Identifier (Set.Set String)) ->
+                            (Map.Map Identifier (Set.Set String)) ->
+                            Attributes ->
+                            (Set.Set String) ->
+                            ( ( VisitStateState ),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(Map.Map StateIdentifier (Set.Set String)),(  (StateIdentifier,PP_Doc)  ),PP_Doc,(Set.Set Identifier),(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_Visit  = Inh_Visit {allchildvisit_Inh_Visit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allintramap_Inh_Visit :: (Map.Map StateIdentifier (Set.Set String)),avisitdefs_Inh_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_Visit :: (Map.Map Identifier PP_Doc),inhmap_Inh_Visit :: Attributes,mrules_Inh_Visit :: (Map.Map Identifier PP_Doc),nt_Inh_Visit :: NontermIdent,options_Inh_Visit :: Options,ruledefs_Inh_Visit :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_Visit :: (Map.Map Identifier (Set.Set String)),synmap_Inh_Visit :: Attributes,terminaldefs_Inh_Visit :: (Set.Set String)}
+data Syn_Visit  = Syn_Visit {allvisits_Syn_Visit :: ( VisitStateState ),childvisit_Syn_Visit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),intramap_Syn_Visit :: (Map.Map StateIdentifier (Set.Set String)),sem_visit_Syn_Visit :: (  (StateIdentifier,PP_Doc)  ),t_visits_Syn_Visit :: PP_Doc,usedrules_Syn_Visit :: (Set.Set Identifier),visitdefs_Syn_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_Visit :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_Visit :: T_Visit  ->
+              Inh_Visit  ->
+              Syn_Visit 
+wrap_Visit (T_Visit sem ) (Inh_Visit _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIoptions _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs )  =
+    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIoptions _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs 
+     in  (Syn_Visit _lhsOallvisits _lhsOchildvisit _lhsOintramap _lhsOsem_visit _lhsOt_visits _lhsOusedrules _lhsOvisitdefs _lhsOvisituses ))
+sem_Visit_Visit :: VisitIdentifier ->
+                   StateIdentifier ->
+                   StateIdentifier ->
+                   (Set.Set Identifier) ->
+                   (Set.Set Identifier) ->
+                   T_VisitSteps  ->
+                   T_Visit 
+sem_Visit_Visit ident_ from_ to_ inh_ syn_ (T_VisitSteps steps_ )  =
+    (T_Visit (\ _lhsIallchildvisit
+                _lhsIallintramap
+                _lhsIavisitdefs
+                _lhsIavisituses
+                _lhsIchildintros
+                _lhsIinhmap
+                _lhsImrules
+                _lhsInt
+                _lhsIoptions
+                _lhsIruledefs
+                _lhsIruleuses
+                _lhsIsynmap
+                _lhsIterminaldefs ->
+                  (let _lhsOallvisits :: ( VisitStateState )
+                       _lhsOt_visits :: PP_Doc
+                       _lhsOsem_visit :: (  (StateIdentifier,PP_Doc)  )
+                       _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                       _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
+                       _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                       _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                       _lhsOusedrules :: (Set.Set Identifier)
+                       _stepsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                       _stepsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                       _stepsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                       _stepsOchildintros :: (Map.Map Identifier PP_Doc)
+                       _stepsOmrules :: (Map.Map Identifier PP_Doc)
+                       _stepsOruledefs :: (Map.Map Identifier (Set.Set String))
+                       _stepsOruleuses :: (Map.Map Identifier (Set.Set String))
+                       _stepsIdefs :: (Set.Set String)
+                       _stepsIsem_steps :: PP_Doc
+                       _stepsIusedrules :: (Set.Set Identifier)
+                       _stepsIuses :: (Set.Set String)
+                       -- "ExecutionPlan2Hs.ag"(line 212, column 11)
+                       _lhsOallvisits =
+                           ({-# LINE 212 "ExecutionPlan2Hs.ag" #-}
+                            (ident_, from_, to_)
+                            {-# LINE 3675 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 262, column 11)
+                       _lhsOt_visits =
+                           ({-# LINE 262 "ExecutionPlan2Hs.ag" #-}
+                            "type" >#< "T_" >|< _lhsInt >|< "_v" >|< ident_ >#< "=" >#< _inhpart     >#<
+                               "Identity" >#< "(" >#< _synpart     >#< "T_" >|< _lhsInt >|< "_s" >|< to_ >#< ")"
+                            {-# LINE 3682 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 264, column 11)
+                       _inhpart =
+                           ({-# LINE 264 "ExecutionPlan2Hs.ag" #-}
+                            if   Set.null inh_
+                            then empty
+                            else (ppSpaced $ map (\i -> (\x -> pp_parens x >#< "->") $ typeToHaskellString (Just _lhsInt) []
+                                                  $ fromJust $ Map.lookup i _lhsIinhmap) $ Set.toList inh_)
+                            {-# LINE 3691 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 268, column 11)
+                       _synpart =
+                           ({-# LINE 268 "ExecutionPlan2Hs.ag" #-}
+                            if   Set.null syn_
+                            then empty
+                            else (ppCommas $ map (\i -> typeToHaskellString (Just _lhsInt) [] $ fromJust $ Map.lookup i _lhsIsynmap) $ Set.toList syn_) >#< ","
+                            {-# LINE 3699 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 364, column 11)
+                       _lhsOsem_visit =
+                           ({-# LINE 364 "ExecutionPlan2Hs.ag" #-}
+                            (from_, "v" >|< ident_ >#< "::" >#< "T_" >|< _lhsInt >|< "_v" >|< ident_
+                                    >-< "v" >|< ident_ >#< (_inhargs     _LHS True) >#< "=" >#< "do"
+                                    >-< indent 3 _sem_steps    )
+                            {-# LINE 3707 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 367, column 11)
+                       _inhargs =
+                           ({-# LINE 367 "ExecutionPlan2Hs.ag" #-}
+                            \chn inh -> ppSpaced $ map (\arg -> attrname inh chn arg) $ Set.toList inh_
+                            {-# LINE 3713 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 368, column 11)
+                       _synargs =
+                           ({-# LINE 368 "ExecutionPlan2Hs.ag" #-}
+                            ppSpaced $ map (\arg -> attrname False _LHS arg >#< ",") $ Set.toList syn_
+                            {-# LINE 3719 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 369, column 11)
+                       _nextargs =
+                           ({-# LINE 369 "ExecutionPlan2Hs.ag" #-}
+                            ppSpaced $ Set.toList $ maybe Set.empty id $ Map.lookup to_ _lhsIallintramap
+                            {-# LINE 3725 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 370, column 11)
+                       _sem_steps =
+                           ({-# LINE 370 "ExecutionPlan2Hs.ag" #-}
+                            _stepsIsem_steps
+                            >-< "return" >#< "(" >#< _synargs     >#< "st" >|< to_ >#< _nextargs     >#< ")"
+                            {-# LINE 3732 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 466, column 11)
+                       _lhsOchildvisit =
+                           ({-# LINE 466 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton ident_ $ \chn -> _addbang     ("(" >#< ppSpaced (
+                               map (\x -> attrname True chn x >#< ",") $ Set.toList syn_) >#< locname chn
+                            >#< ")") >#< "<-" >#< "inv_" >|< _lhsInt >|< "_s" >|< from_ >#< locname chn
+                            >#< "K_" >|< _lhsInt >|< "_v" >|< ident_ >#< _inhargs     chn False
+                            {-# LINE 3741 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 470, column 11)
+                       _addbang =
+                           ({-# LINE 470 "ExecutionPlan2Hs.ag" #-}
+                            \x -> if bangpats _lhsIoptions then "!" >|< x else x
+                            {-# LINE 3747 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 495, column 11)
+                       _lhsOintramap =
+                           ({-# LINE 495 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton from_ $ (_uses     `Set.union` _nextintra    ) `Set.difference` _defs
+                            {-# LINE 3753 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 496, column 11)
+                       _nextintra =
+                           ({-# LINE 496 "ExecutionPlan2Hs.ag" #-}
+                            maybe Set.empty id $ Map.lookup to_ _lhsIallintramap
+                            {-# LINE 3759 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 497, column 11)
+                       _uses =
+                           ({-# LINE 497 "ExecutionPlan2Hs.ag" #-}
+                            _stepsIuses
+                            {-# LINE 3765 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 498, column 11)
+                       _defs =
+                           ({-# LINE 498 "ExecutionPlan2Hs.ag" #-}
+                            _stepsIdefs `Set.union` (Set.map (lhsname True) inh_) `Set.union` _lhsIterminaldefs
+                            {-# LINE 3771 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 522, column 11)
+                       _lhsOvisitdefs =
+                           ({-# LINE 522 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton ident_ syn_
+                            {-# LINE 3777 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- "ExecutionPlan2Hs.ag"(line 523, column 11)
+                       _lhsOvisituses =
+                           ({-# LINE 523 "ExecutionPlan2Hs.ag" #-}
+                            Map.singleton ident_ inh_
+                            {-# LINE 3783 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                       _lhsOusedrules =
+                           ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                            _stepsIusedrules
+                            {-# LINE 3789 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOallchildvisit =
+                           ({-# LINE 460 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIallchildvisit
+                            {-# LINE 3795 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOavisitdefs =
+                           ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIavisitdefs
+                            {-# LINE 3801 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOavisituses =
+                           ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIavisituses
+                            {-# LINE 3807 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOchildintros =
+                           ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIchildintros
+                            {-# LINE 3813 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOmrules =
+                           ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                            _lhsImrules
+                            {-# LINE 3819 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOruledefs =
+                           ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIruledefs
+                            {-# LINE 3825 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _stepsOruleuses =
+                           ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                            _lhsIruleuses
+                            {-# LINE 3831 "ExecutionPlan2Hs.hs" #-}
+                            )
+                       ( _stepsIdefs,_stepsIsem_steps,_stepsIusedrules,_stepsIuses) =
+                           steps_ _stepsOallchildvisit _stepsOavisitdefs _stepsOavisituses _stepsOchildintros _stepsOmrules _stepsOruledefs _stepsOruleuses 
+                   in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses))) )
+-- VisitStep ---------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         childintros          : Map.Map Identifier PP_Doc
+         mrules               : Map.Map Identifier PP_Doc
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+      synthesized attributes:
+         defs                 : Set.Set String
+         sem_steps            : PP_Doc
+         usedrules            : Set.Set Identifier
+         uses                 : Set.Set String
+   alternatives:
+      alternative ChildIntro:
+         child child          : {Identifier}
+      alternative ChildVisit:
+         child child          : {Identifier}
+         child nonterm        : {NontermIdent}
+         child visit          : {VisitIdentifier}
+      alternative Sem:
+         child name           : {Identifier}
+      alternative Sim:
+         child steps          : VisitSteps 
+-}
+-- cata
+sem_VisitStep :: VisitStep  ->
+                 T_VisitStep 
+sem_VisitStep (ChildIntro _child )  =
+    (sem_VisitStep_ChildIntro _child )
+sem_VisitStep (ChildVisit _child _nonterm _visit )  =
+    (sem_VisitStep_ChildVisit _child _nonterm _visit )
+sem_VisitStep (Sem _name )  =
+    (sem_VisitStep_Sem _name )
+sem_VisitStep (Sim _steps )  =
+    (sem_VisitStep_Sim (sem_VisitSteps _steps ) )
+-- semantic domain
+newtype T_VisitStep  = T_VisitStep ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                    (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                    (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                    (Map.Map Identifier PP_Doc) ->
+                                    (Map.Map Identifier PP_Doc) ->
+                                    (Map.Map Identifier (Set.Set String)) ->
+                                    (Map.Map Identifier (Set.Set String)) ->
+                                    ( (Set.Set String),PP_Doc,(Set.Set Identifier),(Set.Set String)))
+data Inh_VisitStep  = Inh_VisitStep {allchildvisit_Inh_VisitStep :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_VisitStep :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_VisitStep :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_VisitStep :: (Map.Map Identifier PP_Doc),mrules_Inh_VisitStep :: (Map.Map Identifier PP_Doc),ruledefs_Inh_VisitStep :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_VisitStep :: (Map.Map Identifier (Set.Set String))}
+data Syn_VisitStep  = Syn_VisitStep {defs_Syn_VisitStep :: (Set.Set String),sem_steps_Syn_VisitStep :: PP_Doc,usedrules_Syn_VisitStep :: (Set.Set Identifier),uses_Syn_VisitStep :: (Set.Set String)}
+wrap_VisitStep :: T_VisitStep  ->
+                  Inh_VisitStep  ->
+                  Syn_VisitStep 
+wrap_VisitStep (T_VisitStep sem ) (Inh_VisitStep _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses )  =
+    (let ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses 
+     in  (Syn_VisitStep _lhsOdefs _lhsOsem_steps _lhsOusedrules _lhsOuses ))
+sem_VisitStep_ChildIntro :: Identifier ->
+                            T_VisitStep 
+sem_VisitStep_ChildIntro child_  =
+    (T_VisitStep (\ _lhsIallchildvisit
+                    _lhsIavisitdefs
+                    _lhsIavisituses
+                    _lhsIchildintros
+                    _lhsImrules
+                    _lhsIruledefs
+                    _lhsIruleuses ->
+                      (let _lhsOsem_steps :: PP_Doc
+                           _lhsOdefs :: (Set.Set String)
+                           _lhsOusedrules :: (Set.Set Identifier)
+                           _lhsOuses :: (Set.Set String)
+                           -- "ExecutionPlan2Hs.ag"(line 377, column 16)
+                           _lhsOsem_steps =
+                               ({-# LINE 377 "ExecutionPlan2Hs.ag" #-}
+                                maybe  (error $ "Child " ++ show child_ ++ " not found") id $ Map.lookup child_ _lhsIchildintros
+                                {-# LINE 3910 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 540, column 16)
+                           _lhsOdefs =
+                               ({-# LINE 540 "ExecutionPlan2Hs.ag" #-}
+                                Set.singleton $ locname child_
+                                {-# LINE 3916 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                           _lhsOusedrules =
+                               ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                                Set.empty
+                                {-# LINE 3922 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 536, column 38)
+                           _lhsOuses =
+                               ({-# LINE 536 "ExecutionPlan2Hs.ag" #-}
+                                Set.empty
+                                {-# LINE 3928 "ExecutionPlan2Hs.hs" #-}
+                                )
+                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+sem_VisitStep_ChildVisit :: Identifier ->
+                            NontermIdent ->
+                            VisitIdentifier ->
+                            T_VisitStep 
+sem_VisitStep_ChildVisit child_ nonterm_ visit_  =
+    (T_VisitStep (\ _lhsIallchildvisit
+                    _lhsIavisitdefs
+                    _lhsIavisituses
+                    _lhsIchildintros
+                    _lhsImrules
+                    _lhsIruledefs
+                    _lhsIruleuses ->
+                      (let _lhsOsem_steps :: PP_Doc
+                           _lhsOdefs :: (Set.Set String)
+                           _lhsOuses :: (Set.Set String)
+                           _lhsOusedrules :: (Set.Set Identifier)
+                           -- "ExecutionPlan2Hs.ag"(line 378, column 16)
+                           _lhsOsem_steps =
+                               ({-# LINE 378 "ExecutionPlan2Hs.ag" #-}
+                                (maybe (error $ "Visit " ++ show visit_ ++ " not found") id $ Map.lookup visit_ _lhsIallchildvisit) $ child_
+                                {-# LINE 3951 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 541, column 16)
+                           _lhsOdefs =
+                               ({-# LINE 541 "ExecutionPlan2Hs.ag" #-}
+                                maybe (error "Visit not found") (Set.map $ attrname True child_) $ Map.lookup visit_ _lhsIavisitdefs
+                                {-# LINE 3957 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 542, column 16)
+                           _lhsOuses =
+                               ({-# LINE 542 "ExecutionPlan2Hs.ag" #-}
+                                Set.insert (locname child_) $
+                                   maybe (error "Visit not found") (Set.map $ attrname False child_) $ Map.lookup visit_ _lhsIavisituses
+                                {-# LINE 3964 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                           _lhsOusedrules =
+                               ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                                Set.empty
+                                {-# LINE 3970 "ExecutionPlan2Hs.hs" #-}
+                                )
+                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+sem_VisitStep_Sem :: Identifier ->
+                     T_VisitStep 
+sem_VisitStep_Sem name_  =
+    (T_VisitStep (\ _lhsIallchildvisit
+                    _lhsIavisitdefs
+                    _lhsIavisituses
+                    _lhsIchildintros
+                    _lhsImrules
+                    _lhsIruledefs
+                    _lhsIruleuses ->
+                      (let _lhsOsem_steps :: PP_Doc
+                           _lhsOusedrules :: (Set.Set Identifier)
+                           _lhsOdefs :: (Set.Set String)
+                           _lhsOuses :: (Set.Set String)
+                           -- "ExecutionPlan2Hs.ag"(line 376, column 16)
+                           _lhsOsem_steps =
+                               ({-# LINE 376 "ExecutionPlan2Hs.ag" #-}
+                                maybe  (error $ "Rule "  ++ show name_  ++ " not found") id $ Map.lookup name_  _lhsImrules
+                                {-# LINE 3991 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 400, column 9)
+                           _lhsOusedrules =
+                               ({-# LINE 400 "ExecutionPlan2Hs.ag" #-}
+                                Set.singleton name_
+                                {-# LINE 3997 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 538, column 16)
+                           _lhsOdefs =
+                               ({-# LINE 538 "ExecutionPlan2Hs.ag" #-}
+                                maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruledefs
+                                {-# LINE 4003 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- "ExecutionPlan2Hs.ag"(line 539, column 16)
+                           _lhsOuses =
+                               ({-# LINE 539 "ExecutionPlan2Hs.ag" #-}
+                                maybe (error "Rule not found") id $ Map.lookup name_ _lhsIruleuses
+                                {-# LINE 4009 "ExecutionPlan2Hs.hs" #-}
+                                )
+                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+sem_VisitStep_Sim :: T_VisitSteps  ->
+                     T_VisitStep 
+sem_VisitStep_Sim (T_VisitSteps steps_ )  =
+    (T_VisitStep (\ _lhsIallchildvisit
+                    _lhsIavisitdefs
+                    _lhsIavisituses
+                    _lhsIchildintros
+                    _lhsImrules
+                    _lhsIruledefs
+                    _lhsIruleuses ->
+                      (let _lhsOdefs :: (Set.Set String)
+                           _lhsOsem_steps :: PP_Doc
+                           _lhsOusedrules :: (Set.Set Identifier)
+                           _lhsOuses :: (Set.Set String)
+                           _stepsOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                           _stepsOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                           _stepsOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                           _stepsOchildintros :: (Map.Map Identifier PP_Doc)
+                           _stepsOmrules :: (Map.Map Identifier PP_Doc)
+                           _stepsOruledefs :: (Map.Map Identifier (Set.Set String))
+                           _stepsOruleuses :: (Map.Map Identifier (Set.Set String))
+                           _stepsIdefs :: (Set.Set String)
+                           _stepsIsem_steps :: PP_Doc
+                           _stepsIusedrules :: (Set.Set Identifier)
+                           _stepsIuses :: (Set.Set String)
+                           -- use rule "ExecutionPlan2Hs.ag"(line 535, column 38)
+                           _lhsOdefs =
+                               ({-# LINE 535 "ExecutionPlan2Hs.ag" #-}
+                                _stepsIdefs
+                                {-# LINE 4041 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 374, column 43)
+                           _lhsOsem_steps =
+                               ({-# LINE 374 "ExecutionPlan2Hs.ag" #-}
+                                _stepsIsem_steps
+                                {-# LINE 4047 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                           _lhsOusedrules =
+                               ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                                _stepsIusedrules
+                                {-# LINE 4053 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- use rule "ExecutionPlan2Hs.ag"(line 536, column 38)
+                           _lhsOuses =
+                               ({-# LINE 536 "ExecutionPlan2Hs.ag" #-}
+                                _stepsIuses
+                                {-# LINE 4059 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOallchildvisit =
+                               ({-# LINE 460 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIallchildvisit
+                                {-# LINE 4065 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOavisitdefs =
+                               ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIavisitdefs
+                                {-# LINE 4071 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOavisituses =
+                               ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIavisituses
+                                {-# LINE 4077 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOchildintros =
+                               ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIchildintros
+                                {-# LINE 4083 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOmrules =
+                               ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                                _lhsImrules
+                                {-# LINE 4089 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOruledefs =
+                               ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIruledefs
+                                {-# LINE 4095 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           -- copy rule (down)
+                           _stepsOruleuses =
+                               ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                                _lhsIruleuses
+                                {-# LINE 4101 "ExecutionPlan2Hs.hs" #-}
+                                )
+                           ( _stepsIdefs,_stepsIsem_steps,_stepsIusedrules,_stepsIuses) =
+                               steps_ _stepsOallchildvisit _stepsOavisitdefs _stepsOavisituses _stepsOchildintros _stepsOmrules _stepsOruledefs _stepsOruleuses 
+                       in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+-- VisitSteps --------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         childintros          : Map.Map Identifier PP_Doc
+         mrules               : Map.Map Identifier PP_Doc
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+      synthesized attributes:
+         defs                 : Set.Set String
+         sem_steps            : PP_Doc
+         usedrules            : Set.Set Identifier
+         uses                 : Set.Set String
+   alternatives:
+      alternative Cons:
+         child hd             : VisitStep 
+         child tl             : VisitSteps 
+      alternative Nil:
+-}
+-- cata
+sem_VisitSteps :: VisitSteps  ->
+                  T_VisitSteps 
+sem_VisitSteps list  =
+    (Prelude.foldr sem_VisitSteps_Cons sem_VisitSteps_Nil (Prelude.map sem_VisitStep list) )
+-- semantic domain
+newtype T_VisitSteps  = T_VisitSteps ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                                      (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                      (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                                      (Map.Map Identifier PP_Doc) ->
+                                      (Map.Map Identifier PP_Doc) ->
+                                      (Map.Map Identifier (Set.Set String)) ->
+                                      (Map.Map Identifier (Set.Set String)) ->
+                                      ( (Set.Set String),PP_Doc,(Set.Set Identifier),(Set.Set String)))
+data Inh_VisitSteps  = Inh_VisitSteps {allchildvisit_Inh_VisitSteps :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),avisitdefs_Inh_VisitSteps :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_VisitSteps :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_VisitSteps :: (Map.Map Identifier PP_Doc),mrules_Inh_VisitSteps :: (Map.Map Identifier PP_Doc),ruledefs_Inh_VisitSteps :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_VisitSteps :: (Map.Map Identifier (Set.Set String))}
+data Syn_VisitSteps  = Syn_VisitSteps {defs_Syn_VisitSteps :: (Set.Set String),sem_steps_Syn_VisitSteps :: PP_Doc,usedrules_Syn_VisitSteps :: (Set.Set Identifier),uses_Syn_VisitSteps :: (Set.Set String)}
+wrap_VisitSteps :: T_VisitSteps  ->
+                   Inh_VisitSteps  ->
+                   Syn_VisitSteps 
+wrap_VisitSteps (T_VisitSteps sem ) (Inh_VisitSteps _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses )  =
+    (let ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses) = sem _lhsIallchildvisit _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsImrules _lhsIruledefs _lhsIruleuses 
+     in  (Syn_VisitSteps _lhsOdefs _lhsOsem_steps _lhsOusedrules _lhsOuses ))
+sem_VisitSteps_Cons :: T_VisitStep  ->
+                       T_VisitSteps  ->
+                       T_VisitSteps 
+sem_VisitSteps_Cons (T_VisitStep hd_ ) (T_VisitSteps tl_ )  =
+    (T_VisitSteps (\ _lhsIallchildvisit
+                     _lhsIavisitdefs
+                     _lhsIavisituses
+                     _lhsIchildintros
+                     _lhsImrules
+                     _lhsIruledefs
+                     _lhsIruleuses ->
+                       (let _lhsOdefs :: (Set.Set String)
+                            _lhsOsem_steps :: PP_Doc
+                            _lhsOusedrules :: (Set.Set Identifier)
+                            _lhsOuses :: (Set.Set String)
+                            _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                            _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                            _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                            _hdOchildintros :: (Map.Map Identifier PP_Doc)
+                            _hdOmrules :: (Map.Map Identifier PP_Doc)
+                            _hdOruledefs :: (Map.Map Identifier (Set.Set String))
+                            _hdOruleuses :: (Map.Map Identifier (Set.Set String))
+                            _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                            _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                            _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                            _tlOchildintros :: (Map.Map Identifier PP_Doc)
+                            _tlOmrules :: (Map.Map Identifier PP_Doc)
+                            _tlOruledefs :: (Map.Map Identifier (Set.Set String))
+                            _tlOruleuses :: (Map.Map Identifier (Set.Set String))
+                            _hdIdefs :: (Set.Set String)
+                            _hdIsem_steps :: PP_Doc
+                            _hdIusedrules :: (Set.Set Identifier)
+                            _hdIuses :: (Set.Set String)
+                            _tlIdefs :: (Set.Set String)
+                            _tlIsem_steps :: PP_Doc
+                            _tlIusedrules :: (Set.Set Identifier)
+                            _tlIuses :: (Set.Set String)
+                            -- use rule "ExecutionPlan2Hs.ag"(line 535, column 38)
+                            _lhsOdefs =
+                                ({-# LINE 535 "ExecutionPlan2Hs.ag" #-}
+                                 _hdIdefs `Set.union` _tlIdefs
+                                 {-# LINE 4191 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 374, column 43)
+                            _lhsOsem_steps =
+                                ({-# LINE 374 "ExecutionPlan2Hs.ag" #-}
+                                 _hdIsem_steps >-< _tlIsem_steps
+                                 {-# LINE 4197 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                            _lhsOusedrules =
+                                ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                                 _hdIusedrules `Set.union` _tlIusedrules
+                                 {-# LINE 4203 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 536, column 38)
+                            _lhsOuses =
+                                ({-# LINE 536 "ExecutionPlan2Hs.ag" #-}
+                                 _hdIuses `Set.union` _tlIuses
+                                 {-# LINE 4209 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOallchildvisit =
+                                ({-# LINE 460 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIallchildvisit
+                                 {-# LINE 4215 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOavisitdefs =
+                                ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIavisitdefs
+                                 {-# LINE 4221 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOavisituses =
+                                ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIavisituses
+                                 {-# LINE 4227 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOchildintros =
+                                ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIchildintros
+                                 {-# LINE 4233 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOmrules =
+                                ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsImrules
+                                 {-# LINE 4239 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOruledefs =
+                                ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIruledefs
+                                 {-# LINE 4245 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _hdOruleuses =
+                                ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIruleuses
+                                 {-# LINE 4251 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOallchildvisit =
+                                ({-# LINE 460 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIallchildvisit
+                                 {-# LINE 4257 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOavisitdefs =
+                                ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIavisitdefs
+                                 {-# LINE 4263 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOavisituses =
+                                ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIavisituses
+                                 {-# LINE 4269 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOchildintros =
+                                ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIchildintros
+                                 {-# LINE 4275 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOmrules =
+                                ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsImrules
+                                 {-# LINE 4281 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOruledefs =
+                                ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIruledefs
+                                 {-# LINE 4287 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _tlOruleuses =
+                                ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                                 _lhsIruleuses
+                                 {-# LINE 4293 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            ( _hdIdefs,_hdIsem_steps,_hdIusedrules,_hdIuses) =
+                                hd_ _hdOallchildvisit _hdOavisitdefs _hdOavisituses _hdOchildintros _hdOmrules _hdOruledefs _hdOruleuses 
+                            ( _tlIdefs,_tlIsem_steps,_tlIusedrules,_tlIuses) =
+                                tl_ _tlOallchildvisit _tlOavisitdefs _tlOavisituses _tlOchildintros _tlOmrules _tlOruledefs _tlOruleuses 
+                        in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+sem_VisitSteps_Nil :: T_VisitSteps 
+sem_VisitSteps_Nil  =
+    (T_VisitSteps (\ _lhsIallchildvisit
+                     _lhsIavisitdefs
+                     _lhsIavisituses
+                     _lhsIchildintros
+                     _lhsImrules
+                     _lhsIruledefs
+                     _lhsIruleuses ->
+                       (let _lhsOdefs :: (Set.Set String)
+                            _lhsOsem_steps :: PP_Doc
+                            _lhsOusedrules :: (Set.Set Identifier)
+                            _lhsOuses :: (Set.Set String)
+                            -- use rule "ExecutionPlan2Hs.ag"(line 535, column 38)
+                            _lhsOdefs =
+                                ({-# LINE 535 "ExecutionPlan2Hs.ag" #-}
+                                 Set.empty
+                                 {-# LINE 4317 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 374, column 43)
+                            _lhsOsem_steps =
+                                ({-# LINE 374 "ExecutionPlan2Hs.ag" #-}
+                                 empty
+                                 {-# LINE 4323 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                            _lhsOusedrules =
+                                ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                                 Set.empty
+                                 {-# LINE 4329 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                            -- use rule "ExecutionPlan2Hs.ag"(line 536, column 38)
+                            _lhsOuses =
+                                ({-# LINE 536 "ExecutionPlan2Hs.ag" #-}
+                                 Set.empty
+                                 {-# LINE 4335 "ExecutionPlan2Hs.hs" #-}
+                                 )
+                        in  ( _lhsOdefs,_lhsOsem_steps,_lhsOusedrules,_lhsOuses))) )
+-- Visits ------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allchildvisit        : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         allintramap          : Map.Map StateIdentifier (Set.Set String)
+         avisitdefs           : Map.Map VisitIdentifier (Set.Set Identifier)
+         avisituses           : Map.Map VisitIdentifier (Set.Set Identifier)
+         childintros          : Map.Map Identifier PP_Doc
+         inhmap               : Attributes
+         mrules               : Map.Map Identifier PP_Doc
+         nt                   : NontermIdent
+         options              : Options
+         ruledefs             : Map.Map Identifier (Set.Set String)
+         ruleuses             : Map.Map Identifier (Set.Set String)
+         synmap               : Attributes
+         terminaldefs         : Set.Set String
+      synthesized attributes:
+         allvisits            : [VisitStateState]
+         childvisit           : Map.Map VisitIdentifier (Identifier -> PP_Doc)
+         intramap             : Map.Map StateIdentifier (Set.Set String)
+         sem_visit            :  [(StateIdentifier,PP_Doc)] 
+         t_visits             : PP_Doc
+         usedrules            : Set.Set Identifier
+         visitdefs            : Map.Map VisitIdentifier (Set.Set Identifier)
+         visituses            : Map.Map VisitIdentifier (Set.Set Identifier)
+   alternatives:
+      alternative Cons:
+         child hd             : Visit 
+         child tl             : Visits 
+      alternative Nil:
+-}
+-- cata
+sem_Visits :: Visits  ->
+              T_Visits 
+sem_Visits list  =
+    (Prelude.foldr sem_Visits_Cons sem_Visits_Nil (Prelude.map sem_Visit list) )
+-- semantic domain
+newtype T_Visits  = T_Visits ((Map.Map VisitIdentifier (Identifier -> PP_Doc)) ->
+                              (Map.Map StateIdentifier (Set.Set String)) ->
+                              (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                              (Map.Map VisitIdentifier (Set.Set Identifier)) ->
+                              (Map.Map Identifier PP_Doc) ->
+                              Attributes ->
+                              (Map.Map Identifier PP_Doc) ->
+                              NontermIdent ->
+                              Options ->
+                              (Map.Map Identifier (Set.Set String)) ->
+                              (Map.Map Identifier (Set.Set String)) ->
+                              Attributes ->
+                              (Set.Set String) ->
+                              ( ([VisitStateState]),(Map.Map VisitIdentifier (Identifier -> PP_Doc)),(Map.Map StateIdentifier (Set.Set String)),( [(StateIdentifier,PP_Doc)] ),PP_Doc,(Set.Set Identifier),(Map.Map VisitIdentifier (Set.Set Identifier)),(Map.Map VisitIdentifier (Set.Set Identifier))))
+data Inh_Visits  = Inh_Visits {allchildvisit_Inh_Visits :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),allintramap_Inh_Visits :: (Map.Map StateIdentifier (Set.Set String)),avisitdefs_Inh_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),avisituses_Inh_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),childintros_Inh_Visits :: (Map.Map Identifier PP_Doc),inhmap_Inh_Visits :: Attributes,mrules_Inh_Visits :: (Map.Map Identifier PP_Doc),nt_Inh_Visits :: NontermIdent,options_Inh_Visits :: Options,ruledefs_Inh_Visits :: (Map.Map Identifier (Set.Set String)),ruleuses_Inh_Visits :: (Map.Map Identifier (Set.Set String)),synmap_Inh_Visits :: Attributes,terminaldefs_Inh_Visits :: (Set.Set String)}
+data Syn_Visits  = Syn_Visits {allvisits_Syn_Visits :: ([VisitStateState]),childvisit_Syn_Visits :: (Map.Map VisitIdentifier (Identifier -> PP_Doc)),intramap_Syn_Visits :: (Map.Map StateIdentifier (Set.Set String)),sem_visit_Syn_Visits :: ( [(StateIdentifier,PP_Doc)] ),t_visits_Syn_Visits :: PP_Doc,usedrules_Syn_Visits :: (Set.Set Identifier),visitdefs_Syn_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier)),visituses_Syn_Visits :: (Map.Map VisitIdentifier (Set.Set Identifier))}
+wrap_Visits :: T_Visits  ->
+               Inh_Visits  ->
+               Syn_Visits 
+wrap_Visits (T_Visits sem ) (Inh_Visits _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIoptions _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs )  =
+    (let ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses) = sem _lhsIallchildvisit _lhsIallintramap _lhsIavisitdefs _lhsIavisituses _lhsIchildintros _lhsIinhmap _lhsImrules _lhsInt _lhsIoptions _lhsIruledefs _lhsIruleuses _lhsIsynmap _lhsIterminaldefs 
+     in  (Syn_Visits _lhsOallvisits _lhsOchildvisit _lhsOintramap _lhsOsem_visit _lhsOt_visits _lhsOusedrules _lhsOvisitdefs _lhsOvisituses ))
+sem_Visits_Cons :: T_Visit  ->
+                   T_Visits  ->
+                   T_Visits 
+sem_Visits_Cons (T_Visit hd_ ) (T_Visits tl_ )  =
+    (T_Visits (\ _lhsIallchildvisit
+                 _lhsIallintramap
+                 _lhsIavisitdefs
+                 _lhsIavisituses
+                 _lhsIchildintros
+                 _lhsIinhmap
+                 _lhsImrules
+                 _lhsInt
+                 _lhsIoptions
+                 _lhsIruledefs
+                 _lhsIruleuses
+                 _lhsIsynmap
+                 _lhsIterminaldefs ->
+                   (let _lhsOallvisits :: ([VisitStateState])
+                        _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _lhsOsem_visit :: ( [(StateIdentifier,PP_Doc)] )
+                        _lhsOt_visits :: PP_Doc
+                        _lhsOusedrules :: (Set.Set Identifier)
+                        _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _hdOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _hdOallintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _hdOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _hdOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _hdOchildintros :: (Map.Map Identifier PP_Doc)
+                        _hdOinhmap :: Attributes
+                        _hdOmrules :: (Map.Map Identifier PP_Doc)
+                        _hdOnt :: NontermIdent
+                        _hdOoptions :: Options
+                        _hdOruledefs :: (Map.Map Identifier (Set.Set String))
+                        _hdOruleuses :: (Map.Map Identifier (Set.Set String))
+                        _hdOsynmap :: Attributes
+                        _hdOterminaldefs :: (Set.Set String)
+                        _tlOallchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _tlOallintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _tlOavisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _tlOavisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _tlOchildintros :: (Map.Map Identifier PP_Doc)
+                        _tlOinhmap :: Attributes
+                        _tlOmrules :: (Map.Map Identifier PP_Doc)
+                        _tlOnt :: NontermIdent
+                        _tlOoptions :: Options
+                        _tlOruledefs :: (Map.Map Identifier (Set.Set String))
+                        _tlOruleuses :: (Map.Map Identifier (Set.Set String))
+                        _tlOsynmap :: Attributes
+                        _tlOterminaldefs :: (Set.Set String)
+                        _hdIallvisits :: ( VisitStateState )
+                        _hdIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _hdIintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _hdIsem_visit :: (  (StateIdentifier,PP_Doc)  )
+                        _hdIt_visits :: PP_Doc
+                        _hdIusedrules :: (Set.Set Identifier)
+                        _hdIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _hdIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _tlIallvisits :: ([VisitStateState])
+                        _tlIchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _tlIintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _tlIsem_visit :: ( [(StateIdentifier,PP_Doc)] )
+                        _tlIt_visits :: PP_Doc
+                        _tlIusedrules :: (Set.Set Identifier)
+                        _tlIvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _tlIvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        -- use rule "ExecutionPlan2Hs.ag"(line 207, column 29)
+                        _lhsOallvisits =
+                            ({-# LINE 207 "ExecutionPlan2Hs.ag" #-}
+                             _hdIallvisits : _tlIallvisits
+                             {-# LINE 4469 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                        _lhsOchildvisit =
+                            ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                             _hdIchildvisit `Map.union` _tlIchildvisit
+                             {-# LINE 4475 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 480, column 34)
+                        _lhsOintramap =
+                            ({-# LINE 480 "ExecutionPlan2Hs.ag" #-}
+                             _hdIintramap `uwSetUnion` _tlIintramap
+                             {-# LINE 4481 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 361, column 29)
+                        _lhsOsem_visit =
+                            ({-# LINE 361 "ExecutionPlan2Hs.ag" #-}
+                             _hdIsem_visit : _tlIsem_visit
+                             {-# LINE 4487 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 253, column 54)
+                        _lhsOt_visits =
+                            ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                             _hdIt_visits >-< _tlIt_visits
+                             {-# LINE 4493 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                        _lhsOusedrules =
+                            ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                             _hdIusedrules `Set.union` _tlIusedrules
+                             {-# LINE 4499 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                        _lhsOvisitdefs =
+                            ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                             _hdIvisitdefs `uwSetUnion` _tlIvisitdefs
+                             {-# LINE 4505 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                        _lhsOvisituses =
+                            ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                             _hdIvisituses `uwSetUnion` _tlIvisituses
+                             {-# LINE 4511 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOallchildvisit =
+                            ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIallchildvisit
+                             {-# LINE 4517 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOallintramap =
+                            ({-# LINE 479 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIallintramap
+                             {-# LINE 4523 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOavisitdefs =
+                            ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIavisitdefs
+                             {-# LINE 4529 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOavisituses =
+                            ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIavisituses
+                             {-# LINE 4535 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOchildintros =
+                            ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIchildintros
+                             {-# LINE 4541 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOinhmap =
+                            ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIinhmap
+                             {-# LINE 4547 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOmrules =
+                            ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                             _lhsImrules
+                             {-# LINE 4553 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOnt =
+                            ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                             _lhsInt
+                             {-# LINE 4559 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOoptions =
+                            ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIoptions
+                             {-# LINE 4565 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOruledefs =
+                            ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIruledefs
+                             {-# LINE 4571 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOruleuses =
+                            ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIruleuses
+                             {-# LINE 4577 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOsynmap =
+                            ({-# LINE 195 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIsynmap
+                             {-# LINE 4583 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _hdOterminaldefs =
+                            ({-# LINE 482 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIterminaldefs
+                             {-# LINE 4589 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOallchildvisit =
+                            ({-# LINE 457 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIallchildvisit
+                             {-# LINE 4595 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOallintramap =
+                            ({-# LINE 479 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIallintramap
+                             {-# LINE 4601 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOavisitdefs =
+                            ({-# LINE 528 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIavisitdefs
+                             {-# LINE 4607 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOavisituses =
+                            ({-# LINE 529 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIavisituses
+                             {-# LINE 4613 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOchildintros =
+                            ({-# LINE 384 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIchildintros
+                             {-# LINE 4619 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOinhmap =
+                            ({-# LINE 194 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIinhmap
+                             {-# LINE 4625 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOmrules =
+                            ({-# LINE 373 "ExecutionPlan2Hs.ag" #-}
+                             _lhsImrules
+                             {-# LINE 4631 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOnt =
+                            ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                             _lhsInt
+                             {-# LINE 4637 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOoptions =
+                            ({-# LINE 41 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIoptions
+                             {-# LINE 4643 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOruledefs =
+                            ({-# LINE 503 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIruledefs
+                             {-# LINE 4649 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOruleuses =
+                            ({-# LINE 504 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIruleuses
+                             {-# LINE 4655 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOsynmap =
+                            ({-# LINE 195 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIsynmap
+                             {-# LINE 4661 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _tlOterminaldefs =
+                            ({-# LINE 482 "ExecutionPlan2Hs.ag" #-}
+                             _lhsIterminaldefs
+                             {-# LINE 4667 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        ( _hdIallvisits,_hdIchildvisit,_hdIintramap,_hdIsem_visit,_hdIt_visits,_hdIusedrules,_hdIvisitdefs,_hdIvisituses) =
+                            hd_ _hdOallchildvisit _hdOallintramap _hdOavisitdefs _hdOavisituses _hdOchildintros _hdOinhmap _hdOmrules _hdOnt _hdOoptions _hdOruledefs _hdOruleuses _hdOsynmap _hdOterminaldefs 
+                        ( _tlIallvisits,_tlIchildvisit,_tlIintramap,_tlIsem_visit,_tlIt_visits,_tlIusedrules,_tlIvisitdefs,_tlIvisituses) =
+                            tl_ _tlOallchildvisit _tlOallintramap _tlOavisitdefs _tlOavisituses _tlOchildintros _tlOinhmap _tlOmrules _tlOnt _tlOoptions _tlOruledefs _tlOruleuses _tlOsynmap _tlOterminaldefs 
+                    in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses))) )
+sem_Visits_Nil :: T_Visits 
+sem_Visits_Nil  =
+    (T_Visits (\ _lhsIallchildvisit
+                 _lhsIallintramap
+                 _lhsIavisitdefs
+                 _lhsIavisituses
+                 _lhsIchildintros
+                 _lhsIinhmap
+                 _lhsImrules
+                 _lhsInt
+                 _lhsIoptions
+                 _lhsIruledefs
+                 _lhsIruleuses
+                 _lhsIsynmap
+                 _lhsIterminaldefs ->
+                   (let _lhsOallvisits :: ([VisitStateState])
+                        _lhsOchildvisit :: (Map.Map VisitIdentifier (Identifier -> PP_Doc))
+                        _lhsOintramap :: (Map.Map StateIdentifier (Set.Set String))
+                        _lhsOsem_visit :: ( [(StateIdentifier,PP_Doc)] )
+                        _lhsOt_visits :: PP_Doc
+                        _lhsOusedrules :: (Set.Set Identifier)
+                        _lhsOvisitdefs :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        _lhsOvisituses :: (Map.Map VisitIdentifier (Set.Set Identifier))
+                        -- use rule "ExecutionPlan2Hs.ag"(line 207, column 29)
+                        _lhsOallvisits =
+                            ({-# LINE 207 "ExecutionPlan2Hs.ag" #-}
+                             []
+                             {-# LINE 4701 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 458, column 37)
+                        _lhsOchildvisit =
+                            ({-# LINE 458 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 4707 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 480, column 34)
+                        _lhsOintramap =
+                            ({-# LINE 480 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 4713 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 361, column 29)
+                        _lhsOsem_visit =
+                            ({-# LINE 361 "ExecutionPlan2Hs.ag" #-}
+                             []
+                             {-# LINE 4719 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 253, column 54)
+                        _lhsOt_visits =
+                            ({-# LINE 253 "ExecutionPlan2Hs.ag" #-}
+                             empty
+                             {-# LINE 4725 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 396, column 56)
+                        _lhsOusedrules =
+                            ({-# LINE 396 "ExecutionPlan2Hs.ag" #-}
+                             Set.empty
+                             {-# LINE 4731 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 518, column 36)
+                        _lhsOvisitdefs =
+                            ({-# LINE 518 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 4737 "ExecutionPlan2Hs.hs" #-}
+                             )
+                        -- use rule "ExecutionPlan2Hs.ag"(line 519, column 36)
+                        _lhsOvisituses =
+                            ({-# LINE 519 "ExecutionPlan2Hs.ag" #-}
+                             Map.empty
+                             {-# LINE 4743 "ExecutionPlan2Hs.hs" #-}
                              )
                     in  ( _lhsOallvisits,_lhsOchildvisit,_lhsOintramap,_lhsOsem_visit,_lhsOt_visits,_lhsOusedrules,_lhsOvisitdefs,_lhsOvisituses))) )
diff --git a/src-derived/Expression.hs b/src-derived/Expression.hs
--- a/src-derived/Expression.hs
+++ b/src-derived/Expression.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (Expression.ag)
+-- UUAGC 0.9.38.6 (Expression.ag)
 module Expression where
 {-# LINE 2 "Expression.ag" #-}
 
diff --git a/src-derived/GenerateCode.hs b/src-derived/GenerateCode.hs
--- a/src-derived/GenerateCode.hs
+++ b/src-derived/GenerateCode.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.2 (GenerateCode.ag)
+-- UUAGC 0.9.38.6 (GenerateCode.ag)
 module GenerateCode where
 {-# LINE 9 "GenerateCode.ag" #-}
 
diff --git a/src-derived/HsToken.hs b/src-derived/HsToken.hs
--- a/src-derived/HsToken.hs
+++ b/src-derived/HsToken.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.2 (HsToken.ag)
+-- UUAGC 0.9.38.6 (HsToken.ag)
 module HsToken where
 {-# LINE 2 "HsToken.ag" #-}
 
diff --git a/src-derived/Interfaces.hs b/src-derived/Interfaces.hs
--- a/src-derived/Interfaces.hs
+++ b/src-derived/Interfaces.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (Interfaces.ag)
+-- UUAGC 0.9.38.6 (Interfaces.ag)
 module Interfaces where
 {-# LINE 2 "Interfaces.ag" #-}
 
diff --git a/src-derived/InterfacesRules.hs b/src-derived/InterfacesRules.hs
--- a/src-derived/InterfacesRules.hs
+++ b/src-derived/InterfacesRules.hs
@@ -1,6 +1,6 @@
 {-# OPTIONS_GHC -XBangPatterns #-}
 
--- UUAGC 0.9.38.1 (InterfacesRules.lag)
+-- UUAGC 0.9.38.6 (InterfacesRules.lag)
 module InterfacesRules where
 {-# LINE 10 "InterfacesRules.lag" #-}
 
diff --git a/src-derived/KWOrder.hs b/src-derived/KWOrder.hs
--- a/src-derived/KWOrder.hs
+++ b/src-derived/KWOrder.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.2 (KWOrder.ag)
+-- UUAGC 0.9.38.6 (KWOrder.ag)
 module KWOrder where
 {-# LINE 6 "KWOrder.ag" #-}
 
@@ -320,9 +320,11 @@
       inherited attribute:
          options              : Options
       synthesized attributes:
+         depgraphs            : PP_Doc
          inhmap               : Map.Map NontermIdent Attributes
          output               : ExecutionPlan
          synmap               : Map.Map NontermIdent Attributes
+         visitgraph           : PP_Doc
    alternatives:
       alternative Grammar:
          child typeSyns       : {TypeSyns}
@@ -347,15 +349,15 @@
     (sem_Grammar_Grammar _typeSyns _useMap _derivings _wrappers (sem_Nonterminals _nonts ) _pragmas _manualAttrOrderMap _paramMap _contextMap _quantMap _uniqueMap _augmentsMap _aroundsMap _mergeMap )
 -- semantic domain
 newtype T_Grammar  = T_Grammar (Options ->
-                                ( (Map.Map NontermIdent Attributes),ExecutionPlan,(Map.Map NontermIdent Attributes)))
+                                ( PP_Doc,(Map.Map NontermIdent Attributes),ExecutionPlan,(Map.Map NontermIdent Attributes),PP_Doc))
 data Inh_Grammar  = Inh_Grammar {options_Inh_Grammar :: Options}
-data Syn_Grammar  = Syn_Grammar {inhmap_Syn_Grammar :: (Map.Map NontermIdent Attributes),output_Syn_Grammar :: ExecutionPlan,synmap_Syn_Grammar :: (Map.Map NontermIdent Attributes)}
+data Syn_Grammar  = Syn_Grammar {depgraphs_Syn_Grammar :: PP_Doc,inhmap_Syn_Grammar :: (Map.Map NontermIdent Attributes),output_Syn_Grammar :: ExecutionPlan,synmap_Syn_Grammar :: (Map.Map NontermIdent Attributes),visitgraph_Syn_Grammar :: PP_Doc}
 wrap_Grammar :: T_Grammar  ->
                 Inh_Grammar  ->
                 Syn_Grammar 
 wrap_Grammar (T_Grammar sem ) (Inh_Grammar _lhsIoptions )  =
-    (let ( _lhsOinhmap,_lhsOoutput,_lhsOsynmap) = sem _lhsIoptions 
-     in  (Syn_Grammar _lhsOinhmap _lhsOoutput _lhsOsynmap ))
+    (let ( _lhsOdepgraphs,_lhsOinhmap,_lhsOoutput,_lhsOsynmap,_lhsOvisitgraph) = sem _lhsIoptions 
+     in  (Syn_Grammar _lhsOdepgraphs _lhsOinhmap _lhsOoutput _lhsOsynmap _lhsOvisitgraph ))
 sem_Grammar_Grammar :: TypeSyns ->
                        UseMap ->
                        Derivings ->
@@ -375,6 +377,8 @@
     (T_Grammar (\ _lhsIoptions ->
                     (let _nontsOrulenumber :: Int
                          _lhsOoutput :: ExecutionPlan
+                         _lhsOdepgraphs :: PP_Doc
+                         _lhsOvisitgraph :: PP_Doc
                          _lhsOinhmap :: (Map.Map NontermIdent Attributes)
                          _lhsOsynmap :: (Map.Map NontermIdent Attributes)
                          _nontsIdepinfo :: ([NontDependencyInformation])
@@ -385,29 +389,29 @@
                          _nontsOrulenumber =
                              ({-# LINE 36 "KWOrder.ag" #-}
                               0
-                              {-# LINE 389 "KWOrder.hs" #-}
+                              {-# LINE 393 "KWOrder.hs" #-}
                               )
-                         -- "KWOrder.ag"(line 189, column 15)
-                         (Just _lhsOoutput ) =
-                             ({-# LINE 189 "KWOrder.ag" #-}
-                              kennedyWarrenOrder wrappers_ _nontsIdepinfo typeSyns_
-                              {-# LINE 395 "KWOrder.hs" #-}
+                         -- "KWOrder.ag"(line 191, column 15)
+                         (Just (_lhsOoutput,_lhsOdepgraphs,_lhsOvisitgraph) ) =
+                             ({-# LINE 191 "KWOrder.ag" #-}
+                              kennedyWarrenOrder wrappers_ _nontsIdepinfo typeSyns_ derivings_
+                              {-# LINE 399 "KWOrder.hs" #-}
                               )
-                         -- use rule "KWOrder.ag"(line 196, column 33)
+                         -- use rule "KWOrder.ag"(line 198, column 33)
                          _lhsOinhmap =
-                             ({-# LINE 196 "KWOrder.ag" #-}
+                             ({-# LINE 198 "KWOrder.ag" #-}
                               _nontsIinhmap
-                              {-# LINE 401 "KWOrder.hs" #-}
+                              {-# LINE 405 "KWOrder.hs" #-}
                               )
-                         -- use rule "KWOrder.ag"(line 197, column 33)
+                         -- use rule "KWOrder.ag"(line 199, column 33)
                          _lhsOsynmap =
-                             ({-# LINE 197 "KWOrder.ag" #-}
+                             ({-# LINE 199 "KWOrder.ag" #-}
                               _nontsIsynmap
-                              {-# LINE 407 "KWOrder.hs" #-}
+                              {-# LINE 411 "KWOrder.hs" #-}
                               )
                          ( _nontsIdepinfo,_nontsIinhmap,_nontsIrulenumber,_nontsIsynmap) =
                              nonts_ _nontsOrulenumber 
-                     in  ( _lhsOinhmap,_lhsOoutput,_lhsOsynmap))) )
+                     in  ( _lhsOdepgraphs,_lhsOinhmap,_lhsOoutput,_lhsOsynmap,_lhsOvisitgraph))) )
 -- HsToken -----------------------------------------------------
 {-
    visit 0:
@@ -474,7 +478,7 @@
                          Set.singleton $ VAttr (if      field_ == _LHS then Inh
                                                 else if field_ == _LOC then Loc
                                                 else                        Syn) field_ attr_
-                         {-# LINE 478 "KWOrder.hs" #-}
+                         {-# LINE 482 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 sem_HsToken_AGLocal :: Identifier ->
@@ -487,7 +491,7 @@
                     _lhsOvertices =
                         ({-# LINE 80 "KWOrder.ag" #-}
                          Set.singleton $ VAttr Loc _LOC var_
-                         {-# LINE 491 "KWOrder.hs" #-}
+                         {-# LINE 495 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 sem_HsToken_CharToken :: String ->
@@ -499,7 +503,7 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          Set.empty
-                         {-# LINE 503 "KWOrder.hs" #-}
+                         {-# LINE 507 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 sem_HsToken_Err :: String ->
@@ -511,7 +515,7 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          Set.empty
-                         {-# LINE 515 "KWOrder.hs" #-}
+                         {-# LINE 519 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 sem_HsToken_HsToken :: String ->
@@ -523,7 +527,7 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          Set.empty
-                         {-# LINE 527 "KWOrder.hs" #-}
+                         {-# LINE 531 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 sem_HsToken_StrToken :: String ->
@@ -535,7 +539,7 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          Set.empty
-                         {-# LINE 539 "KWOrder.hs" #-}
+                         {-# LINE 543 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOvertices)) )
 -- HsTokens ----------------------------------------------------
@@ -656,26 +660,26 @@
                              _synvertices =
                                  ({-# LINE 162 "KWOrder.ag" #-}
                                   map (VAttr Syn nt_) . Map.keys $ syn_
-                                  {-# LINE 660 "KWOrder.hs" #-}
+                                  {-# LINE 664 "KWOrder.hs" #-}
                                   )
                              -- "KWOrder.ag"(line 163, column 18)
                              _inhvertices =
                                  ({-# LINE 163 "KWOrder.ag" #-}
                                   map (VAttr Inh nt_) . Map.keys $ inh_
-                                  {-# LINE 666 "KWOrder.hs" #-}
+                                  {-# LINE 670 "KWOrder.hs" #-}
                                   )
                              -- "KWOrder.ag"(line 164, column 18)
                              _vertices =
                                  ({-# LINE 164 "KWOrder.ag" #-}
                                   _synvertices     ++ _inhvertices
-                                  {-# LINE 672 "KWOrder.hs" #-}
+                                  {-# LINE 676 "KWOrder.hs" #-}
                                   )
                              -- "KWOrder.ag"(line 168, column 18)
                              _nontgraph =
                                  ({-# LINE 168 "KWOrder.ag" #-}
                                   NontDependencyGraph { ndgVertices = _vertices
                                                       , ndgEdges    = [] }
-                                  {-# LINE 679 "KWOrder.hs" #-}
+                                  {-# LINE 683 "KWOrder.hs" #-}
                                   )
                              -- "KWOrder.ag"(line 176, column 18)
                              _lhsOdepinfo =
@@ -686,31 +690,31 @@
                                                             , ndiSyn         = Map.keys syn_
                                                             , ndiDepGraph    = _nontgraph
                                                             , ndiProds       = _prodsIdepgraph }
-                                  {-# LINE 690 "KWOrder.hs" #-}
+                                  {-# LINE 694 "KWOrder.hs" #-}
                                   )
-                             -- "KWOrder.ag"(line 202, column 17)
+                             -- "KWOrder.ag"(line 204, column 17)
                              _lhsOinhmap =
-                                 ({-# LINE 202 "KWOrder.ag" #-}
+                                 ({-# LINE 204 "KWOrder.ag" #-}
                                   Map.singleton nt_ inh_
-                                  {-# LINE 696 "KWOrder.hs" #-}
+                                  {-# LINE 700 "KWOrder.hs" #-}
                                   )
-                             -- "KWOrder.ag"(line 203, column 17)
+                             -- "KWOrder.ag"(line 205, column 17)
                              _lhsOsynmap =
-                                 ({-# LINE 203 "KWOrder.ag" #-}
+                                 ({-# LINE 205 "KWOrder.ag" #-}
                                   Map.singleton nt_ syn_
-                                  {-# LINE 702 "KWOrder.hs" #-}
+                                  {-# LINE 706 "KWOrder.hs" #-}
                                   )
                              -- copy rule (up)
                              _lhsOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _prodsIrulenumber
-                                  {-# LINE 708 "KWOrder.hs" #-}
+                                  {-# LINE 712 "KWOrder.hs" #-}
                                   )
                              -- copy rule (down)
                              _prodsOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _lhsIrulenumber
-                                  {-# LINE 714 "KWOrder.hs" #-}
+                                  {-# LINE 718 "KWOrder.hs" #-}
                                   )
                              ( _prodsIdepgraph,_prodsIrulenumber) =
                                  prods_ _prodsOrulenumber 
@@ -769,37 +773,37 @@
                               _lhsOdepinfo =
                                   ({-# LINE 173 "KWOrder.ag" #-}
                                    _hdIdepinfo : _tlIdepinfo
-                                   {-# LINE 773 "KWOrder.hs" #-}
+                                   {-# LINE 777 "KWOrder.hs" #-}
                                    )
-                              -- use rule "KWOrder.ag"(line 196, column 33)
+                              -- use rule "KWOrder.ag"(line 198, column 33)
                               _lhsOinhmap =
-                                  ({-# LINE 196 "KWOrder.ag" #-}
+                                  ({-# LINE 198 "KWOrder.ag" #-}
                                    _hdIinhmap `Map.union` _tlIinhmap
-                                   {-# LINE 779 "KWOrder.hs" #-}
+                                   {-# LINE 783 "KWOrder.hs" #-}
                                    )
-                              -- use rule "KWOrder.ag"(line 197, column 33)
+                              -- use rule "KWOrder.ag"(line 199, column 33)
                               _lhsOsynmap =
-                                  ({-# LINE 197 "KWOrder.ag" #-}
+                                  ({-# LINE 199 "KWOrder.ag" #-}
                                    _hdIsynmap `Map.union` _tlIsynmap
-                                   {-# LINE 785 "KWOrder.hs" #-}
+                                   {-# LINE 789 "KWOrder.hs" #-}
                                    )
                               -- copy rule (up)
                               _lhsOrulenumber =
                                   ({-# LINE 33 "KWOrder.ag" #-}
                                    _tlIrulenumber
-                                   {-# LINE 791 "KWOrder.hs" #-}
+                                   {-# LINE 795 "KWOrder.hs" #-}
                                    )
                               -- copy rule (down)
                               _hdOrulenumber =
                                   ({-# LINE 33 "KWOrder.ag" #-}
                                    _lhsIrulenumber
-                                   {-# LINE 797 "KWOrder.hs" #-}
+                                   {-# LINE 801 "KWOrder.hs" #-}
                                    )
                               -- copy rule (chain)
                               _tlOrulenumber =
                                   ({-# LINE 33 "KWOrder.ag" #-}
                                    _hdIrulenumber
-                                   {-# LINE 803 "KWOrder.hs" #-}
+                                   {-# LINE 807 "KWOrder.hs" #-}
                                    )
                               ( _hdIdepinfo,_hdIinhmap,_hdIrulenumber,_hdIsynmap) =
                                   hd_ _hdOrulenumber 
@@ -817,25 +821,25 @@
                               _lhsOdepinfo =
                                   ({-# LINE 173 "KWOrder.ag" #-}
                                    []
-                                   {-# LINE 821 "KWOrder.hs" #-}
+                                   {-# LINE 825 "KWOrder.hs" #-}
                                    )
-                              -- use rule "KWOrder.ag"(line 196, column 33)
+                              -- use rule "KWOrder.ag"(line 198, column 33)
                               _lhsOinhmap =
-                                  ({-# LINE 196 "KWOrder.ag" #-}
+                                  ({-# LINE 198 "KWOrder.ag" #-}
                                    Map.empty
-                                   {-# LINE 827 "KWOrder.hs" #-}
+                                   {-# LINE 831 "KWOrder.hs" #-}
                                    )
-                              -- use rule "KWOrder.ag"(line 197, column 33)
+                              -- use rule "KWOrder.ag"(line 199, column 33)
                               _lhsOsynmap =
-                                  ({-# LINE 197 "KWOrder.ag" #-}
+                                  ({-# LINE 199 "KWOrder.ag" #-}
                                    Map.empty
-                                   {-# LINE 833 "KWOrder.hs" #-}
+                                   {-# LINE 837 "KWOrder.hs" #-}
                                    )
                               -- copy rule (chain)
                               _lhsOrulenumber =
                                   ({-# LINE 33 "KWOrder.ag" #-}
                                    _lhsIrulenumber
-                                   {-# LINE 839 "KWOrder.hs" #-}
+                                   {-# LINE 843 "KWOrder.hs" #-}
                                    )
                           in  ( _lhsOdepinfo,_lhsOinhmap,_lhsOrulenumber,_lhsOsynmap))) )
 -- Pattern -----------------------------------------------------
@@ -914,25 +918,25 @@
                          else VAttr (if      field_ == _LHS  then Syn
                                      else if field_ == _LOC  then Loc
                                      else                         Inh) field_ attr_
-                         {-# LINE 918 "KWOrder.hs" #-}
+                         {-# LINE 922 "KWOrder.hs" #-}
                          )
                     -- "KWOrder.ag"(line 96, column 12)
                     _lhsOvertices =
                         ({-# LINE 96 "KWOrder.ag" #-}
                          Set.insert _vertex     $ _partsIvertices `Set.union` _patIvertices
-                         {-# LINE 924 "KWOrder.hs" #-}
+                         {-# LINE 928 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _copy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          Alias field_ attr_ _patIcopy _partsIcopy
-                         {-# LINE 930 "KWOrder.hs" #-}
+                         {-# LINE 934 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _lhsOcopy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          _copy
-                         {-# LINE 936 "KWOrder.hs" #-}
+                         {-# LINE 940 "KWOrder.hs" #-}
                          )
                     ( _patIcopy,_patIvertices) =
                         pat_ 
@@ -951,19 +955,19 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          _patsIvertices
-                         {-# LINE 955 "KWOrder.hs" #-}
+                         {-# LINE 959 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _copy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          Constr name_ _patsIcopy
-                         {-# LINE 961 "KWOrder.hs" #-}
+                         {-# LINE 965 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _lhsOcopy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          _copy
-                         {-# LINE 967 "KWOrder.hs" #-}
+                         {-# LINE 971 "KWOrder.hs" #-}
                          )
                     ( _patsIcopy,_patsIvertices) =
                         pats_ 
@@ -979,19 +983,19 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          _patIvertices
-                         {-# LINE 983 "KWOrder.hs" #-}
+                         {-# LINE 987 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _copy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          Irrefutable _patIcopy
-                         {-# LINE 989 "KWOrder.hs" #-}
+                         {-# LINE 993 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _lhsOcopy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          _copy
-                         {-# LINE 995 "KWOrder.hs" #-}
+                         {-# LINE 999 "KWOrder.hs" #-}
                          )
                     ( _patIcopy,_patIvertices) =
                         pat_ 
@@ -1008,19 +1012,19 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          _patsIvertices
-                         {-# LINE 1012 "KWOrder.hs" #-}
+                         {-# LINE 1016 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _copy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          Product pos_ _patsIcopy
-                         {-# LINE 1018 "KWOrder.hs" #-}
+                         {-# LINE 1022 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _lhsOcopy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          _copy
-                         {-# LINE 1024 "KWOrder.hs" #-}
+                         {-# LINE 1028 "KWOrder.hs" #-}
                          )
                     ( _patsIcopy,_patsIvertices) =
                         pats_ 
@@ -1034,19 +1038,19 @@
                     _lhsOvertices =
                         ({-# LINE 76 "KWOrder.ag" #-}
                          Set.empty
-                         {-# LINE 1038 "KWOrder.hs" #-}
+                         {-# LINE 1042 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _copy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          Underscore pos_
-                         {-# LINE 1044 "KWOrder.hs" #-}
+                         {-# LINE 1048 "KWOrder.hs" #-}
                          )
                     -- self rule
                     _lhsOcopy =
                         ({-# LINE 23 "./Patterns.ag" #-}
                          _copy
-                         {-# LINE 1050 "KWOrder.hs" #-}
+                         {-# LINE 1054 "KWOrder.hs" #-}
                          )
                 in  ( _lhsOcopy,_lhsOvertices)) )
 -- Patterns ----------------------------------------------------
@@ -1094,19 +1098,19 @@
                      _lhsOvertices =
                          ({-# LINE 76 "KWOrder.ag" #-}
                           _hdIvertices `Set.union` _tlIvertices
-                          {-# LINE 1098 "KWOrder.hs" #-}
+                          {-# LINE 1102 "KWOrder.hs" #-}
                           )
                      -- self rule
                      _copy =
                          ({-# LINE 23 "./Patterns.ag" #-}
                           (:) _hdIcopy _tlIcopy
-                          {-# LINE 1104 "KWOrder.hs" #-}
+                          {-# LINE 1108 "KWOrder.hs" #-}
                           )
                      -- self rule
                      _lhsOcopy =
                          ({-# LINE 23 "./Patterns.ag" #-}
                           _copy
-                          {-# LINE 1110 "KWOrder.hs" #-}
+                          {-# LINE 1114 "KWOrder.hs" #-}
                           )
                      ( _hdIcopy,_hdIvertices) =
                          hd_ 
@@ -1121,19 +1125,19 @@
                      _lhsOvertices =
                          ({-# LINE 76 "KWOrder.ag" #-}
                           Set.empty
-                          {-# LINE 1125 "KWOrder.hs" #-}
+                          {-# LINE 1129 "KWOrder.hs" #-}
                           )
                      -- self rule
                      _copy =
                          ({-# LINE 23 "./Patterns.ag" #-}
                           []
-                          {-# LINE 1131 "KWOrder.hs" #-}
+                          {-# LINE 1135 "KWOrder.hs" #-}
                           )
                      -- self rule
                      _lhsOcopy =
                          ({-# LINE 23 "./Patterns.ag" #-}
                           _copy
-                          {-# LINE 1137 "KWOrder.hs" #-}
+                          {-# LINE 1141 "KWOrder.hs" #-}
                           )
                  in  ( _lhsOcopy,_lhsOvertices)) )
 -- Production --------------------------------------------------
@@ -1191,13 +1195,13 @@
                             _vertices =
                                 ({-# LINE 114 "KWOrder.ag" #-}
                                  _rulesIvertices `Set.union` _childrenIvertices
-                                 {-# LINE 1195 "KWOrder.hs" #-}
+                                 {-# LINE 1199 "KWOrder.hs" #-}
                                  )
                             -- "KWOrder.ag"(line 134, column 17)
                             _edges =
                                 ({-# LINE 134 "KWOrder.ag" #-}
                                  _rulesIedges `Set.union` _childrenIedges
-                                 {-# LINE 1201 "KWOrder.hs" #-}
+                                 {-# LINE 1205 "KWOrder.hs" #-}
                                  )
                             -- "KWOrder.ag"(line 149, column 17)
                             _lhsOdepgraph =
@@ -1208,19 +1212,19 @@
                                                      , pdgChilds      = _childrenIechilds
                                                      , pdgProduction  = con_
                                                      , pdgChildMap    = _childrenInontnames }
-                                 {-# LINE 1212 "KWOrder.hs" #-}
+                                 {-# LINE 1216 "KWOrder.hs" #-}
                                  )
                             -- copy rule (up)
                             _lhsOrulenumber =
                                 ({-# LINE 33 "KWOrder.ag" #-}
                                  _rulesIrulenumber
-                                 {-# LINE 1218 "KWOrder.hs" #-}
+                                 {-# LINE 1222 "KWOrder.hs" #-}
                                  )
                             -- copy rule (down)
                             _rulesOrulenumber =
                                 ({-# LINE 33 "KWOrder.ag" #-}
                                  _lhsIrulenumber
-                                 {-# LINE 1224 "KWOrder.hs" #-}
+                                 {-# LINE 1228 "KWOrder.hs" #-}
                                  )
                             ( _childrenIechilds,_childrenIedges,_childrenInontnames,_childrenIvertices) =
                                 children_ 
@@ -1273,25 +1277,25 @@
                              _lhsOdepgraph =
                                  ({-# LINE 146 "KWOrder.ag" #-}
                                   _hdIdepgraph : _tlIdepgraph
-                                  {-# LINE 1277 "KWOrder.hs" #-}
+                                  {-# LINE 1281 "KWOrder.hs" #-}
                                   )
                              -- copy rule (up)
                              _lhsOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _tlIrulenumber
-                                  {-# LINE 1283 "KWOrder.hs" #-}
+                                  {-# LINE 1287 "KWOrder.hs" #-}
                                   )
                              -- copy rule (down)
                              _hdOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _lhsIrulenumber
-                                  {-# LINE 1289 "KWOrder.hs" #-}
+                                  {-# LINE 1293 "KWOrder.hs" #-}
                                   )
                              -- copy rule (chain)
                              _tlOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _hdIrulenumber
-                                  {-# LINE 1295 "KWOrder.hs" #-}
+                                  {-# LINE 1299 "KWOrder.hs" #-}
                                   )
                              ( _hdIdepgraph,_hdIrulenumber) =
                                  hd_ _hdOrulenumber 
@@ -1307,13 +1311,13 @@
                              _lhsOdepgraph =
                                  ({-# LINE 146 "KWOrder.ag" #-}
                                   []
-                                  {-# LINE 1311 "KWOrder.hs" #-}
+                                  {-# LINE 1315 "KWOrder.hs" #-}
                                   )
                              -- copy rule (chain)
                              _lhsOrulenumber =
                                  ({-# LINE 33 "KWOrder.ag" #-}
                                   _lhsIrulenumber
-                                  {-# LINE 1317 "KWOrder.hs" #-}
+                                  {-# LINE 1321 "KWOrder.hs" #-}
                                   )
                          in  ( _lhsOdepgraph,_lhsOrulenumber))) )
 -- Rule --------------------------------------------------------
@@ -1376,13 +1380,13 @@
                       _lhsOrulenumber =
                           ({-# LINE 39 "KWOrder.ag" #-}
                            _lhsIrulenumber + 1
-                           {-# LINE 1380 "KWOrder.hs" #-}
+                           {-# LINE 1384 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 40, column 11)
                       _rulename =
                           ({-# LINE 40 "KWOrder.ag" #-}
                            maybe (identifier $ "rule" ++ show _lhsIrulenumber) id mbName_
-                           {-# LINE 1386 "KWOrder.hs" #-}
+                           {-# LINE 1390 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 51, column 10)
                       _lhsOerules =
@@ -1393,37 +1397,37 @@
                                  owrt_
                                  origin_
                                  explicit_
-                           {-# LINE 1397 "KWOrder.hs" #-}
+                           {-# LINE 1401 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 109, column 11)
                       _vertex =
                           ({-# LINE 109 "KWOrder.ag" #-}
                            VRule _rulename
-                           {-# LINE 1403 "KWOrder.hs" #-}
+                           {-# LINE 1407 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 110, column 11)
                       _lhsOvertices =
                           ({-# LINE 110 "KWOrder.ag" #-}
                            Set.insert _vertex     $ _patternIvertices `Set.union` _rhsIvertices
-                           {-# LINE 1409 "KWOrder.hs" #-}
+                           {-# LINE 1413 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 122, column 11)
                       _edgesout =
                           ({-# LINE 122 "KWOrder.ag" #-}
                            map ((,) _vertex    ) (Set.toList _rhsIvertices)
-                           {-# LINE 1415 "KWOrder.hs" #-}
+                           {-# LINE 1419 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 123, column 11)
                       _edgesin =
                           ({-# LINE 123 "KWOrder.ag" #-}
                            map (flip (,) _vertex    ) (Set.toList _patternIvertices)
-                           {-# LINE 1421 "KWOrder.hs" #-}
+                           {-# LINE 1425 "KWOrder.hs" #-}
                            )
                       -- "KWOrder.ag"(line 124, column 11)
                       _lhsOedges =
                           ({-# LINE 124 "KWOrder.ag" #-}
                            Set.fromList $ _edgesout     ++ _edgesin
-                           {-# LINE 1427 "KWOrder.hs" #-}
+                           {-# LINE 1431 "KWOrder.hs" #-}
                            )
                       ( _patternIcopy,_patternIvertices) =
                           pattern_ 
@@ -1484,37 +1488,37 @@
                        _lhsOedges =
                            ({-# LINE 118 "KWOrder.ag" #-}
                             _hdIedges `Set.union` _tlIedges
-                            {-# LINE 1488 "KWOrder.hs" #-}
+                            {-# LINE 1492 "KWOrder.hs" #-}
                             )
                        -- use rule "KWOrder.ag"(line 48, column 25)
                        _lhsOerules =
                            ({-# LINE 48 "KWOrder.ag" #-}
                             _hdIerules : _tlIerules
-                            {-# LINE 1494 "KWOrder.hs" #-}
+                            {-# LINE 1498 "KWOrder.hs" #-}
                             )
                        -- use rule "KWOrder.ag"(line 76, column 36)
                        _lhsOvertices =
                            ({-# LINE 76 "KWOrder.ag" #-}
                             _hdIvertices `Set.union` _tlIvertices
-                            {-# LINE 1500 "KWOrder.hs" #-}
+                            {-# LINE 1504 "KWOrder.hs" #-}
                             )
                        -- copy rule (up)
                        _lhsOrulenumber =
                            ({-# LINE 33 "KWOrder.ag" #-}
                             _tlIrulenumber
-                            {-# LINE 1506 "KWOrder.hs" #-}
+                            {-# LINE 1510 "KWOrder.hs" #-}
                             )
                        -- copy rule (down)
                        _hdOrulenumber =
                            ({-# LINE 33 "KWOrder.ag" #-}
                             _lhsIrulenumber
-                            {-# LINE 1512 "KWOrder.hs" #-}
+                            {-# LINE 1516 "KWOrder.hs" #-}
                             )
                        -- copy rule (chain)
                        _tlOrulenumber =
                            ({-# LINE 33 "KWOrder.ag" #-}
                             _hdIrulenumber
-                            {-# LINE 1518 "KWOrder.hs" #-}
+                            {-# LINE 1522 "KWOrder.hs" #-}
                             )
                        ( _hdIedges,_hdIerules,_hdIrulenumber,_hdIvertices) =
                            hd_ _hdOrulenumber 
@@ -1532,25 +1536,25 @@
                        _lhsOedges =
                            ({-# LINE 118 "KWOrder.ag" #-}
                             Set.empty
-                            {-# LINE 1536 "KWOrder.hs" #-}
+                            {-# LINE 1540 "KWOrder.hs" #-}
                             )
                        -- use rule "KWOrder.ag"(line 48, column 25)
                        _lhsOerules =
                            ({-# LINE 48 "KWOrder.ag" #-}
                             []
-                            {-# LINE 1542 "KWOrder.hs" #-}
+                            {-# LINE 1546 "KWOrder.hs" #-}
                             )
                        -- use rule "KWOrder.ag"(line 76, column 36)
                        _lhsOvertices =
                            ({-# LINE 76 "KWOrder.ag" #-}
                             Set.empty
-                            {-# LINE 1548 "KWOrder.hs" #-}
+                            {-# LINE 1552 "KWOrder.hs" #-}
                             )
                        -- copy rule (chain)
                        _lhsOrulenumber =
                            ({-# LINE 33 "KWOrder.ag" #-}
                             _lhsIrulenumber
-                            {-# LINE 1554 "KWOrder.hs" #-}
+                            {-# LINE 1558 "KWOrder.hs" #-}
                             )
                    in  ( _lhsOedges,_lhsOerules,_lhsOrulenumber,_lhsOvertices))) )
 -- TypeSig -----------------------------------------------------
diff --git a/src-derived/Order.hs b/src-derived/Order.hs
--- a/src-derived/Order.hs
+++ b/src-derived/Order.hs
@@ -1,5534 +1,5526 @@
 
 
--- UUAGC 0.9.38.1 (Order.ag)
-module Order where
-{-# LINE 9 "Order.ag" #-}
-
--- From uuagc
-import CommonTypes
-import Patterns
-import ErrorMessages
-import AbstractSyntax
-import Code hiding (Type)
-import qualified Code
-import Expression
-import Options
-import SequentialComputation
-import SequentialTypes
-import CodeSyntax
-import GrammarInfo
-import HsToken(HsTokensRoot(HsTokensRoot))
-import HsTokenScanner(lexTokens)
-import SemHsTokens(sem_HsTokensRoot,wrap_HsTokensRoot, Syn_HsTokensRoot(..),Inh_HsTokensRoot(..))
--- From uulib
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Sequence as Seq
-import Data.Map(Map)
-import Data.Set(Set)
-import Data.Sequence(Seq, (><))
-import UU.Util.Utils
-import UU.Scanner.Position(Pos(..),initPos)
-import Data.Foldable(toList)
-
--- From haskell libraries
-import Control.Monad(liftM)
-import qualified Data.Array as Array
-import Data.Array((!),bounds,inRange)
-import Data.List(elemIndex,partition,sort,mapAccumL,find,nubBy,intersperse,groupBy,transpose)
-import qualified Data.Tree as Tree
-import Maybe
-{-# LINE 42 "../src-derived/Order.hs" #-}
-
-{-# LINE 2 "./Patterns.ag" #-}
-
--- Patterns.ag imports
-import UU.Scanner.Position(Pos)
-import CommonTypes (ConstructorIdent,Identifier)
-{-# LINE 49 "../src-derived/Order.hs" #-}
-
-{-# LINE 2 "./Expression.ag" #-}
-
-import UU.Scanner.Position(Pos)
-import HsToken
-{-# LINE 55 "../src-derived/Order.hs" #-}
-
-{-# LINE 2 "./AbstractSyntax.ag" #-}
-
--- AbstractSyntax.ag imports
-import Data.Set(Set)
-import Data.Map(Map)
-import Patterns    (Pattern(..),Patterns)
-import Expression  (Expression(..))
-import CommonTypes
-{-# LINE 65 "../src-derived/Order.hs" #-}
-{-# LINE 46 "Order.ag" #-}
-
--- Terminates with an error if the key is not in the map
-findWithErr1 :: (Ord k, Show k) => String -> k -> Map k a -> a
-findWithErr1 s k
-  = Map.findWithDefault (error ("findWithErr1 " ++ s ++ ": key " ++ show k ++ " not in map.")) k
-
-findWithErr2 :: (Ord k, Show k, Show a) => k -> Map k a -> a
-findWithErr2 k m
-  = Map.findWithDefault (error ("findWithErr2: key " ++ show k ++ " not in map: " ++ show m)) k m
-{-# LINE 76 "../src-derived/Order.hs" #-}
-
-{-# LINE 71 "Order.ag" #-}
-
-startsWith :: String -> String -> Bool
-startsWith k h = k == take (length k) h
-{-# LINE 82 "../src-derived/Order.hs" #-}
-
-{-# LINE 138 "Order.ag" #-}
-
-getNtName :: Type -> NontermIdent
-getNtName (NT nt _) = maybe nt id (deforestedNt nt)
-getNtName _         = nullIdent
-{-# LINE 89 "../src-derived/Order.hs" #-}
-
-{-# LINE 166 "Order.ag" #-}
-
-data AltAttr = AltAttr Identifier Identifier Bool
-               deriving (Eq, Ord, Show)
-{-# LINE 95 "../src-derived/Order.hs" #-}
-
-{-# LINE 238 "Order.ag" #-}
-
-substSelf nt tp
-  = case tp of
-      NT n tps | n == _SELF -> NT nt tps
-      _                     -> tp
-
-haskellTupel :: [Type] -> Maybe Type
-haskellTupel ts =  Just ( Haskell ( '(' : (concat (intersperse "," (map show ts))) ++ ")" ))
-{-# LINE 106 "../src-derived/Order.hs" #-}
-
-{-# LINE 687 "Order.ag" #-}
-
-swap (a,b) = (b,a)
-
-showPath :: Table CRule -> [Vertex] -> [String]
-showPath ruleTable path
-  =  let  look a | inRange (bounds ruleTable) a = [showOrigin (ruleTable ! a)]
-                 | otherwise = ["Vertex " ++ show a]
-          showOrigin cr  | getHasCode cr && getName (getAttr cr) /= "self" = prettyCRule cr ++ " (" ++ show (getPos (getAttr cr)) ++ ")"
-                         | otherwise = prettyCRule cr
-     in concatMap look path
-
-
-showPathLocal :: Table CRule -> [Vertex] -> [String]
-showPathLocal _ [] = []
-showPathLocal ruleTable xs = showP (xs++[-1])
- where showP []         = []
-       showP (v1:v2:vs) = let line  = step v1 v2
-                              lines = showP vs
-                          in  line:lines
-       step v1 v2  = " - " ++ a1
-        where r1 = ruleTable ! v1
-              a1 = show (getAttr  r1)
-
-
-limitTo :: Int -> [String] -> [String]
-limitTo _ [] = []
-limitTo 0 _ = ["....etcetera, etcetera...."]
-limitTo n (x:xs) = x : limitTo (n-1) xs
-
-showPathNice :: Table CRule -> [Vertex] -> [String]
-showPathNice _ [] = []
-showPathNice ruleTable xs = limitTo 100 (showP ((-1):xs++[-1]))
- where [maxf, maxa, maxn, maxc] = maxWidths ruleTable (take 100 xs)
-       showP []         = []
-       showP (v1:v2:vs) = let line  = step v1 v2
-                              lines = showP vs
-                          in  if null line  then lines  else line:lines
-       step v1 v2  |  last &&      first    = induced
-                   |  last &&     isSyn r1  = "pass up        "  ++ alignR maxf ""    ++ " " ++ alignL maxa a1 ++ " in " ++ alignR maxn n1 ++ "|" ++ c1 ++ induced
-                   |  first&& not(isSyn r2) = "get from above "  ++ alignR maxf ""    ++ " " ++ alignL maxa a2 ++ " in " ++ alignR maxn n2 ++ "|" ++ c2
-                   |  last                  = "pass down      "  ++ alignR maxf f1    ++ "." ++ a1                                                      ++ induced
-                   |              isSyn r2  = "get from below "  ++ alignR maxf f2    ++ "." ++ alignL maxa a2 ++ " in " ++ alignR maxn n2 ++ "|" ++ c2
-                   |  isLocal r1  = if head a1 == '_'
-                                         then ""
-                                         else "calculate      "  ++ alignR maxf "loc" ++ "." ++ a1
-                   |  otherwise             = "pass down      "  ++ alignR maxf f1    ++ "." ++ alignL maxa a1 ++ " to " ++ alignR maxn n2 ++ "|" ++ c2
-          where
-              first = v1<0
-              last  = v2<0
-              r1 = ruleTable ! v1
-              r2 = ruleTable ! v2
-              a1 = show (getAttr  r1)
-              a2 = show (getAttr  r2)
-              f1 = show (getField r1)
-              f2 = show (getField r2)
-              n1 = show (getLhsNt r1)
-              n2 = show (getLhsNt r2)
-              c1 = show (getCon   r1)
-              c2 = show (getCon   r2)
-              induced | v2== -2   =  " INDUCED dependency to "
-                      | otherwise = ""
-
-
-maxWidths ruleTable vs
-  = map maximum (transpose (map getWidth vs))
-  where getWidth v | v<0       = [0,0,0,0]
-                   | otherwise = map (length . show . ($ (ruleTable!v))) [getField, getAttr, getLhsNt, getCon]
-
-alignL n xs | k<n       = xs ++ replicate (n-k) ' '
-            | otherwise = xs
-              where k = length xs
-
-alignR n xs | k<n       = replicate (n-k) ' ' ++ xs
-            | otherwise = xs
-              where k = length xs
-
-localCycleErr :: Table CRule -> Bool -> Route -> Error
-localCycleErr ruleTable o_visit (s:path)
-  =  let cr = ruleTable ! s
-         attr = getAttr cr
-         nt = getLhsNt cr
-         con = getCon cr
-     in LocalCirc nt con attr o_visit (showPathLocal ruleTable path)
-
-instCycleErr :: Table CRule -> Bool -> Route -> Error
-instCycleErr ruleTable o_visit (s:path)
-  =  let cr = ruleTable ! s
-         attr = getAttr cr
-         nt = getLhsNt cr
-         con = getCon cr
-     in InstCirc nt con attr o_visit (showPathLocal ruleTable path)
-
-directCycleErrs :: Table NTAttr -> Table CRule -> Bool -> [EdgeRoutes] -> [Error]
-directCycleErrs attrTable ruleTable o_visit xs
-  = let getNont v = case attrTable ! v of
-                      NTASyn nt _ _ -> nt
-                      NTAInh nt _ _ -> nt
-        getAttr v = case attrTable ! v of
-                      NTASyn _ a _  -> a
-                      NTAInh _ a _  -> a
-        sameNont ((v1,_),_,_) ((v2,_),_,_) =  getNont v1 == getNont v2
-        procCycle ((v1,v2),p1,p2) = ((getAttr v1, getAttr v2), showPathNice ruleTable p1, showPathNice ruleTable p2)
-        wrapGroup gr@(((v1,_),_,_):_) = DirectCirc (getNont v1) o_visit (map procCycle gr)
-    in  map wrapGroup (groupBy sameNont xs)
-
-inducedCycleErrs :: Table NTAttr -> Table CRule -> CInterfaceMap -> [EdgeRoutes] -> [Error]
-inducedCycleErrs attrTable ruleTable cim xs
-  = let getNont v = case attrTable ! v of
-                      NTASyn nt _ _ -> nt
-                      NTAInh nt _ _ -> nt
-        getAttr v = case attrTable ! v of
-                      NTASyn _ a _  -> a
-                      NTAInh _ a _  -> a
-        sameNont ((v1,_),_,_) ((v2,_),_,_) =  getNont v1 == getNont v2
-        procCycle ((v1,v2),p1,p2) = ((getAttr v1, getAttr v2), showPathNice ruleTable p1, showPathNice ruleTable p2)
-        wrapGroup gr@(((v1,_),_,_):_) = InducedCirc (getNont v1) (findWithErr1 "inducedCycleErr.cinter" (getNont v1) cim) (map procCycle gr)
-    in  map wrapGroup (groupBy sameNont xs)
-{-# LINE 226 "../src-derived/Order.hs" #-}
--- Child -------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
-         allnts               : [Identifier]
-         attrs                : [(Identifier,Identifier)]
-         con                  : Identifier
-         inh                  : Attributes
-         mergeMap             : Map Identifier (Identifier,[Identifier])
-         nt                   : Identifier
-         o_unbox              : Bool
-         syn                  : Attributes
-      synthesized attributes:
-         attributes           : [(Identifier,Attributes,Attributes)]
-         collectChildrenInhs  : Map Identifier Attributes 
-         collectChildrenSyns  : Map Identifier Attributes 
-         errors               : Seq Error
-         field                : (Identifier,Type,Maybe (Maybe Type))
-         gathAltAttrs         : [AltAttr]
-         gathRules            : Seq CRule
-         inhs                 : Seq (Identifier,Attributes)
-         nts                  : Seq (Identifier,NontermIdent)
-         singlevisits         : [CRule]
-         terminals            : [Identifier]
-   alternatives:
-      alternative Child:
-         child name           : {Identifier}
-         child tp             : {Type}
-         child inh            : {Attributes}
-         child syn            : {Attributes}
-         child virtual        : {Maybe (Maybe Type)}
-         visit 0:
-            local maptolocal  : _
-            local gathRules   : _
--}
--- cata
-sem_Child :: Child  ->
-             T_Child 
-sem_Child (Child _name _tp _inh _syn _virtual )  =
-    (sem_Child_Child _name _tp _inh _syn _virtual )
--- semantic domain
-newtype T_Child  = T_Child (([(Identifier,Type,Maybe (Maybe Type))]) ->
-                            ([Identifier]) ->
-                            ([(Identifier,Identifier)]) ->
-                            Identifier ->
-                            Attributes ->
-                            (Map Identifier (Identifier,[Identifier])) ->
-                            Identifier ->
-                            Bool ->
-                            Attributes ->
-                            ( ([(Identifier,Attributes,Attributes)]),(Map Identifier Attributes ),(Map Identifier Attributes ),(Seq Error),((Identifier,Type,Maybe (Maybe Type))),([AltAttr]),(Seq CRule),(Seq (Identifier,Attributes)),(Seq (Identifier,NontermIdent)),([CRule]),([Identifier])))
-data Inh_Child  = Inh_Child {allfields_Inh_Child :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Child :: !(([Identifier])),attrs_Inh_Child :: !(([(Identifier,Identifier)])),con_Inh_Child :: !(Identifier),inh_Inh_Child :: !(Attributes),mergeMap_Inh_Child :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Child :: !(Identifier),o_unbox_Inh_Child :: !(Bool),syn_Inh_Child :: !(Attributes)}
-data Syn_Child  = Syn_Child {attributes_Syn_Child :: !(([(Identifier,Attributes,Attributes)])),collectChildrenInhs_Syn_Child :: !((Map Identifier Attributes )),collectChildrenSyns_Syn_Child :: !((Map Identifier Attributes )),errors_Syn_Child :: !((Seq Error)),field_Syn_Child :: !(((Identifier,Type,Maybe (Maybe Type)))),gathAltAttrs_Syn_Child :: !(([AltAttr])),gathRules_Syn_Child :: !((Seq CRule)),inhs_Syn_Child :: !((Seq (Identifier,Attributes))),nts_Syn_Child :: !((Seq (Identifier,NontermIdent))),singlevisits_Syn_Child :: !(([CRule])),terminals_Syn_Child :: !(([Identifier]))}
-wrap_Child :: T_Child  ->
-              Inh_Child  ->
-              Syn_Child 
-wrap_Child (T_Child sem ) (Inh_Child _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn )  =
-    (let ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfield,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn 
-     in  (Syn_Child _lhsOattributes _lhsOcollectChildrenInhs _lhsOcollectChildrenSyns _lhsOerrors _lhsOfield _lhsOgathAltAttrs _lhsOgathRules _lhsOinhs _lhsOnts _lhsOsinglevisits _lhsOterminals ))
-sem_Child_Child :: Identifier ->
-                   Type ->
-                   Attributes ->
-                   Attributes ->
-                   (Maybe (Maybe Type)) ->
-                   T_Child 
-sem_Child_Child name_ tp_ inh_ syn_ virtual_  =
-    (T_Child (\ _lhsIallfields
-                _lhsIallnts
-                _lhsIattrs
-                _lhsIcon
-                _lhsIinh
-                _lhsImergeMap
-                _lhsInt
-                _lhsIo_unbox
-                _lhsIsyn ->
-                  (let _lhsOgathAltAttrs :: ([AltAttr])
-                       _lhsOnts :: (Seq (Identifier,NontermIdent))
-                       _lhsOinhs :: (Seq (Identifier,Attributes))
-                       _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
-                       _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
-                       _lhsOsinglevisits :: ([CRule])
-                       _lhsOterminals :: ([Identifier])
-                       _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
-                       _lhsOfield :: ((Identifier,Type,Maybe (Maybe Type)))
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOgathRules :: (Seq CRule)
-                       -- "Order.ag"(line 177, column 13)
-                       _maptolocal =
-                           ({-# LINE 177 "Order.ag" #-}
-                            case tp_ of
-                              NT nt _ -> Map.null syn_
-                              _       -> True
-                            {-# LINE 320 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 180, column 13)
-                       _lhsOgathAltAttrs =
-                           ({-# LINE 180 "Order.ag" #-}
-                            if  _maptolocal
-                                then [ AltAttr _LOC name_ True ]
-                                else [ AltAttr name_ syn True | syn <- Map.keys syn_ ]
-                            {-# LINE 328 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 195, column 13)
-                       _lhsOnts =
-                           ({-# LINE 195 "Order.ag" #-}
-                            Seq.singleton (name_,getNtName tp_)
-                            {-# LINE 334 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 196, column 13)
-                       _lhsOinhs =
-                           ({-# LINE 196 "Order.ag" #-}
-                            Seq.singleton (name_,inh_)
-                            {-# LINE 340 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 212, column 13)
-                       _gathRules =
-                           ({-# LINE 212 "Order.ag" #-}
-                            if  _maptolocal
-                                then Seq.singleton (cRuleTerminal name_ _lhsInt _lhsIcon tp_)
-                                else Seq.fromList [ cRuleRhsSyn syn _lhsInt _lhsIcon tp name_ (getNtName tp_) | (syn,tp) <- Map.assocs syn_]
-                            {-# LINE 348 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 346, column 12)
-                       _lhsOcollectChildrenSyns =
-                           ({-# LINE 346 "Order.ag" #-}
-                            Map.singleton name_ syn_
-                            {-# LINE 354 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 347, column 12)
-                       _lhsOcollectChildrenInhs =
-                           ({-# LINE 347 "Order.ag" #-}
-                            Map.singleton name_ inh_
-                            {-# LINE 360 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 613, column 11)
-                       _lhsOsinglevisits =
-                           ({-# LINE 613 "Order.ag" #-}
-                            if  _maptolocal
-                                then []
-                                else [CChildVisit name_ (getNtName tp_) 0 inh_ syn_ True]
-                            {-# LINE 368 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 638, column 11)
-                       _lhsOterminals =
-                           ({-# LINE 638 "Order.ag" #-}
-                            if _maptolocal
-                            then [name_]
-                            else []
-                            {-# LINE 376 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 667, column 11)
-                       _lhsOattributes =
-                           ({-# LINE 667 "Order.ag" #-}
-                            [(name_, inh_, syn_)]
-                            {-# LINE 382 "Order.hs" #-}
-                            )
-                       -- "Order.ag"(line 671, column 11)
-                       _lhsOfield =
-                           ({-# LINE 671 "Order.ag" #-}
-                            (name_, tp_, virtual_)
-                            {-# LINE 388 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 84, column 70)
-                       _lhsOerrors =
-                           ({-# LINE 84 "Order.ag" #-}
-                            Seq.empty
-                            {-# LINE 394 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 206, column 23)
-                       _lhsOgathRules =
-                           ({-# LINE 206 "Order.ag" #-}
-                            _gathRules
-                            {-# LINE 400 "Order.hs" #-}
-                            )
-                   in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfield,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
--- Children ----------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
-         allnts               : [Identifier]
-         attrs                : [(Identifier,Identifier)]
-         con                  : Identifier
-         inh                  : Attributes
-         mergeMap             : Map Identifier (Identifier,[Identifier])
-         nt                   : Identifier
-         o_unbox              : Bool
-         syn                  : Attributes
-      synthesized attributes:
-         attributes           : [(Identifier,Attributes,Attributes)]
-         collectChildrenInhs  : Map Identifier Attributes 
-         collectChildrenSyns  : Map Identifier Attributes 
-         errors               : Seq Error
-         fields               : [(Identifier,Type,Maybe (Maybe Type))]
-         gathAltAttrs         : [AltAttr]
-         gathRules            : Seq CRule
-         inhs                 : Seq (Identifier,Attributes)
-         nts                  : Seq (Identifier,NontermIdent)
-         singlevisits         : [CRule]
-         terminals            : [Identifier]
-   alternatives:
-      alternative Cons:
-         child hd             : Child 
-         child tl             : Children 
-      alternative Nil:
--}
--- cata
-sem_Children :: Children  ->
-                T_Children 
-sem_Children list  =
-    (Prelude.foldr sem_Children_Cons sem_Children_Nil (Prelude.map sem_Child list) )
--- semantic domain
-newtype T_Children  = T_Children (([(Identifier,Type,Maybe (Maybe Type))]) ->
-                                  ([Identifier]) ->
-                                  ([(Identifier,Identifier)]) ->
-                                  Identifier ->
-                                  Attributes ->
-                                  (Map Identifier (Identifier,[Identifier])) ->
-                                  Identifier ->
-                                  Bool ->
-                                  Attributes ->
-                                  ( ([(Identifier,Attributes,Attributes)]),(Map Identifier Attributes ),(Map Identifier Attributes ),(Seq Error),([(Identifier,Type,Maybe (Maybe Type))]),([AltAttr]),(Seq CRule),(Seq (Identifier,Attributes)),(Seq (Identifier,NontermIdent)),([CRule]),([Identifier])))
-data Inh_Children  = Inh_Children {allfields_Inh_Children :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Children :: !(([Identifier])),attrs_Inh_Children :: !(([(Identifier,Identifier)])),con_Inh_Children :: !(Identifier),inh_Inh_Children :: !(Attributes),mergeMap_Inh_Children :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Children :: !(Identifier),o_unbox_Inh_Children :: !(Bool),syn_Inh_Children :: !(Attributes)}
-data Syn_Children  = Syn_Children {attributes_Syn_Children :: !(([(Identifier,Attributes,Attributes)])),collectChildrenInhs_Syn_Children :: !((Map Identifier Attributes )),collectChildrenSyns_Syn_Children :: !((Map Identifier Attributes )),errors_Syn_Children :: !((Seq Error)),fields_Syn_Children :: !(([(Identifier,Type,Maybe (Maybe Type))])),gathAltAttrs_Syn_Children :: !(([AltAttr])),gathRules_Syn_Children :: !((Seq CRule)),inhs_Syn_Children :: !((Seq (Identifier,Attributes))),nts_Syn_Children :: !((Seq (Identifier,NontermIdent))),singlevisits_Syn_Children :: !(([CRule])),terminals_Syn_Children :: !(([Identifier]))}
-wrap_Children :: T_Children  ->
-                 Inh_Children  ->
-                 Syn_Children 
-wrap_Children (T_Children sem ) (Inh_Children _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn )  =
-    (let ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn 
-     in  (Syn_Children _lhsOattributes _lhsOcollectChildrenInhs _lhsOcollectChildrenSyns _lhsOerrors _lhsOfields _lhsOgathAltAttrs _lhsOgathRules _lhsOinhs _lhsOnts _lhsOsinglevisits _lhsOterminals ))
-sem_Children_Cons :: T_Child  ->
-                     T_Children  ->
-                     T_Children 
-sem_Children_Cons (T_Child hd_ ) (T_Children tl_ )  =
-    (T_Children (\ _lhsIallfields
-                   _lhsIallnts
-                   _lhsIattrs
-                   _lhsIcon
-                   _lhsIinh
-                   _lhsImergeMap
-                   _lhsInt
-                   _lhsIo_unbox
-                   _lhsIsyn ->
-                     (let _lhsOfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                          _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
-                          _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
-                          _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
-                          _lhsOerrors :: (Seq Error)
-                          _lhsOgathAltAttrs :: ([AltAttr])
-                          _lhsOgathRules :: (Seq CRule)
-                          _lhsOinhs :: (Seq (Identifier,Attributes))
-                          _lhsOnts :: (Seq (Identifier,NontermIdent))
-                          _lhsOsinglevisits :: ([CRule])
-                          _lhsOterminals :: ([Identifier])
-                          _hdOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                          _hdOallnts :: ([Identifier])
-                          _hdOattrs :: ([(Identifier,Identifier)])
-                          _hdOcon :: Identifier
-                          _hdOinh :: Attributes
-                          _hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                          _hdOnt :: Identifier
-                          _hdOo_unbox :: Bool
-                          _hdOsyn :: Attributes
-                          _tlOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                          _tlOallnts :: ([Identifier])
-                          _tlOattrs :: ([(Identifier,Identifier)])
-                          _tlOcon :: Identifier
-                          _tlOinh :: Attributes
-                          _tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                          _tlOnt :: Identifier
-                          _tlOo_unbox :: Bool
-                          _tlOsyn :: Attributes
-                          _hdIattributes :: ([(Identifier,Attributes,Attributes)])
-                          _hdIcollectChildrenInhs :: (Map Identifier Attributes )
-                          _hdIcollectChildrenSyns :: (Map Identifier Attributes )
-                          _hdIerrors :: (Seq Error)
-                          _hdIfield :: ((Identifier,Type,Maybe (Maybe Type)))
-                          _hdIgathAltAttrs :: ([AltAttr])
-                          _hdIgathRules :: (Seq CRule)
-                          _hdIinhs :: (Seq (Identifier,Attributes))
-                          _hdInts :: (Seq (Identifier,NontermIdent))
-                          _hdIsinglevisits :: ([CRule])
-                          _hdIterminals :: ([Identifier])
-                          _tlIattributes :: ([(Identifier,Attributes,Attributes)])
-                          _tlIcollectChildrenInhs :: (Map Identifier Attributes )
-                          _tlIcollectChildrenSyns :: (Map Identifier Attributes )
-                          _tlIerrors :: (Seq Error)
-                          _tlIfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                          _tlIgathAltAttrs :: ([AltAttr])
-                          _tlIgathRules :: (Seq CRule)
-                          _tlIinhs :: (Seq (Identifier,Attributes))
-                          _tlInts :: (Seq (Identifier,NontermIdent))
-                          _tlIsinglevisits :: ([CRule])
-                          _tlIterminals :: ([Identifier])
-                          -- "Order.ag"(line 674, column 11)
-                          _lhsOfields =
-                              ({-# LINE 674 "Order.ag" #-}
-                               _hdIfield : _tlIfields
-                               {-# LINE 526 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 665, column 32)
-                          _lhsOattributes =
-                              ({-# LINE 665 "Order.ag" #-}
-                               _hdIattributes ++ _tlIattributes
-                               {-# LINE 532 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 344, column 68)
-                          _lhsOcollectChildrenInhs =
-                              ({-# LINE 344 "Order.ag" #-}
-                               _hdIcollectChildrenInhs `Map.union` _tlIcollectChildrenInhs
-                               {-# LINE 538 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 344, column 68)
-                          _lhsOcollectChildrenSyns =
-                              ({-# LINE 344 "Order.ag" #-}
-                               _hdIcollectChildrenSyns `Map.union` _tlIcollectChildrenSyns
-                               {-# LINE 544 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 84, column 70)
-                          _lhsOerrors =
-                              ({-# LINE 84 "Order.ag" #-}
-                               _hdIerrors Seq.>< _tlIerrors
-                               {-# LINE 550 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 170, column 68)
-                          _lhsOgathAltAttrs =
-                              ({-# LINE 170 "Order.ag" #-}
-                               _hdIgathAltAttrs ++ _tlIgathAltAttrs
-                               {-# LINE 556 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 206, column 23)
-                          _lhsOgathRules =
-                              ({-# LINE 206 "Order.ag" #-}
-                               _hdIgathRules Seq.>< _tlIgathRules
-                               {-# LINE 562 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 193, column 20)
-                          _lhsOinhs =
-                              ({-# LINE 193 "Order.ag" #-}
-                               _hdIinhs Seq.>< _tlIinhs
-                               {-# LINE 568 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 192, column 19)
-                          _lhsOnts =
-                              ({-# LINE 192 "Order.ag" #-}
-                               _hdInts Seq.>< _tlInts
-                               {-# LINE 574 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 611, column 40)
-                          _lhsOsinglevisits =
-                              ({-# LINE 611 "Order.ag" #-}
-                               _hdIsinglevisits ++ _tlIsinglevisits
-                               {-# LINE 580 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 636, column 38)
-                          _lhsOterminals =
-                              ({-# LINE 636 "Order.ag" #-}
-                               _hdIterminals ++ _tlIterminals
-                               {-# LINE 586 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOallfields =
-                              ({-# LINE 654 "Order.ag" #-}
-                               _lhsIallfields
-                               {-# LINE 592 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOallnts =
-                              ({-# LINE 647 "Order.ag" #-}
-                               _lhsIallnts
-                               {-# LINE 598 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOattrs =
-                              ({-# LINE 654 "Order.ag" #-}
-                               _lhsIattrs
-                               {-# LINE 604 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOcon =
-                              ({-# LINE 90 "Order.ag" #-}
-                               _lhsIcon
-                               {-# LINE 610 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOinh =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIinh
-                               {-# LINE 616 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOmergeMap =
-                              ({-# LINE 362 "Order.ag" #-}
-                               _lhsImergeMap
-                               {-# LINE 622 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOnt =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsInt
-                               {-# LINE 628 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOo_unbox =
-                              ({-# LINE 119 "Order.ag" #-}
-                               _lhsIo_unbox
-                               {-# LINE 634 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOsyn =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIsyn
-                               {-# LINE 640 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOallfields =
-                              ({-# LINE 654 "Order.ag" #-}
-                               _lhsIallfields
-                               {-# LINE 646 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOallnts =
-                              ({-# LINE 647 "Order.ag" #-}
-                               _lhsIallnts
-                               {-# LINE 652 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOattrs =
-                              ({-# LINE 654 "Order.ag" #-}
-                               _lhsIattrs
-                               {-# LINE 658 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOcon =
-                              ({-# LINE 90 "Order.ag" #-}
-                               _lhsIcon
-                               {-# LINE 664 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOinh =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIinh
-                               {-# LINE 670 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOmergeMap =
-                              ({-# LINE 362 "Order.ag" #-}
-                               _lhsImergeMap
-                               {-# LINE 676 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOnt =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsInt
-                               {-# LINE 682 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOo_unbox =
-                              ({-# LINE 119 "Order.ag" #-}
-                               _lhsIo_unbox
-                               {-# LINE 688 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOsyn =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIsyn
-                               {-# LINE 694 "Order.hs" #-}
-                               )
-                          ( _hdIattributes,_hdIcollectChildrenInhs,_hdIcollectChildrenSyns,_hdIerrors,_hdIfield,_hdIgathAltAttrs,_hdIgathRules,_hdIinhs,_hdInts,_hdIsinglevisits,_hdIterminals) =
-                              hd_ _hdOallfields _hdOallnts _hdOattrs _hdOcon _hdOinh _hdOmergeMap _hdOnt _hdOo_unbox _hdOsyn 
-                          ( _tlIattributes,_tlIcollectChildrenInhs,_tlIcollectChildrenSyns,_tlIerrors,_tlIfields,_tlIgathAltAttrs,_tlIgathRules,_tlIinhs,_tlInts,_tlIsinglevisits,_tlIterminals) =
-                              tl_ _tlOallfields _tlOallnts _tlOattrs _tlOcon _tlOinh _tlOmergeMap _tlOnt _tlOo_unbox _tlOsyn 
-                      in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
-sem_Children_Nil :: T_Children 
-sem_Children_Nil  =
-    (T_Children (\ _lhsIallfields
-                   _lhsIallnts
-                   _lhsIattrs
-                   _lhsIcon
-                   _lhsIinh
-                   _lhsImergeMap
-                   _lhsInt
-                   _lhsIo_unbox
-                   _lhsIsyn ->
-                     (let _lhsOfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                          _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
-                          _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
-                          _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
-                          _lhsOerrors :: (Seq Error)
-                          _lhsOgathAltAttrs :: ([AltAttr])
-                          _lhsOgathRules :: (Seq CRule)
-                          _lhsOinhs :: (Seq (Identifier,Attributes))
-                          _lhsOnts :: (Seq (Identifier,NontermIdent))
-                          _lhsOsinglevisits :: ([CRule])
-                          _lhsOterminals :: ([Identifier])
-                          -- "Order.ag"(line 675, column 11)
-                          _lhsOfields =
-                              ({-# LINE 675 "Order.ag" #-}
-                               []
-                               {-# LINE 727 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 665, column 32)
-                          _lhsOattributes =
-                              ({-# LINE 665 "Order.ag" #-}
-                               []
-                               {-# LINE 733 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 344, column 68)
-                          _lhsOcollectChildrenInhs =
-                              ({-# LINE 344 "Order.ag" #-}
-                               Map.empty
-                               {-# LINE 739 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 344, column 68)
-                          _lhsOcollectChildrenSyns =
-                              ({-# LINE 344 "Order.ag" #-}
-                               Map.empty
-                               {-# LINE 745 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 84, column 70)
-                          _lhsOerrors =
-                              ({-# LINE 84 "Order.ag" #-}
-                               Seq.empty
-                               {-# LINE 751 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 170, column 68)
-                          _lhsOgathAltAttrs =
-                              ({-# LINE 170 "Order.ag" #-}
-                               []
-                               {-# LINE 757 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 206, column 23)
-                          _lhsOgathRules =
-                              ({-# LINE 206 "Order.ag" #-}
-                               Seq.empty
-                               {-# LINE 763 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 193, column 20)
-                          _lhsOinhs =
-                              ({-# LINE 193 "Order.ag" #-}
-                               Seq.empty
-                               {-# LINE 769 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 192, column 19)
-                          _lhsOnts =
-                              ({-# LINE 192 "Order.ag" #-}
-                               Seq.empty
-                               {-# LINE 775 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 611, column 40)
-                          _lhsOsinglevisits =
-                              ({-# LINE 611 "Order.ag" #-}
-                               []
-                               {-# LINE 781 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 636, column 38)
-                          _lhsOterminals =
-                              ({-# LINE 636 "Order.ag" #-}
-                               []
-                               {-# LINE 787 "Order.hs" #-}
-                               )
-                      in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
--- Expression --------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
-         allnts               : [Identifier]
-         attrs                : [(Identifier,Identifier)]
-         con                  : Identifier
-         mergeMap             : Map Identifier (Identifier,[Identifier])
-         nt                   : Identifier
-      synthesized attributes:
-         allRhsVars           : Set (Identifier,Identifier)
-         copy                 : SELF 
-         errors               : Seq Error
-         textLines            : [String]
-         usedAttrs            : [(Identifier,Identifier)]
-         usedFields           : [Identifier]
-         usedLocals           : [Identifier]
-   alternatives:
-      alternative Expression:
-         child pos            : {Pos}
-         child tks            : {[HsToken]}
-         visit 0:
-            local _tup1       : _
-            local errors      : _
-            local textLines   : _
-            local usedAttrs   : _
-            local usedLocals  : _
-            local usedFields  : _
-            local copy        : _
--}
--- cata
-sem_Expression :: Expression  ->
-                  T_Expression 
-sem_Expression (Expression _pos _tks )  =
-    (sem_Expression_Expression _pos _tks )
--- semantic domain
-newtype T_Expression  = T_Expression (([(Identifier,Type,Maybe (Maybe Type))]) ->
-                                      ([Identifier]) ->
-                                      ([(Identifier,Identifier)]) ->
-                                      Identifier ->
-                                      (Map Identifier (Identifier,[Identifier])) ->
-                                      Identifier ->
-                                      ( (Set (Identifier,Identifier)),Expression ,(Seq Error),([String]),([(Identifier,Identifier)]),([Identifier]),([Identifier])))
-data Inh_Expression  = Inh_Expression {allfields_Inh_Expression :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Expression :: !(([Identifier])),attrs_Inh_Expression :: !(([(Identifier,Identifier)])),con_Inh_Expression :: !(Identifier),mergeMap_Inh_Expression :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Expression :: !(Identifier)}
-data Syn_Expression  = Syn_Expression {allRhsVars_Syn_Expression :: !((Set (Identifier,Identifier))),copy_Syn_Expression :: !(Expression ),errors_Syn_Expression :: !((Seq Error)),textLines_Syn_Expression :: !(([String])),usedAttrs_Syn_Expression :: !(([(Identifier,Identifier)])),usedFields_Syn_Expression :: !(([Identifier])),usedLocals_Syn_Expression :: !(([Identifier]))}
-wrap_Expression :: T_Expression  ->
-                   Inh_Expression  ->
-                   Syn_Expression 
-wrap_Expression (T_Expression sem ) (Inh_Expression _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt )  =
-    (let ( _lhsOallRhsVars,_lhsOcopy,_lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt 
-     in  (Syn_Expression _lhsOallRhsVars _lhsOcopy _lhsOerrors _lhsOtextLines _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
-sem_Expression_Expression :: Pos ->
-                             ([HsToken]) ->
-                             T_Expression 
-sem_Expression_Expression pos_ tks_  =
-    (T_Expression (\ _lhsIallfields
-                     _lhsIallnts
-                     _lhsIattrs
-                     _lhsIcon
-                     _lhsImergeMap
-                     _lhsInt ->
-                       (let _lhsOallRhsVars :: (Set (Identifier,Identifier))
-                            _lhsOcopy :: Expression 
-                            _lhsOerrors :: (Seq Error)
-                            _lhsOtextLines :: ([String])
-                            _lhsOusedAttrs :: ([(Identifier,Identifier)])
-                            _lhsOusedFields :: ([Identifier])
-                            _lhsOusedLocals :: ([Identifier])
-                            -- "Order.ag"(line 464, column 21)
-                            __tup1 =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 let mergedChildren = [ x | (_,xs) <- Map.elems _lhsImergeMap, x <- xs ]
-                                     attrsIn = filter (\(fld,_) -> not (fld `elem` mergedChildren)) _lhsIattrs
-                                     inherited = Inh_HsTokensRoot
-                                                 { attrs_Inh_HsTokensRoot      = attrsIn
-                                                 , con_Inh_HsTokensRoot        = _lhsIcon
-                                                 , allfields_Inh_HsTokensRoot  = _lhsIallfields
-                                                 , allnts_Inh_HsTokensRoot     = _lhsIallnts
-                                                 , nt_Inh_HsTokensRoot         = _lhsInt
-                                                 }
-                                     synthesized = wrap_HsTokensRoot (sem_HsTokensRoot (HsTokensRoot tks_)) inherited
-                                 in case synthesized of
-                                      Syn_HsTokensRoot
-                                       { errors_Syn_HsTokensRoot     = errors
-                                       , textLines_Syn_HsTokensRoot  = textLines
-                                       , usedAttrs_Syn_HsTokensRoot  = usedAttrs
-                                       , usedLocals_Syn_HsTokensRoot = usedLocals
-                                       , usedFields_Syn_HsTokensRoot = usedFields
-                                       }  -> let extraAttrs = [ (src,attr)
-                                                              | (fld,attr) <- usedAttrs, let mbMerged = Map.lookup fld _lhsImergeMap, isJust mbMerged
-                                                              , let (Just (_, srcs)) = mbMerged, src <- srcs ]
-                                                 usedAttrs' = usedAttrs ++ extraAttrs
-                                             in (errors,textLines,usedAttrs',usedLocals,usedFields)
-                                 {-# LINE 884 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 464, column 21)
-                            (_errors,_,_,_,_) =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 __tup1
-                                 {-# LINE 890 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 464, column 21)
-                            (_,_textLines,_,_,_) =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 __tup1
-                                 {-# LINE 896 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 464, column 21)
-                            (_,_,_usedAttrs,_,_) =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 __tup1
-                                 {-# LINE 902 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 464, column 21)
-                            (_,_,_,_usedLocals,_) =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 __tup1
-                                 {-# LINE 908 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 464, column 21)
-                            (_,_,_,_,_usedFields) =
-                                ({-# LINE 464 "Order.ag" #-}
-                                 __tup1
-                                 {-# LINE 914 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 488, column 17)
-                            _lhsOallRhsVars =
-                                ({-# LINE 488 "Order.ag" #-}
-                                 Set.fromList _usedAttrs
-                                 `Set.union`
-                                 Set.fromList [ (_LOC, l) | l <- _usedLocals    ]
-                                 `Set.union`
-                                 Set.fromList [ (_FIELD, fld) | fld <- _usedFields    ]
-                                 {-# LINE 924 "Order.hs" #-}
-                                 )
-                            -- self rule
-                            _copy =
-                                ({-# LINE 457 "Order.ag" #-}
-                                 Expression pos_ tks_
-                                 {-# LINE 930 "Order.hs" #-}
-                                 )
-                            -- self rule
-                            _lhsOcopy =
-                                ({-# LINE 457 "Order.ag" #-}
-                                 _copy
-                                 {-# LINE 936 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _lhsOerrors =
-                                ({-# LINE 452 "Order.ag" #-}
-                                 _errors
-                                 {-# LINE 942 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _lhsOtextLines =
-                                ({-# LINE 456 "Order.ag" #-}
-                                 _textLines
-                                 {-# LINE 948 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _lhsOusedAttrs =
-                                ({-# LINE 454 "Order.ag" #-}
-                                 _usedAttrs
-                                 {-# LINE 954 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _lhsOusedFields =
-                                ({-# LINE 455 "Order.ag" #-}
-                                 _usedFields
-                                 {-# LINE 960 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _lhsOusedLocals =
-                                ({-# LINE 453 "Order.ag" #-}
-                                 _usedLocals
-                                 {-# LINE 966 "Order.hs" #-}
-                                 )
-                        in  ( _lhsOallRhsVars,_lhsOcopy,_lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
--- Grammar -----------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         options              : Options
-      synthesized attributes:
-         errors               : Seq Error
-         nAutoRules           : Int
-         nExplicitRules       : Int
-         output               : CGrammar
-   alternatives:
-      alternative Grammar:
-         child typeSyns       : {TypeSyns}
-         child useMap         : {UseMap}
-         child derivings      : {Derivings}
-         child wrappers       : {Set NontermIdent}
-         child nonts          : Nonterminals 
-         child pragmas        : {PragmaMap}
-         child manualAttrOrderMap : {AttrOrderMap}
-         child paramMap       : {ParamMap}
-         child contextMap     : {ContextMap}
-         child quantMap       : {QuantMap}
-         child uniqueMap      : {UniqueMap}
-         child augmentsMap    : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
-         child aroundsMap     : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
-         child mergeMap       : {Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))}
-         visit 0:
-            local o_dovisit   : _
-            local ruleTable   : _
-            local attrTable   : _
-            local attrVertex  : _
-            local tdpToTds    : _
-            local tdsToTdp    : _
-            local directDep   : _
-            local instDep     : _
-            local aroundDep   : _
-            local mergeDep    : _
-            local info        : _
-            local _tup2       : _
-            local cInterfaceMap : _
-            local cVisitsMap  : _
-            local cyclesErrors : _
-            local aroundMap   : _
-            local mergeMap    : _
--}
--- cata
-sem_Grammar :: Grammar  ->
-               T_Grammar 
-sem_Grammar (Grammar _typeSyns _useMap _derivings _wrappers _nonts _pragmas _manualAttrOrderMap _paramMap _contextMap _quantMap _uniqueMap _augmentsMap _aroundsMap _mergeMap )  =
-    (sem_Grammar_Grammar _typeSyns _useMap _derivings _wrappers (sem_Nonterminals _nonts ) _pragmas _manualAttrOrderMap _paramMap _contextMap _quantMap _uniqueMap _augmentsMap _aroundsMap _mergeMap )
--- semantic domain
-newtype T_Grammar  = T_Grammar (Options ->
-                                ( (Seq Error),Int,Int,CGrammar))
-data Inh_Grammar  = Inh_Grammar {options_Inh_Grammar :: !(Options)}
-data Syn_Grammar  = Syn_Grammar {errors_Syn_Grammar :: !((Seq Error)),nAutoRules_Syn_Grammar :: !(Int),nExplicitRules_Syn_Grammar :: !(Int),output_Syn_Grammar :: !(CGrammar)}
-wrap_Grammar :: T_Grammar  ->
-                Inh_Grammar  ->
-                Syn_Grammar 
-wrap_Grammar (T_Grammar sem ) (Inh_Grammar _lhsIoptions )  =
-    (let ( _lhsOerrors,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOoutput) = sem _lhsIoptions 
-     in  (Syn_Grammar _lhsOerrors _lhsOnAutoRules _lhsOnExplicitRules _lhsOoutput ))
-sem_Grammar_Grammar :: TypeSyns ->
-                       UseMap ->
-                       Derivings ->
-                       (Set NontermIdent) ->
-                       T_Nonterminals  ->
-                       PragmaMap ->
-                       AttrOrderMap ->
-                       ParamMap ->
-                       ContextMap ->
-                       QuantMap ->
-                       UniqueMap ->
-                       (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
-                       (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
-                       (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))) ->
-                       T_Grammar 
-sem_Grammar_Grammar typeSyns_ useMap_ derivings_ wrappers_ (T_Nonterminals nonts_ ) pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_  =
-    (T_Grammar (\ _lhsIoptions ->
-                    (let _nontsOo_cata :: Bool
-                         _nontsOo_data :: Bool
-                         _nontsOo_sig :: Bool
-                         _nontsOo_sem :: Bool
-                         _nontsOo_rename :: Bool
-                         _nontsOo_newtypes :: Bool
-                         _nontsOo_wantvisit :: Bool
-                         _nontsOo_unbox :: Bool
-                         _nontsOo_case :: Bool
-                         _nontsOprefix :: String
-                         _nontsOvcount :: Int
-                         _nontsOmanualAttrDepMap :: AttrOrderMap
-                         _nontsOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
-                         _nontsOacount :: Int
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOoutput :: CGrammar
-                         _nontsOallnts :: ([Identifier])
-                         _lhsOnAutoRules :: Int
-                         _lhsOnExplicitRules :: Int
-                         _nontsOcInterfaceMap :: CInterfaceMap
-                         _nontsOcVisitsMap :: CVisitsMap
-                         _nontsOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
-                         _nontsOo_dovisit :: Bool
-                         _nontsIacount :: Int
-                         _nontsIadditionalDep :: (Seq Edge)
-                         _nontsIaranges :: (Seq (Int,Int,Int))
-                         _nontsIaroundDep :: (Seq Edge)
-                         _nontsIcNonterminals :: CNonterminals
-                         _nontsIdirectDep :: (Seq Edge)
-                         _nontsIerrors :: (Seq Error)
-                         _nontsIinstDep :: (Seq Edge)
-                         _nontsImergeDep :: (Seq Edge)
-                         _nontsInAutoRules :: Int
-                         _nontsInExplicitRules :: Int
-                         _nontsInonts :: ([(NontermIdent,[ConstructorIdent])])
-                         _nontsIntattrs :: (Seq (Vertex,NTAttr))
-                         _nontsIrules :: (Seq (Vertex,CRule))
-                         _nontsIvcount :: Int
-                         -- "Order.ag"(line 123, column 17)
-                         _o_dovisit =
-                             ({-# LINE 123 "Order.ag" #-}
-                              visit     _lhsIoptions && null _cyclesErrors
-                              {-# LINE 1089 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_cata =
-                             ({-# LINE 124 "Order.ag" #-}
-                              folds     _lhsIoptions
-                              {-# LINE 1095 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_data =
-                             ({-# LINE 125 "Order.ag" #-}
-                              dataTypes _lhsIoptions
-                              {-# LINE 1101 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_sig =
-                             ({-# LINE 126 "Order.ag" #-}
-                              typeSigs  _lhsIoptions
-                              {-# LINE 1107 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_sem =
-                             ({-# LINE 127 "Order.ag" #-}
-                              semfuns   _lhsIoptions
-                              {-# LINE 1113 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_rename =
-                             ({-# LINE 128 "Order.ag" #-}
-                              rename    _lhsIoptions
-                              {-# LINE 1119 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_newtypes =
-                             ({-# LINE 129 "Order.ag" #-}
-                              newtypes  _lhsIoptions
-                              {-# LINE 1125 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_wantvisit =
-                             ({-# LINE 130 "Order.ag" #-}
-                              visit   _lhsIoptions
-                              {-# LINE 1131 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_unbox =
-                             ({-# LINE 131 "Order.ag" #-}
-                              unbox     _lhsIoptions
-                              {-# LINE 1137 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOo_case =
-                             ({-# LINE 132 "Order.ag" #-}
-                              cases     _lhsIoptions
-                              {-# LINE 1143 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 124, column 17)
-                         _nontsOprefix =
-                             ({-# LINE 133 "Order.ag" #-}
-                              prefix    _lhsIoptions
-                              {-# LINE 1149 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 261, column 15)
-                         _nontsOvcount =
-                             ({-# LINE 261 "Order.ag" #-}
-                              0
-                              {-# LINE 1155 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 287, column 7)
-                         _nontsOmanualAttrDepMap =
-                             ({-# LINE 287 "Order.ag" #-}
-                              manualAttrOrderMap_
-                              {-# LINE 1161 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 416, column 14)
-                         _nontsOaroundMap =
-                             ({-# LINE 416 "Order.ag" #-}
-                              aroundsMap_
-                              {-# LINE 1167 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 503, column 13)
-                         _nontsOacount =
-                             ({-# LINE 503 "Order.ag" #-}
-                              0
-                              {-# LINE 1173 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 541, column 13)
-                         _ruleTable =
-                             ({-# LINE 541 "Order.ag" #-}
-                              Array.array (0,_nontsIvcount-1) (toList _nontsIrules)
-                              {-# LINE 1179 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 542, column 13)
-                         _attrTable =
-                             ({-# LINE 542 "Order.ag" #-}
-                              Array.array (0,_nontsIacount-1) (toList _nontsIntattrs)
-                              {-# LINE 1185 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 543, column 13)
-                         _attrVertex =
-                             ({-# LINE 543 "Order.ag" #-}
-                              Map.fromList (map swap (toList _nontsIntattrs))
-                              {-# LINE 1191 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 544, column 13)
-                         _tdpToTds =
-                             ({-# LINE 544 "Order.ag" #-}
-                              [ (s, maybe (-1) (\v -> findWithErr1 "Grammar.tdpToTds" v _attrVertex) (ntattr cr))
-                              | (s,cr) <- toList _nontsIrules]
-                              {-# LINE 1198 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 546, column 13)
-                         _tdsToTdp =
-                             ({-# LINE 546 "Order.ag" #-}
-                              let  eq (_,v) (_,v') = v == v'
-                                   conv ((s,v):svs)  | v == -1 = Nothing
-                                                     | otherwise = Just (v,s:map fst svs)
-                              in mapMaybe conv (eqClasses eq _tdpToTds)
-                              {-# LINE 1207 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 550, column 13)
-                         _directDep =
-                             ({-# LINE 550 "Order.ag" #-}
-                              toList (_nontsIdirectDep Seq.>< _nontsIadditionalDep)
-                              {-# LINE 1213 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 551, column 13)
-                         _instDep =
-                             ({-# LINE 551 "Order.ag" #-}
-                              toList _nontsIinstDep
-                              {-# LINE 1219 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 552, column 13)
-                         _aroundDep =
-                             ({-# LINE 552 "Order.ag" #-}
-                              toList _nontsIaroundDep
-                              {-# LINE 1225 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 553, column 13)
-                         _mergeDep =
-                             ({-# LINE 553 "Order.ag" #-}
-                              toList _nontsImergeDep
-                              {-# LINE 1231 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 554, column 13)
-                         _info =
-                             ({-# LINE 554 "Order.ag" #-}
-                              let def [] = -1
-                                  def (v:vs) = v
-                               in Info { tdsToTdp   = Array.array (0,_nontsIacount-1) _tdsToTdp
-                                       , tdpToTds   = Array.array (0,_nontsIvcount-1) _tdpToTds
-                                       , attrTable  = _attrTable
-                                       , ruleTable  = _ruleTable
-                                       , lmh        = toList _nontsIaranges
-                                       , nonts      = _nontsInonts
-                                       , wraps      = wrappers_
-                                       }
-                              {-# LINE 1246 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 565, column 17)
-                         __tup2 =
-                             ({-# LINE 565 "Order.ag" #-}
-                              case computeSequential _info _directDep (_instDep ++ _aroundDep ++ _mergeDep    ) of
-                                           CycleFree    cim cvm   -> ( cim
-                                                                     , cvm
-                                                                     , []
-                                                                     )
-                                           LocalCycle   errs      -> ( error "No interfaces for AG with local cycles"
-                                                                     , error "No visit sub-sequences for AG with local cycles"
-                                                                     , map (localCycleErr _ruleTable (visit _lhsIoptions)) errs
-                                                                     )
-                                           InstCycle    errs      -> ( error "No interfaces for AG with cycles through insts"
-                                                                     , error "No visit sub-sequences for AG with cycles through insts"
-                                                                     , map (instCycleErr _ruleTable (visit _lhsIoptions)) errs
-                                                                     )
-                                           DirectCycle  errs      -> ( error "No interfaces for AG with direct cycles"
-                                                                     , error "No visit sub-sequences for AG with direct cycles"
-                                                                     , directCycleErrs _attrTable _ruleTable (visit _lhsIoptions) errs
-                                                                     )
-                                           InducedCycle cim errs ->  ( cim
-                                                                     , error "No visit sub-sequences for AG with induced cycles"
-                                                                     , inducedCycleErrs _attrTable _ruleTable cim errs
-                                                                     )
-                              {-# LINE 1272 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 565, column 17)
-                         (_cInterfaceMap,_,_) =
-                             ({-# LINE 565 "Order.ag" #-}
-                              __tup2
-                              {-# LINE 1278 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 565, column 17)
-                         (_,_cVisitsMap,_) =
-                             ({-# LINE 565 "Order.ag" #-}
-                              __tup2
-                              {-# LINE 1284 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 565, column 17)
-                         (_,_,_cyclesErrors) =
-                             ({-# LINE 565 "Order.ag" #-}
-                              __tup2
-                              {-# LINE 1290 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 587, column 13)
-                         _lhsOerrors =
-                             ({-# LINE 587 "Order.ag" #-}
-                              (if withCycle _lhsIoptions then Seq.fromList _cyclesErrors else Seq.empty)
-                              Seq.>< _nontsIerrors
-                              {-# LINE 1297 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 619, column 15)
-                         _lhsOoutput =
-                             ({-# LINE 619 "Order.ag" #-}
-                              CGrammar typeSyns_ derivings_ wrappers_ _nontsIcNonterminals pragmas_ paramMap_ contextMap_ quantMap_ _aroundMap     _mergeMap     _o_dovisit
-                              {-# LINE 1303 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 632, column 14)
-                         _aroundMap =
-                             ({-# LINE 632 "Order.ag" #-}
-                              Map.map (Map.map Map.keysSet) aroundsMap_
-                              {-# LINE 1309 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 633, column 14)
-                         _mergeMap =
-                             ({-# LINE 633 "Order.ag" #-}
-                              Map.map (Map.map (Map.map (\(nt,srcs,_) -> (nt,srcs)))) mergeMap_
-                              {-# LINE 1315 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 650, column 13)
-                         _nontsOallnts =
-                             ({-# LINE 650 "Order.ag" #-}
-                              map fst (_nontsInonts)
-                              {-# LINE 1321 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 61, column 105)
-                         _lhsOnAutoRules =
-                             ({-# LINE 61 "Order.ag" #-}
-                              _nontsInAutoRules
-                              {-# LINE 1327 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 61, column 105)
-                         _lhsOnExplicitRules =
-                             ({-# LINE 61 "Order.ag" #-}
-                              _nontsInExplicitRules
-                              {-# LINE 1333 "Order.hs" #-}
-                              )
-                         -- copy rule (from local)
-                         _nontsOcInterfaceMap =
-                             ({-# LINE 594 "Order.ag" #-}
-                              _cInterfaceMap
-                              {-# LINE 1339 "Order.hs" #-}
-                              )
-                         -- copy rule (from local)
-                         _nontsOcVisitsMap =
-                             ({-# LINE 601 "Order.ag" #-}
-                              _cVisitsMap
-                              {-# LINE 1345 "Order.hs" #-}
-                              )
-                         -- copy rule (from local)
-                         _nontsOmergeMap =
-                             ({-# LINE 354 "Order.ag" #-}
-                              _mergeMap
-                              {-# LINE 1351 "Order.hs" #-}
-                              )
-                         -- copy rule (from local)
-                         _nontsOo_dovisit =
-                             ({-# LINE 116 "Order.ag" #-}
-                              _o_dovisit
-                              {-# LINE 1357 "Order.hs" #-}
-                              )
-                         ( _nontsIacount,_nontsIadditionalDep,_nontsIaranges,_nontsIaroundDep,_nontsIcNonterminals,_nontsIdirectDep,_nontsIerrors,_nontsIinstDep,_nontsImergeDep,_nontsInAutoRules,_nontsInExplicitRules,_nontsInonts,_nontsIntattrs,_nontsIrules,_nontsIvcount) =
-                             nonts_ _nontsOacount _nontsOallnts _nontsOaroundMap _nontsOcInterfaceMap _nontsOcVisitsMap _nontsOmanualAttrDepMap _nontsOmergeMap _nontsOo_case _nontsOo_cata _nontsOo_data _nontsOo_dovisit _nontsOo_newtypes _nontsOo_rename _nontsOo_sem _nontsOo_sig _nontsOo_unbox _nontsOo_wantvisit _nontsOprefix _nontsOvcount 
-                     in  ( _lhsOerrors,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOoutput))) )
--- Nonterminal -------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allnts               : [Identifier]
-         aroundMap            : Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
-         cInterfaceMap        : CInterfaceMap
-         cVisitsMap           : CVisitsMap
-         manualAttrDepMap     : AttrOrderMap
-         mergeMap             : Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
-         o_case               : Bool
-         o_cata               : Bool
-         o_data               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_unbox              : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-      chained attributes:
-         acount               : Int
-         vcount               : Int
-      synthesized attributes:
-         additionalDep        : Seq Edge
-         aranges              : Seq (Int,Int,Int)
-         aroundDep            : Seq Edge
-         cNonterminal         : CNonterminal
-         directDep            : Seq Edge
-         errors               : Seq Error
-         instDep              : Seq Edge
-         mergeDep             : Seq Edge
-         nAutoRules           : Int
-         nExplicitRules       : Int
-         nonts                : [(NontermIdent,[ConstructorIdent])]
-         ntattrs              : Seq (Vertex,NTAttr)
-         rules                : Seq (Vertex,CRule)
-   alternatives:
-      alternative Nonterminal:
-         child nt             : {NontermIdent}
-         child params         : {[Identifier]}
-         child inh            : {Attributes}
-         child syn            : {Attributes}
-         child prods          : Productions 
-         visit 0:
-            local mergeMap    : _
-            local aroundMap   : _
-            local ntattrs     : _
-            local cInter      : _
--}
--- cata
-sem_Nonterminal :: Nonterminal  ->
-                   T_Nonterminal 
-sem_Nonterminal (Nonterminal _nt _params _inh _syn _prods )  =
-    (sem_Nonterminal_Nonterminal _nt _params _inh _syn (sem_Productions _prods ) )
--- semantic domain
-newtype T_Nonterminal  = T_Nonterminal (Int ->
-                                        ([Identifier]) ->
-                                        (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
-                                        CInterfaceMap ->
-                                        CVisitsMap ->
-                                        AttrOrderMap ->
-                                        (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        String ->
-                                        Int ->
-                                        ( Int,(Seq Edge),(Seq (Int,Int,Int)),(Seq Edge),CNonterminal,(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,([(NontermIdent,[ConstructorIdent])]),(Seq (Vertex,NTAttr)),(Seq (Vertex,CRule)),Int))
-data Inh_Nonterminal  = Inh_Nonterminal {acount_Inh_Nonterminal :: !(Int),allnts_Inh_Nonterminal :: !(([Identifier])),aroundMap_Inh_Nonterminal :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))),cInterfaceMap_Inh_Nonterminal :: !(CInterfaceMap),cVisitsMap_Inh_Nonterminal :: !(CVisitsMap),manualAttrDepMap_Inh_Nonterminal :: !(AttrOrderMap),mergeMap_Inh_Nonterminal :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))),o_case_Inh_Nonterminal :: !(Bool),o_cata_Inh_Nonterminal :: !(Bool),o_data_Inh_Nonterminal :: !(Bool),o_dovisit_Inh_Nonterminal :: !(Bool),o_newtypes_Inh_Nonterminal :: !(Bool),o_rename_Inh_Nonterminal :: !(Bool),o_sem_Inh_Nonterminal :: !(Bool),o_sig_Inh_Nonterminal :: !(Bool),o_unbox_Inh_Nonterminal :: !(Bool),o_wantvisit_Inh_Nonterminal :: !(Bool),prefix_Inh_Nonterminal :: !(String),vcount_Inh_Nonterminal :: !(Int)}
-data Syn_Nonterminal  = Syn_Nonterminal {acount_Syn_Nonterminal :: !(Int),additionalDep_Syn_Nonterminal :: !((Seq Edge)),aranges_Syn_Nonterminal :: !((Seq (Int,Int,Int))),aroundDep_Syn_Nonterminal :: !((Seq Edge)),cNonterminal_Syn_Nonterminal :: !(CNonterminal),directDep_Syn_Nonterminal :: !((Seq Edge)),errors_Syn_Nonterminal :: !((Seq Error)),instDep_Syn_Nonterminal :: !((Seq Edge)),mergeDep_Syn_Nonterminal :: !((Seq Edge)),nAutoRules_Syn_Nonterminal :: !(Int),nExplicitRules_Syn_Nonterminal :: !(Int),nonts_Syn_Nonterminal :: !(([(NontermIdent,[ConstructorIdent])])),ntattrs_Syn_Nonterminal :: !((Seq (Vertex,NTAttr))),rules_Syn_Nonterminal :: !((Seq (Vertex,CRule))),vcount_Syn_Nonterminal :: !(Int)}
-wrap_Nonterminal :: T_Nonterminal  ->
-                    Inh_Nonterminal  ->
-                    Syn_Nonterminal 
-wrap_Nonterminal (T_Nonterminal sem ) (Inh_Nonterminal _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount )  =
-    (let ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminal,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount) = sem _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount 
-     in  (Syn_Nonterminal _lhsOacount _lhsOadditionalDep _lhsOaranges _lhsOaroundDep _lhsOcNonterminal _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOnonts _lhsOntattrs _lhsOrules _lhsOvcount ))
-sem_Nonterminal_Nonterminal :: NontermIdent ->
-                               ([Identifier]) ->
-                               Attributes ->
-                               Attributes ->
-                               T_Productions  ->
-                               T_Nonterminal 
-sem_Nonterminal_Nonterminal nt_ params_ inh_ syn_ (T_Productions prods_ )  =
-    (T_Nonterminal (\ _lhsIacount
-                      _lhsIallnts
-                      _lhsIaroundMap
-                      _lhsIcInterfaceMap
-                      _lhsIcVisitsMap
-                      _lhsImanualAttrDepMap
-                      _lhsImergeMap
-                      _lhsIo_case
-                      _lhsIo_cata
-                      _lhsIo_data
-                      _lhsIo_dovisit
-                      _lhsIo_newtypes
-                      _lhsIo_rename
-                      _lhsIo_sem
-                      _lhsIo_sig
-                      _lhsIo_unbox
-                      _lhsIo_wantvisit
-                      _lhsIprefix
-                      _lhsIvcount ->
-                        (let _prodsOnt :: Identifier
-                             _prodsOinh :: Attributes
-                             _prodsOsyn :: Attributes
-                             _lhsOntattrs :: (Seq (Vertex,NTAttr))
-                             _lhsOacount :: Int
-                             _lhsOaranges :: (Seq (Int,Int,Int))
-                             _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
-                             _lhsOcNonterminal :: CNonterminal
-                             _lhsOadditionalDep :: (Seq Edge)
-                             _lhsOaroundDep :: (Seq Edge)
-                             _lhsOdirectDep :: (Seq Edge)
-                             _lhsOerrors :: (Seq Error)
-                             _lhsOinstDep :: (Seq Edge)
-                             _lhsOmergeDep :: (Seq Edge)
-                             _lhsOnAutoRules :: Int
-                             _lhsOnExplicitRules :: Int
-                             _lhsOrules :: (Seq (Vertex,CRule))
-                             _lhsOvcount :: Int
-                             _prodsOallnts :: ([Identifier])
-                             _prodsOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
-                             _prodsOcVisitsMap :: CVisitsMap
-                             _prodsOmanualAttrDepMap :: AttrOrderMap
-                             _prodsOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
-                             _prodsOo_case :: Bool
-                             _prodsOo_cata :: Bool
-                             _prodsOo_dovisit :: Bool
-                             _prodsOo_newtypes :: Bool
-                             _prodsOo_rename :: Bool
-                             _prodsOo_sem :: Bool
-                             _prodsOo_sig :: Bool
-                             _prodsOo_unbox :: Bool
-                             _prodsOo_wantvisit :: Bool
-                             _prodsOprefix :: String
-                             _prodsOvcount :: Int
-                             _prodsIadditionalDep :: (Seq Edge)
-                             _prodsIaroundDep :: (Seq Edge)
-                             _prodsIcProductions :: CProductions
-                             _prodsIcons :: ([ConstructorIdent])
-                             _prodsIdirectDep :: (Seq Edge)
-                             _prodsIerrors :: (Seq Error)
-                             _prodsIinstDep :: (Seq Edge)
-                             _prodsImergeDep :: (Seq Edge)
-                             _prodsInAutoRules :: Int
-                             _prodsInExplicitRules :: Int
-                             _prodsIrules :: (Seq (Vertex,CRule))
-                             _prodsIvcount :: Int
-                             -- "Order.ag"(line 97, column 17)
-                             _prodsOnt =
-                                 ({-# LINE 97 "Order.ag" #-}
-                                  nt_
-                                  {-# LINE 1523 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 100, column 17)
-                             _prodsOinh =
-                                 ({-# LINE 100 "Order.ag" #-}
-                                  inh_
-                                  {-# LINE 1529 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 101, column 17)
-                             _prodsOsyn =
-                                 ({-# LINE 101 "Order.ag" #-}
-                                  syn_
-                                  {-# LINE 1535 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 359, column 32)
-                             _mergeMap =
-                                 ({-# LINE 359 "Order.ag" #-}
-                                  Map.findWithDefault Map.empty nt_ _lhsImergeMap
-                                  {-# LINE 1541 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 412, column 32)
-                             _aroundMap =
-                                 ({-# LINE 412 "Order.ag" #-}
-                                  Map.findWithDefault Map.empty nt_ _lhsIaroundMap
-                                  {-# LINE 1547 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 506, column 17)
-                             _ntattrs =
-                                 ({-# LINE 506 "Order.ag" #-}
-                                  [ NTAInh nt_ inh tp | (inh,tp) <- Map.assocs inh_ ]
-                                  ++ [NTASyn nt_ syn tp | (syn,tp) <- Map.assocs syn_ ]
-                                  {-# LINE 1554 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 508, column 17)
-                             _lhsOntattrs =
-                                 ({-# LINE 508 "Order.ag" #-}
-                                  Seq.fromList (zip [_lhsIacount ..] _ntattrs)
-                                  {-# LINE 1560 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 509, column 17)
-                             _lhsOacount =
-                                 ({-# LINE 509 "Order.ag" #-}
-                                  _lhsIacount + Map.size inh_ + Map.size syn_
-                                  {-# LINE 1566 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 510, column 17)
-                             _lhsOaranges =
-                                 ({-# LINE 510 "Order.ag" #-}
-                                  Seq.singleton
-                                   (_lhsIacount
-                                   ,_lhsIacount + Map.size inh_
-                                   ,_lhsIacount + Map.size syn_ + Map.size inh_ - 1)
-                                  {-# LINE 1575 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 519, column 19)
-                             _lhsOnonts =
-                                 ({-# LINE 519 "Order.ag" #-}
-                                  [(nt_,_prodsIcons)]
-                                  {-# LINE 1581 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 596, column 19)
-                             _cInter =
-                                 ({-# LINE 596 "Order.ag" #-}
-                                  if  _lhsIo_dovisit
-                                         then findWithErr1 "Nonterminal.cInter" nt_ _lhsIcInterfaceMap
-                                         else CInterface [CSegment inh_ syn_]
-                                  {-# LINE 1589 "Order.hs" #-}
-                                  )
-                             -- "Order.ag"(line 624, column 19)
-                             _lhsOcNonterminal =
-                                 ({-# LINE 624 "Order.ag" #-}
-                                  CNonterminal nt_ params_ inh_ syn_ _prodsIcProductions _cInter
-                                  {-# LINE 1595 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 283, column 60)
-                             _lhsOadditionalDep =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  _prodsIadditionalDep
-                                  {-# LINE 1601 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 404, column 24)
-                             _lhsOaroundDep =
-                                 ({-# LINE 404 "Order.ag" #-}
-                                  _prodsIaroundDep
-                                  {-# LINE 1607 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 269, column 33)
-                             _lhsOdirectDep =
-                                 ({-# LINE 269 "Order.ag" #-}
-                                  _prodsIdirectDep
-                                  {-# LINE 1613 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 84, column 70)
-                             _lhsOerrors =
-                                 ({-# LINE 84 "Order.ag" #-}
-                                  _prodsIerrors
-                                  {-# LINE 1619 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 312, column 31)
-                             _lhsOinstDep =
-                                 ({-# LINE 312 "Order.ag" #-}
-                                  _prodsIinstDep
-                                  {-# LINE 1625 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 367, column 18)
-                             _lhsOmergeDep =
-                                 ({-# LINE 367 "Order.ag" #-}
-                                  _prodsImergeDep
-                                  {-# LINE 1631 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnAutoRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  _prodsInAutoRules
-                                  {-# LINE 1637 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnExplicitRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  _prodsInExplicitRules
-                                  {-# LINE 1643 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 259, column 18)
-                             _lhsOrules =
-                                 ({-# LINE 259 "Order.ag" #-}
-                                  _prodsIrules
-                                  {-# LINE 1649 "Order.hs" #-}
-                                  )
-                             -- copy rule (up)
-                             _lhsOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _prodsIvcount
-                                  {-# LINE 1655 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOallnts =
-                                 ({-# LINE 647 "Order.ag" #-}
-                                  _lhsIallnts
-                                  {-# LINE 1661 "Order.hs" #-}
-                                  )
-                             -- copy rule (from local)
-                             _prodsOaroundMap =
-                                 ({-# LINE 410 "Order.ag" #-}
-                                  _aroundMap
-                                  {-# LINE 1667 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOcVisitsMap =
-                                 ({-# LINE 601 "Order.ag" #-}
-                                  _lhsIcVisitsMap
-                                  {-# LINE 1673 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOmanualAttrDepMap =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  _lhsImanualAttrDepMap
-                                  {-# LINE 1679 "Order.hs" #-}
-                                  )
-                             -- copy rule (from local)
-                             _prodsOmergeMap =
-                                 ({-# LINE 357 "Order.ag" #-}
-                                  _mergeMap
-                                  {-# LINE 1685 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_case =
-                                 ({-# LINE 117 "Order.ag" #-}
-                                  _lhsIo_case
-                                  {-# LINE 1691 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_cata =
-                                 ({-# LINE 111 "Order.ag" #-}
-                                  _lhsIo_cata
-                                  {-# LINE 1697 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_dovisit =
-                                 ({-# LINE 116 "Order.ag" #-}
-                                  _lhsIo_dovisit
-                                  {-# LINE 1703 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_newtypes =
-                                 ({-# LINE 110 "Order.ag" #-}
-                                  _lhsIo_newtypes
-                                  {-# LINE 1709 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_rename =
-                                 ({-# LINE 114 "Order.ag" #-}
-                                  _lhsIo_rename
-                                  {-# LINE 1715 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_sem =
-                                 ({-# LINE 113 "Order.ag" #-}
-                                  _lhsIo_sem
-                                  {-# LINE 1721 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_sig =
-                                 ({-# LINE 112 "Order.ag" #-}
-                                  _lhsIo_sig
-                                  {-# LINE 1727 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_unbox =
-                                 ({-# LINE 119 "Order.ag" #-}
-                                  _lhsIo_unbox
-                                  {-# LINE 1733 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOo_wantvisit =
-                                 ({-# LINE 115 "Order.ag" #-}
-                                  _lhsIo_wantvisit
-                                  {-# LINE 1739 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOprefix =
-                                 ({-# LINE 118 "Order.ag" #-}
-                                  _lhsIprefix
-                                  {-# LINE 1745 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _prodsOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _lhsIvcount
-                                  {-# LINE 1751 "Order.hs" #-}
-                                  )
-                             ( _prodsIadditionalDep,_prodsIaroundDep,_prodsIcProductions,_prodsIcons,_prodsIdirectDep,_prodsIerrors,_prodsIinstDep,_prodsImergeDep,_prodsInAutoRules,_prodsInExplicitRules,_prodsIrules,_prodsIvcount) =
-                                 prods_ _prodsOallnts _prodsOaroundMap _prodsOcVisitsMap _prodsOinh _prodsOmanualAttrDepMap _prodsOmergeMap _prodsOnt _prodsOo_case _prodsOo_cata _prodsOo_dovisit _prodsOo_newtypes _prodsOo_rename _prodsOo_sem _prodsOo_sig _prodsOo_unbox _prodsOo_wantvisit _prodsOprefix _prodsOsyn _prodsOvcount 
-                         in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminal,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
--- Nonterminals ------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allnts               : [Identifier]
-         aroundMap            : Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
-         cInterfaceMap        : CInterfaceMap
-         cVisitsMap           : CVisitsMap
-         manualAttrDepMap     : AttrOrderMap
-         mergeMap             : Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
-         o_case               : Bool
-         o_cata               : Bool
-         o_data               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_unbox              : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-      chained attributes:
-         acount               : Int
-         vcount               : Int
-      synthesized attributes:
-         additionalDep        : Seq Edge
-         aranges              : Seq (Int,Int,Int)
-         aroundDep            : Seq Edge
-         cNonterminals        : CNonterminals
-         directDep            : Seq Edge
-         errors               : Seq Error
-         instDep              : Seq Edge
-         mergeDep             : Seq Edge
-         nAutoRules           : Int
-         nExplicitRules       : Int
-         nonts                : [(NontermIdent,[ConstructorIdent])]
-         ntattrs              : Seq (Vertex,NTAttr)
-         rules                : Seq (Vertex,CRule)
-   alternatives:
-      alternative Cons:
-         child hd             : Nonterminal 
-         child tl             : Nonterminals 
-      alternative Nil:
--}
--- cata
-sem_Nonterminals :: Nonterminals  ->
-                    T_Nonterminals 
-sem_Nonterminals list  =
-    (Prelude.foldr sem_Nonterminals_Cons sem_Nonterminals_Nil (Prelude.map sem_Nonterminal list) )
--- semantic domain
-newtype T_Nonterminals  = T_Nonterminals (Int ->
-                                          ([Identifier]) ->
-                                          (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
-                                          CInterfaceMap ->
-                                          CVisitsMap ->
-                                          AttrOrderMap ->
-                                          (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          Bool ->
-                                          String ->
-                                          Int ->
-                                          ( Int,(Seq Edge),(Seq (Int,Int,Int)),(Seq Edge),CNonterminals,(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,([(NontermIdent,[ConstructorIdent])]),(Seq (Vertex,NTAttr)),(Seq (Vertex,CRule)),Int))
-data Inh_Nonterminals  = Inh_Nonterminals {acount_Inh_Nonterminals :: !(Int),allnts_Inh_Nonterminals :: !(([Identifier])),aroundMap_Inh_Nonterminals :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))),cInterfaceMap_Inh_Nonterminals :: !(CInterfaceMap),cVisitsMap_Inh_Nonterminals :: !(CVisitsMap),manualAttrDepMap_Inh_Nonterminals :: !(AttrOrderMap),mergeMap_Inh_Nonterminals :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))),o_case_Inh_Nonterminals :: !(Bool),o_cata_Inh_Nonterminals :: !(Bool),o_data_Inh_Nonterminals :: !(Bool),o_dovisit_Inh_Nonterminals :: !(Bool),o_newtypes_Inh_Nonterminals :: !(Bool),o_rename_Inh_Nonterminals :: !(Bool),o_sem_Inh_Nonterminals :: !(Bool),o_sig_Inh_Nonterminals :: !(Bool),o_unbox_Inh_Nonterminals :: !(Bool),o_wantvisit_Inh_Nonterminals :: !(Bool),prefix_Inh_Nonterminals :: !(String),vcount_Inh_Nonterminals :: !(Int)}
-data Syn_Nonterminals  = Syn_Nonterminals {acount_Syn_Nonterminals :: !(Int),additionalDep_Syn_Nonterminals :: !((Seq Edge)),aranges_Syn_Nonterminals :: !((Seq (Int,Int,Int))),aroundDep_Syn_Nonterminals :: !((Seq Edge)),cNonterminals_Syn_Nonterminals :: !(CNonterminals),directDep_Syn_Nonterminals :: !((Seq Edge)),errors_Syn_Nonterminals :: !((Seq Error)),instDep_Syn_Nonterminals :: !((Seq Edge)),mergeDep_Syn_Nonterminals :: !((Seq Edge)),nAutoRules_Syn_Nonterminals :: !(Int),nExplicitRules_Syn_Nonterminals :: !(Int),nonts_Syn_Nonterminals :: !(([(NontermIdent,[ConstructorIdent])])),ntattrs_Syn_Nonterminals :: !((Seq (Vertex,NTAttr))),rules_Syn_Nonterminals :: !((Seq (Vertex,CRule))),vcount_Syn_Nonterminals :: !(Int)}
-wrap_Nonterminals :: T_Nonterminals  ->
-                     Inh_Nonterminals  ->
-                     Syn_Nonterminals 
-wrap_Nonterminals (T_Nonterminals sem ) (Inh_Nonterminals _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount )  =
-    (let ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount) = sem _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount 
-     in  (Syn_Nonterminals _lhsOacount _lhsOadditionalDep _lhsOaranges _lhsOaroundDep _lhsOcNonterminals _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOnonts _lhsOntattrs _lhsOrules _lhsOvcount ))
-sem_Nonterminals_Cons :: T_Nonterminal  ->
-                         T_Nonterminals  ->
-                         T_Nonterminals 
-sem_Nonterminals_Cons (T_Nonterminal hd_ ) (T_Nonterminals tl_ )  =
-    (T_Nonterminals (\ _lhsIacount
-                       _lhsIallnts
-                       _lhsIaroundMap
-                       _lhsIcInterfaceMap
-                       _lhsIcVisitsMap
-                       _lhsImanualAttrDepMap
-                       _lhsImergeMap
-                       _lhsIo_case
-                       _lhsIo_cata
-                       _lhsIo_data
-                       _lhsIo_dovisit
-                       _lhsIo_newtypes
-                       _lhsIo_rename
-                       _lhsIo_sem
-                       _lhsIo_sig
-                       _lhsIo_unbox
-                       _lhsIo_wantvisit
-                       _lhsIprefix
-                       _lhsIvcount ->
-                         (let _lhsOcNonterminals :: CNonterminals
-                              _lhsOadditionalDep :: (Seq Edge)
-                              _lhsOaranges :: (Seq (Int,Int,Int))
-                              _lhsOaroundDep :: (Seq Edge)
-                              _lhsOdirectDep :: (Seq Edge)
-                              _lhsOerrors :: (Seq Error)
-                              _lhsOinstDep :: (Seq Edge)
-                              _lhsOmergeDep :: (Seq Edge)
-                              _lhsOnAutoRules :: Int
-                              _lhsOnExplicitRules :: Int
-                              _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
-                              _lhsOntattrs :: (Seq (Vertex,NTAttr))
-                              _lhsOrules :: (Seq (Vertex,CRule))
-                              _lhsOacount :: Int
-                              _lhsOvcount :: Int
-                              _hdOacount :: Int
-                              _hdOallnts :: ([Identifier])
-                              _hdOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
-                              _hdOcInterfaceMap :: CInterfaceMap
-                              _hdOcVisitsMap :: CVisitsMap
-                              _hdOmanualAttrDepMap :: AttrOrderMap
-                              _hdOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
-                              _hdOo_case :: Bool
-                              _hdOo_cata :: Bool
-                              _hdOo_data :: Bool
-                              _hdOo_dovisit :: Bool
-                              _hdOo_newtypes :: Bool
-                              _hdOo_rename :: Bool
-                              _hdOo_sem :: Bool
-                              _hdOo_sig :: Bool
-                              _hdOo_unbox :: Bool
-                              _hdOo_wantvisit :: Bool
-                              _hdOprefix :: String
-                              _hdOvcount :: Int
-                              _tlOacount :: Int
-                              _tlOallnts :: ([Identifier])
-                              _tlOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
-                              _tlOcInterfaceMap :: CInterfaceMap
-                              _tlOcVisitsMap :: CVisitsMap
-                              _tlOmanualAttrDepMap :: AttrOrderMap
-                              _tlOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
-                              _tlOo_case :: Bool
-                              _tlOo_cata :: Bool
-                              _tlOo_data :: Bool
-                              _tlOo_dovisit :: Bool
-                              _tlOo_newtypes :: Bool
-                              _tlOo_rename :: Bool
-                              _tlOo_sem :: Bool
-                              _tlOo_sig :: Bool
-                              _tlOo_unbox :: Bool
-                              _tlOo_wantvisit :: Bool
-                              _tlOprefix :: String
-                              _tlOvcount :: Int
-                              _hdIacount :: Int
-                              _hdIadditionalDep :: (Seq Edge)
-                              _hdIaranges :: (Seq (Int,Int,Int))
-                              _hdIaroundDep :: (Seq Edge)
-                              _hdIcNonterminal :: CNonterminal
-                              _hdIdirectDep :: (Seq Edge)
-                              _hdIerrors :: (Seq Error)
-                              _hdIinstDep :: (Seq Edge)
-                              _hdImergeDep :: (Seq Edge)
-                              _hdInAutoRules :: Int
-                              _hdInExplicitRules :: Int
-                              _hdInonts :: ([(NontermIdent,[ConstructorIdent])])
-                              _hdIntattrs :: (Seq (Vertex,NTAttr))
-                              _hdIrules :: (Seq (Vertex,CRule))
-                              _hdIvcount :: Int
-                              _tlIacount :: Int
-                              _tlIadditionalDep :: (Seq Edge)
-                              _tlIaranges :: (Seq (Int,Int,Int))
-                              _tlIaroundDep :: (Seq Edge)
-                              _tlIcNonterminals :: CNonterminals
-                              _tlIdirectDep :: (Seq Edge)
-                              _tlIerrors :: (Seq Error)
-                              _tlIinstDep :: (Seq Edge)
-                              _tlImergeDep :: (Seq Edge)
-                              _tlInAutoRules :: Int
-                              _tlInExplicitRules :: Int
-                              _tlInonts :: ([(NontermIdent,[ConstructorIdent])])
-                              _tlIntattrs :: (Seq (Vertex,NTAttr))
-                              _tlIrules :: (Seq (Vertex,CRule))
-                              _tlIvcount :: Int
-                              -- "Order.ag"(line 621, column 12)
-                              _lhsOcNonterminals =
-                                  ({-# LINE 621 "Order.ag" #-}
-                                   _hdIcNonterminal : _tlIcNonterminals
-                                   {-# LINE 1944 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 283, column 60)
-                              _lhsOadditionalDep =
-                                  ({-# LINE 283 "Order.ag" #-}
-                                   _hdIadditionalDep Seq.>< _tlIadditionalDep
-                                   {-# LINE 1950 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 500, column 36)
-                              _lhsOaranges =
-                                  ({-# LINE 500 "Order.ag" #-}
-                                   _hdIaranges Seq.>< _tlIaranges
-                                   {-# LINE 1956 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 404, column 24)
-                              _lhsOaroundDep =
-                                  ({-# LINE 404 "Order.ag" #-}
-                                   _hdIaroundDep Seq.>< _tlIaroundDep
-                                   {-# LINE 1962 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 269, column 33)
-                              _lhsOdirectDep =
-                                  ({-# LINE 269 "Order.ag" #-}
-                                   _hdIdirectDep Seq.>< _tlIdirectDep
-                                   {-# LINE 1968 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 84, column 70)
-                              _lhsOerrors =
-                                  ({-# LINE 84 "Order.ag" #-}
-                                   _hdIerrors Seq.>< _tlIerrors
-                                   {-# LINE 1974 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 312, column 31)
-                              _lhsOinstDep =
-                                  ({-# LINE 312 "Order.ag" #-}
-                                   _hdIinstDep Seq.>< _tlIinstDep
-                                   {-# LINE 1980 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 367, column 18)
-                              _lhsOmergeDep =
-                                  ({-# LINE 367 "Order.ag" #-}
-                                   _hdImergeDep Seq.>< _tlImergeDep
-                                   {-# LINE 1986 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 61, column 105)
-                              _lhsOnAutoRules =
-                                  ({-# LINE 61 "Order.ag" #-}
-                                   _hdInAutoRules + _tlInAutoRules
-                                   {-# LINE 1992 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 61, column 105)
-                              _lhsOnExplicitRules =
-                                  ({-# LINE 61 "Order.ag" #-}
-                                   _hdInExplicitRules + _tlInExplicitRules
-                                   {-# LINE 1998 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 517, column 43)
-                              _lhsOnonts =
-                                  ({-# LINE 517 "Order.ag" #-}
-                                   _hdInonts ++ _tlInonts
-                                   {-# LINE 2004 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 499, column 35)
-                              _lhsOntattrs =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   _hdIntattrs Seq.>< _tlIntattrs
-                                   {-# LINE 2010 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 259, column 18)
-                              _lhsOrules =
-                                  ({-# LINE 259 "Order.ag" #-}
-                                   _hdIrules Seq.>< _tlIrules
-                                   {-# LINE 2016 "Order.hs" #-}
-                                   )
-                              -- copy rule (up)
-                              _lhsOacount =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   _tlIacount
-                                   {-# LINE 2022 "Order.hs" #-}
-                                   )
-                              -- copy rule (up)
-                              _lhsOvcount =
-                                  ({-# LINE 258 "Order.ag" #-}
-                                   _tlIvcount
-                                   {-# LINE 2028 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOacount =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   _lhsIacount
-                                   {-# LINE 2034 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOallnts =
-                                  ({-# LINE 647 "Order.ag" #-}
-                                   _lhsIallnts
-                                   {-# LINE 2040 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOaroundMap =
-                                  ({-# LINE 407 "Order.ag" #-}
-                                   _lhsIaroundMap
-                                   {-# LINE 2046 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOcInterfaceMap =
-                                  ({-# LINE 594 "Order.ag" #-}
-                                   _lhsIcInterfaceMap
-                                   {-# LINE 2052 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOcVisitsMap =
-                                  ({-# LINE 601 "Order.ag" #-}
-                                   _lhsIcVisitsMap
-                                   {-# LINE 2058 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOmanualAttrDepMap =
-                                  ({-# LINE 283 "Order.ag" #-}
-                                   _lhsImanualAttrDepMap
-                                   {-# LINE 2064 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOmergeMap =
-                                  ({-# LINE 354 "Order.ag" #-}
-                                   _lhsImergeMap
-                                   {-# LINE 2070 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_case =
-                                  ({-# LINE 117 "Order.ag" #-}
-                                   _lhsIo_case
-                                   {-# LINE 2076 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_cata =
-                                  ({-# LINE 111 "Order.ag" #-}
-                                   _lhsIo_cata
-                                   {-# LINE 2082 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_data =
-                                  ({-# LINE 120 "Order.ag" #-}
-                                   _lhsIo_data
-                                   {-# LINE 2088 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_dovisit =
-                                  ({-# LINE 116 "Order.ag" #-}
-                                   _lhsIo_dovisit
-                                   {-# LINE 2094 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_newtypes =
-                                  ({-# LINE 110 "Order.ag" #-}
-                                   _lhsIo_newtypes
-                                   {-# LINE 2100 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_rename =
-                                  ({-# LINE 114 "Order.ag" #-}
-                                   _lhsIo_rename
-                                   {-# LINE 2106 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_sem =
-                                  ({-# LINE 113 "Order.ag" #-}
-                                   _lhsIo_sem
-                                   {-# LINE 2112 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_sig =
-                                  ({-# LINE 112 "Order.ag" #-}
-                                   _lhsIo_sig
-                                   {-# LINE 2118 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_unbox =
-                                  ({-# LINE 119 "Order.ag" #-}
-                                   _lhsIo_unbox
-                                   {-# LINE 2124 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOo_wantvisit =
-                                  ({-# LINE 115 "Order.ag" #-}
-                                   _lhsIo_wantvisit
-                                   {-# LINE 2130 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOprefix =
-                                  ({-# LINE 118 "Order.ag" #-}
-                                   _lhsIprefix
-                                   {-# LINE 2136 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _hdOvcount =
-                                  ({-# LINE 258 "Order.ag" #-}
-                                   _lhsIvcount
-                                   {-# LINE 2142 "Order.hs" #-}
-                                   )
-                              -- copy rule (chain)
-                              _tlOacount =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   _hdIacount
-                                   {-# LINE 2148 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOallnts =
-                                  ({-# LINE 647 "Order.ag" #-}
-                                   _lhsIallnts
-                                   {-# LINE 2154 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOaroundMap =
-                                  ({-# LINE 407 "Order.ag" #-}
-                                   _lhsIaroundMap
-                                   {-# LINE 2160 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOcInterfaceMap =
-                                  ({-# LINE 594 "Order.ag" #-}
-                                   _lhsIcInterfaceMap
-                                   {-# LINE 2166 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOcVisitsMap =
-                                  ({-# LINE 601 "Order.ag" #-}
-                                   _lhsIcVisitsMap
-                                   {-# LINE 2172 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOmanualAttrDepMap =
-                                  ({-# LINE 283 "Order.ag" #-}
-                                   _lhsImanualAttrDepMap
-                                   {-# LINE 2178 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOmergeMap =
-                                  ({-# LINE 354 "Order.ag" #-}
-                                   _lhsImergeMap
-                                   {-# LINE 2184 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_case =
-                                  ({-# LINE 117 "Order.ag" #-}
-                                   _lhsIo_case
-                                   {-# LINE 2190 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_cata =
-                                  ({-# LINE 111 "Order.ag" #-}
-                                   _lhsIo_cata
-                                   {-# LINE 2196 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_data =
-                                  ({-# LINE 120 "Order.ag" #-}
-                                   _lhsIo_data
-                                   {-# LINE 2202 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_dovisit =
-                                  ({-# LINE 116 "Order.ag" #-}
-                                   _lhsIo_dovisit
-                                   {-# LINE 2208 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_newtypes =
-                                  ({-# LINE 110 "Order.ag" #-}
-                                   _lhsIo_newtypes
-                                   {-# LINE 2214 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_rename =
-                                  ({-# LINE 114 "Order.ag" #-}
-                                   _lhsIo_rename
-                                   {-# LINE 2220 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_sem =
-                                  ({-# LINE 113 "Order.ag" #-}
-                                   _lhsIo_sem
-                                   {-# LINE 2226 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_sig =
-                                  ({-# LINE 112 "Order.ag" #-}
-                                   _lhsIo_sig
-                                   {-# LINE 2232 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_unbox =
-                                  ({-# LINE 119 "Order.ag" #-}
-                                   _lhsIo_unbox
-                                   {-# LINE 2238 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOo_wantvisit =
-                                  ({-# LINE 115 "Order.ag" #-}
-                                   _lhsIo_wantvisit
-                                   {-# LINE 2244 "Order.hs" #-}
-                                   )
-                              -- copy rule (down)
-                              _tlOprefix =
-                                  ({-# LINE 118 "Order.ag" #-}
-                                   _lhsIprefix
-                                   {-# LINE 2250 "Order.hs" #-}
-                                   )
-                              -- copy rule (chain)
-                              _tlOvcount =
-                                  ({-# LINE 258 "Order.ag" #-}
-                                   _hdIvcount
-                                   {-# LINE 2256 "Order.hs" #-}
-                                   )
-                              ( _hdIacount,_hdIadditionalDep,_hdIaranges,_hdIaroundDep,_hdIcNonterminal,_hdIdirectDep,_hdIerrors,_hdIinstDep,_hdImergeDep,_hdInAutoRules,_hdInExplicitRules,_hdInonts,_hdIntattrs,_hdIrules,_hdIvcount) =
-                                  hd_ _hdOacount _hdOallnts _hdOaroundMap _hdOcInterfaceMap _hdOcVisitsMap _hdOmanualAttrDepMap _hdOmergeMap _hdOo_case _hdOo_cata _hdOo_data _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_unbox _hdOo_wantvisit _hdOprefix _hdOvcount 
-                              ( _tlIacount,_tlIadditionalDep,_tlIaranges,_tlIaroundDep,_tlIcNonterminals,_tlIdirectDep,_tlIerrors,_tlIinstDep,_tlImergeDep,_tlInAutoRules,_tlInExplicitRules,_tlInonts,_tlIntattrs,_tlIrules,_tlIvcount) =
-                                  tl_ _tlOacount _tlOallnts _tlOaroundMap _tlOcInterfaceMap _tlOcVisitsMap _tlOmanualAttrDepMap _tlOmergeMap _tlOo_case _tlOo_cata _tlOo_data _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_unbox _tlOo_wantvisit _tlOprefix _tlOvcount 
-                          in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
-sem_Nonterminals_Nil :: T_Nonterminals 
-sem_Nonterminals_Nil  =
-    (T_Nonterminals (\ _lhsIacount
-                       _lhsIallnts
-                       _lhsIaroundMap
-                       _lhsIcInterfaceMap
-                       _lhsIcVisitsMap
-                       _lhsImanualAttrDepMap
-                       _lhsImergeMap
-                       _lhsIo_case
-                       _lhsIo_cata
-                       _lhsIo_data
-                       _lhsIo_dovisit
-                       _lhsIo_newtypes
-                       _lhsIo_rename
-                       _lhsIo_sem
-                       _lhsIo_sig
-                       _lhsIo_unbox
-                       _lhsIo_wantvisit
-                       _lhsIprefix
-                       _lhsIvcount ->
-                         (let _lhsOcNonterminals :: CNonterminals
-                              _lhsOadditionalDep :: (Seq Edge)
-                              _lhsOaranges :: (Seq (Int,Int,Int))
-                              _lhsOaroundDep :: (Seq Edge)
-                              _lhsOdirectDep :: (Seq Edge)
-                              _lhsOerrors :: (Seq Error)
-                              _lhsOinstDep :: (Seq Edge)
-                              _lhsOmergeDep :: (Seq Edge)
-                              _lhsOnAutoRules :: Int
-                              _lhsOnExplicitRules :: Int
-                              _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
-                              _lhsOntattrs :: (Seq (Vertex,NTAttr))
-                              _lhsOrules :: (Seq (Vertex,CRule))
-                              _lhsOacount :: Int
-                              _lhsOvcount :: Int
-                              -- "Order.ag"(line 622, column 12)
-                              _lhsOcNonterminals =
-                                  ({-# LINE 622 "Order.ag" #-}
-                                   []
-                                   {-# LINE 2303 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 283, column 60)
-                              _lhsOadditionalDep =
-                                  ({-# LINE 283 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2309 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 500, column 36)
-                              _lhsOaranges =
-                                  ({-# LINE 500 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2315 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 404, column 24)
-                              _lhsOaroundDep =
-                                  ({-# LINE 404 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2321 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 269, column 33)
-                              _lhsOdirectDep =
-                                  ({-# LINE 269 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2327 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 84, column 70)
-                              _lhsOerrors =
-                                  ({-# LINE 84 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2333 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 312, column 31)
-                              _lhsOinstDep =
-                                  ({-# LINE 312 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2339 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 367, column 18)
-                              _lhsOmergeDep =
-                                  ({-# LINE 367 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2345 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 61, column 105)
-                              _lhsOnAutoRules =
-                                  ({-# LINE 61 "Order.ag" #-}
-                                   0
-                                   {-# LINE 2351 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 61, column 105)
-                              _lhsOnExplicitRules =
-                                  ({-# LINE 61 "Order.ag" #-}
-                                   0
-                                   {-# LINE 2357 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 517, column 43)
-                              _lhsOnonts =
-                                  ({-# LINE 517 "Order.ag" #-}
-                                   []
-                                   {-# LINE 2363 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 499, column 35)
-                              _lhsOntattrs =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2369 "Order.hs" #-}
-                                   )
-                              -- use rule "Order.ag"(line 259, column 18)
-                              _lhsOrules =
-                                  ({-# LINE 259 "Order.ag" #-}
-                                   Seq.empty
-                                   {-# LINE 2375 "Order.hs" #-}
-                                   )
-                              -- copy rule (chain)
-                              _lhsOacount =
-                                  ({-# LINE 499 "Order.ag" #-}
-                                   _lhsIacount
-                                   {-# LINE 2381 "Order.hs" #-}
-                                   )
-                              -- copy rule (chain)
-                              _lhsOvcount =
-                                  ({-# LINE 258 "Order.ag" #-}
-                                   _lhsIvcount
-                                   {-# LINE 2387 "Order.hs" #-}
-                                   )
-                          in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
--- Pattern -----------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allTypeSigs          : Map Identifier Type
-         altAttrs             : Map AltAttr Vertex
-         con                  : Identifier
-         inh                  : Attributes
-         nt                   : Identifier
-         syn                  : Attributes
-      synthesized attributes:
-         copy                 : SELF 
-         errors               : Seq Error
-         gathAltAttrs         : [AltAttr]
-         instVars             : [Identifier]
-         locVars              : [Identifier]
-         patternAttrs         : [(Identifier,Identifier,Bool,Patterns)]
-   alternatives:
-      alternative Alias:
-         child field          : {Identifier}
-         child attr           : {Identifier}
-         child pat            : Pattern 
-         child parts          : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Constr:
-         child name           : {ConstructorIdent}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Irrefutable:
-         child pat            : Pattern 
-         visit 0:
-            local copy        : _
-      alternative Product:
-         child pos            : {Pos}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Underscore:
-         child pos            : {Pos}
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Pattern :: Pattern  ->
-               T_Pattern 
-sem_Pattern (Alias _field _attr _pat _parts )  =
-    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
-sem_Pattern (Constr _name _pats )  =
-    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
-sem_Pattern (Irrefutable _pat )  =
-    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
-sem_Pattern (Product _pos _pats )  =
-    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
-sem_Pattern (Underscore _pos )  =
-    (sem_Pattern_Underscore _pos )
--- semantic domain
-newtype T_Pattern  = T_Pattern ((Map Identifier Type) ->
-                                (Map AltAttr Vertex) ->
-                                Identifier ->
-                                Attributes ->
-                                Identifier ->
-                                Attributes ->
-                                ( Pattern ,(Seq Error),([AltAttr]),([Identifier]),([Identifier]),([(Identifier,Identifier,Bool,Patterns)])))
-data Inh_Pattern  = Inh_Pattern {allTypeSigs_Inh_Pattern :: !((Map Identifier Type)),altAttrs_Inh_Pattern :: !((Map AltAttr Vertex)),con_Inh_Pattern :: !(Identifier),inh_Inh_Pattern :: !(Attributes),nt_Inh_Pattern :: !(Identifier),syn_Inh_Pattern :: !(Attributes)}
-data Syn_Pattern  = Syn_Pattern {copy_Syn_Pattern :: !(Pattern ),errors_Syn_Pattern :: !((Seq Error)),gathAltAttrs_Syn_Pattern :: !(([AltAttr])),instVars_Syn_Pattern :: !(([Identifier])),locVars_Syn_Pattern :: !(([Identifier])),patternAttrs_Syn_Pattern :: !(([(Identifier,Identifier,Bool,Patterns)]))}
-wrap_Pattern :: T_Pattern  ->
-                Inh_Pattern  ->
-                Syn_Pattern 
-wrap_Pattern (T_Pattern sem ) (Inh_Pattern _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn )  =
-    (let ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs) = sem _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn 
-     in  (Syn_Pattern _lhsOcopy _lhsOerrors _lhsOgathAltAttrs _lhsOinstVars _lhsOlocVars _lhsOpatternAttrs ))
-sem_Pattern_Alias :: Identifier ->
-                     Identifier ->
-                     T_Pattern  ->
-                     T_Patterns  ->
-                     T_Pattern 
-sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
-    (T_Pattern (\ _lhsIallTypeSigs
-                  _lhsIaltAttrs
-                  _lhsIcon
-                  _lhsIinh
-                  _lhsInt
-                  _lhsIsyn ->
-                    (let _lhsOgathAltAttrs :: ([AltAttr])
-                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _lhsOlocVars :: ([Identifier])
-                         _lhsOinstVars :: ([Identifier])
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOcopy :: Pattern 
-                         _patOallTypeSigs :: (Map Identifier Type)
-                         _patOaltAttrs :: (Map AltAttr Vertex)
-                         _patOcon :: Identifier
-                         _patOinh :: Attributes
-                         _patOnt :: Identifier
-                         _patOsyn :: Attributes
-                         _partsOallTypeSigs :: (Map Identifier Type)
-                         _partsOaltAttrs :: (Map AltAttr Vertex)
-                         _partsOcon :: Identifier
-                         _partsOinh :: Attributes
-                         _partsOnt :: Identifier
-                         _partsOsyn :: Attributes
-                         _patIcopy :: Pattern 
-                         _patIerrors :: (Seq Error)
-                         _patIgathAltAttrs :: ([AltAttr])
-                         _patIinstVars :: ([Identifier])
-                         _patIlocVars :: ([Identifier])
-                         _patIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _partsIcopy :: Patterns 
-                         _partsIerrors :: (Seq Error)
-                         _partsIgathAltAttrs :: ([AltAttr])
-                         _partsIinstVars :: ([Identifier])
-                         _partsIlocVars :: ([Identifier])
-                         _partsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         -- "Order.ag"(line 184, column 12)
-                         _lhsOgathAltAttrs =
-                             ({-# LINE 184 "Order.ag" #-}
-                              [AltAttr field_ attr_ (field_ == _LOC || field_ == _INST)]
-                              {-# LINE 2509 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 252, column 12)
-                         _lhsOpatternAttrs =
-                             ({-# LINE 252 "Order.ag" #-}
-                              [(field_,attr_,(field_ == _LOC || field_ == _INST),_partsIcopy)]
-                              {-# LINE 2515 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 680, column 14)
-                         _lhsOlocVars =
-                             ({-# LINE 680 "Order.ag" #-}
-                              if field_ == _LOC
-                                 then [attr_]
-                                 else []
-                              {-# LINE 2523 "Order.hs" #-}
-                              )
-                         -- "Order.ag"(line 683, column 14)
-                         _lhsOinstVars =
-                             ({-# LINE 683 "Order.ag" #-}
-                              if field_ == _INST
-                                 then [attr_]
-                                 else []
-                              {-# LINE 2531 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 84, column 70)
-                         _lhsOerrors =
-                             ({-# LINE 84 "Order.ag" #-}
-                              _patIerrors Seq.>< _partsIerrors
-                              {-# LINE 2537 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _copy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              Alias field_ attr_ _patIcopy _partsIcopy
-                              {-# LINE 2543 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _lhsOcopy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              _copy
-                              {-# LINE 2549 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOallTypeSigs =
-                             ({-# LINE 533 "Order.ag" #-}
-                              _lhsIallTypeSigs
-                              {-# LINE 2555 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOaltAttrs =
-                             ({-# LINE 186 "Order.ag" #-}
-                              _lhsIaltAttrs
-                              {-# LINE 2561 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOcon =
-                             ({-# LINE 90 "Order.ag" #-}
-                              _lhsIcon
-                              {-# LINE 2567 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOinh =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIinh
-                              {-# LINE 2573 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOnt =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsInt
-                              {-# LINE 2579 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOsyn =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIsyn
-                              {-# LINE 2585 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOallTypeSigs =
-                             ({-# LINE 533 "Order.ag" #-}
-                              _lhsIallTypeSigs
-                              {-# LINE 2591 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOaltAttrs =
-                             ({-# LINE 186 "Order.ag" #-}
-                              _lhsIaltAttrs
-                              {-# LINE 2597 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOcon =
-                             ({-# LINE 90 "Order.ag" #-}
-                              _lhsIcon
-                              {-# LINE 2603 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOinh =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIinh
-                              {-# LINE 2609 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOnt =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsInt
-                              {-# LINE 2615 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _partsOsyn =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIsyn
-                              {-# LINE 2621 "Order.hs" #-}
-                              )
-                         ( _patIcopy,_patIerrors,_patIgathAltAttrs,_patIinstVars,_patIlocVars,_patIpatternAttrs) =
-                             pat_ _patOallTypeSigs _patOaltAttrs _patOcon _patOinh _patOnt _patOsyn 
-                         ( _partsIcopy,_partsIerrors,_partsIgathAltAttrs,_partsIinstVars,_partsIlocVars,_partsIpatternAttrs) =
-                             parts_ _partsOallTypeSigs _partsOaltAttrs _partsOcon _partsOinh _partsOnt _partsOsyn 
-                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
-sem_Pattern_Constr :: ConstructorIdent ->
-                      T_Patterns  ->
-                      T_Pattern 
-sem_Pattern_Constr name_ (T_Patterns pats_ )  =
-    (T_Pattern (\ _lhsIallTypeSigs
-                  _lhsIaltAttrs
-                  _lhsIcon
-                  _lhsIinh
-                  _lhsInt
-                  _lhsIsyn ->
-                    (let _lhsOerrors :: (Seq Error)
-                         _lhsOgathAltAttrs :: ([AltAttr])
-                         _lhsOinstVars :: ([Identifier])
-                         _lhsOlocVars :: ([Identifier])
-                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _lhsOcopy :: Pattern 
-                         _patsOallTypeSigs :: (Map Identifier Type)
-                         _patsOaltAttrs :: (Map AltAttr Vertex)
-                         _patsOcon :: Identifier
-                         _patsOinh :: Attributes
-                         _patsOnt :: Identifier
-                         _patsOsyn :: Attributes
-                         _patsIcopy :: Patterns 
-                         _patsIerrors :: (Seq Error)
-                         _patsIgathAltAttrs :: ([AltAttr])
-                         _patsIinstVars :: ([Identifier])
-                         _patsIlocVars :: ([Identifier])
-                         _patsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         -- use rule "Order.ag"(line 84, column 70)
-                         _lhsOerrors =
-                             ({-# LINE 84 "Order.ag" #-}
-                              _patsIerrors
-                              {-# LINE 2660 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 170, column 68)
-                         _lhsOgathAltAttrs =
-                             ({-# LINE 170 "Order.ag" #-}
-                              _patsIgathAltAttrs
-                              {-# LINE 2666 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 86)
-                         _lhsOinstVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patsIinstVars
-                              {-# LINE 2672 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 48)
-                         _lhsOlocVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patsIlocVars
-                              {-# LINE 2678 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 249, column 42)
-                         _lhsOpatternAttrs =
-                             ({-# LINE 249 "Order.ag" #-}
-                              _patsIpatternAttrs
-                              {-# LINE 2684 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _copy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              Constr name_ _patsIcopy
-                              {-# LINE 2690 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _lhsOcopy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              _copy
-                              {-# LINE 2696 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOallTypeSigs =
-                             ({-# LINE 533 "Order.ag" #-}
-                              _lhsIallTypeSigs
-                              {-# LINE 2702 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOaltAttrs =
-                             ({-# LINE 186 "Order.ag" #-}
-                              _lhsIaltAttrs
-                              {-# LINE 2708 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOcon =
-                             ({-# LINE 90 "Order.ag" #-}
-                              _lhsIcon
-                              {-# LINE 2714 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOinh =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIinh
-                              {-# LINE 2720 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOnt =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsInt
-                              {-# LINE 2726 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOsyn =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIsyn
-                              {-# LINE 2732 "Order.hs" #-}
-                              )
-                         ( _patsIcopy,_patsIerrors,_patsIgathAltAttrs,_patsIinstVars,_patsIlocVars,_patsIpatternAttrs) =
-                             pats_ _patsOallTypeSigs _patsOaltAttrs _patsOcon _patsOinh _patsOnt _patsOsyn 
-                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
-sem_Pattern_Irrefutable :: T_Pattern  ->
-                           T_Pattern 
-sem_Pattern_Irrefutable (T_Pattern pat_ )  =
-    (T_Pattern (\ _lhsIallTypeSigs
-                  _lhsIaltAttrs
-                  _lhsIcon
-                  _lhsIinh
-                  _lhsInt
-                  _lhsIsyn ->
-                    (let _lhsOerrors :: (Seq Error)
-                         _lhsOgathAltAttrs :: ([AltAttr])
-                         _lhsOinstVars :: ([Identifier])
-                         _lhsOlocVars :: ([Identifier])
-                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _lhsOcopy :: Pattern 
-                         _patOallTypeSigs :: (Map Identifier Type)
-                         _patOaltAttrs :: (Map AltAttr Vertex)
-                         _patOcon :: Identifier
-                         _patOinh :: Attributes
-                         _patOnt :: Identifier
-                         _patOsyn :: Attributes
-                         _patIcopy :: Pattern 
-                         _patIerrors :: (Seq Error)
-                         _patIgathAltAttrs :: ([AltAttr])
-                         _patIinstVars :: ([Identifier])
-                         _patIlocVars :: ([Identifier])
-                         _patIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         -- use rule "Order.ag"(line 84, column 70)
-                         _lhsOerrors =
-                             ({-# LINE 84 "Order.ag" #-}
-                              _patIerrors
-                              {-# LINE 2768 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 170, column 68)
-                         _lhsOgathAltAttrs =
-                             ({-# LINE 170 "Order.ag" #-}
-                              _patIgathAltAttrs
-                              {-# LINE 2774 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 86)
-                         _lhsOinstVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patIinstVars
-                              {-# LINE 2780 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 48)
-                         _lhsOlocVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patIlocVars
-                              {-# LINE 2786 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 249, column 42)
-                         _lhsOpatternAttrs =
-                             ({-# LINE 249 "Order.ag" #-}
-                              _patIpatternAttrs
-                              {-# LINE 2792 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _copy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              Irrefutable _patIcopy
-                              {-# LINE 2798 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _lhsOcopy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              _copy
-                              {-# LINE 2804 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOallTypeSigs =
-                             ({-# LINE 533 "Order.ag" #-}
-                              _lhsIallTypeSigs
-                              {-# LINE 2810 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOaltAttrs =
-                             ({-# LINE 186 "Order.ag" #-}
-                              _lhsIaltAttrs
-                              {-# LINE 2816 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOcon =
-                             ({-# LINE 90 "Order.ag" #-}
-                              _lhsIcon
-                              {-# LINE 2822 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOinh =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIinh
-                              {-# LINE 2828 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOnt =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsInt
-                              {-# LINE 2834 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patOsyn =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIsyn
-                              {-# LINE 2840 "Order.hs" #-}
-                              )
-                         ( _patIcopy,_patIerrors,_patIgathAltAttrs,_patIinstVars,_patIlocVars,_patIpatternAttrs) =
-                             pat_ _patOallTypeSigs _patOaltAttrs _patOcon _patOinh _patOnt _patOsyn 
-                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
-sem_Pattern_Product :: Pos ->
-                       T_Patterns  ->
-                       T_Pattern 
-sem_Pattern_Product pos_ (T_Patterns pats_ )  =
-    (T_Pattern (\ _lhsIallTypeSigs
-                  _lhsIaltAttrs
-                  _lhsIcon
-                  _lhsIinh
-                  _lhsInt
-                  _lhsIsyn ->
-                    (let _lhsOerrors :: (Seq Error)
-                         _lhsOgathAltAttrs :: ([AltAttr])
-                         _lhsOinstVars :: ([Identifier])
-                         _lhsOlocVars :: ([Identifier])
-                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _lhsOcopy :: Pattern 
-                         _patsOallTypeSigs :: (Map Identifier Type)
-                         _patsOaltAttrs :: (Map AltAttr Vertex)
-                         _patsOcon :: Identifier
-                         _patsOinh :: Attributes
-                         _patsOnt :: Identifier
-                         _patsOsyn :: Attributes
-                         _patsIcopy :: Patterns 
-                         _patsIerrors :: (Seq Error)
-                         _patsIgathAltAttrs :: ([AltAttr])
-                         _patsIinstVars :: ([Identifier])
-                         _patsIlocVars :: ([Identifier])
-                         _patsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         -- use rule "Order.ag"(line 84, column 70)
-                         _lhsOerrors =
-                             ({-# LINE 84 "Order.ag" #-}
-                              _patsIerrors
-                              {-# LINE 2877 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 170, column 68)
-                         _lhsOgathAltAttrs =
-                             ({-# LINE 170 "Order.ag" #-}
-                              _patsIgathAltAttrs
-                              {-# LINE 2883 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 86)
-                         _lhsOinstVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patsIinstVars
-                              {-# LINE 2889 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 48)
-                         _lhsOlocVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              _patsIlocVars
-                              {-# LINE 2895 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 249, column 42)
-                         _lhsOpatternAttrs =
-                             ({-# LINE 249 "Order.ag" #-}
-                              _patsIpatternAttrs
-                              {-# LINE 2901 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _copy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              Product pos_ _patsIcopy
-                              {-# LINE 2907 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _lhsOcopy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              _copy
-                              {-# LINE 2913 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOallTypeSigs =
-                             ({-# LINE 533 "Order.ag" #-}
-                              _lhsIallTypeSigs
-                              {-# LINE 2919 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOaltAttrs =
-                             ({-# LINE 186 "Order.ag" #-}
-                              _lhsIaltAttrs
-                              {-# LINE 2925 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOcon =
-                             ({-# LINE 90 "Order.ag" #-}
-                              _lhsIcon
-                              {-# LINE 2931 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOinh =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIinh
-                              {-# LINE 2937 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOnt =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsInt
-                              {-# LINE 2943 "Order.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _patsOsyn =
-                             ({-# LINE 89 "Order.ag" #-}
-                              _lhsIsyn
-                              {-# LINE 2949 "Order.hs" #-}
-                              )
-                         ( _patsIcopy,_patsIerrors,_patsIgathAltAttrs,_patsIinstVars,_patsIlocVars,_patsIpatternAttrs) =
-                             pats_ _patsOallTypeSigs _patsOaltAttrs _patsOcon _patsOinh _patsOnt _patsOsyn 
-                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
-sem_Pattern_Underscore :: Pos ->
-                          T_Pattern 
-sem_Pattern_Underscore pos_  =
-    (T_Pattern (\ _lhsIallTypeSigs
-                  _lhsIaltAttrs
-                  _lhsIcon
-                  _lhsIinh
-                  _lhsInt
-                  _lhsIsyn ->
-                    (let _lhsOerrors :: (Seq Error)
-                         _lhsOgathAltAttrs :: ([AltAttr])
-                         _lhsOinstVars :: ([Identifier])
-                         _lhsOlocVars :: ([Identifier])
-                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                         _lhsOcopy :: Pattern 
-                         -- use rule "Order.ag"(line 84, column 70)
-                         _lhsOerrors =
-                             ({-# LINE 84 "Order.ag" #-}
-                              Seq.empty
-                              {-# LINE 2973 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 170, column 68)
-                         _lhsOgathAltAttrs =
-                             ({-# LINE 170 "Order.ag" #-}
-                              []
-                              {-# LINE 2979 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 86)
-                         _lhsOinstVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              []
-                              {-# LINE 2985 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 677, column 48)
-                         _lhsOlocVars =
-                             ({-# LINE 677 "Order.ag" #-}
-                              []
-                              {-# LINE 2991 "Order.hs" #-}
-                              )
-                         -- use rule "Order.ag"(line 249, column 42)
-                         _lhsOpatternAttrs =
-                             ({-# LINE 249 "Order.ag" #-}
-                              []
-                              {-# LINE 2997 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _copy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              Underscore pos_
-                              {-# LINE 3003 "Order.hs" #-}
-                              )
-                         -- self rule
-                         _lhsOcopy =
-                             ({-# LINE 23 "./Patterns.ag" #-}
-                              _copy
-                              {-# LINE 3009 "Order.hs" #-}
-                              )
-                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
--- Patterns ----------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allTypeSigs          : Map Identifier Type
-         altAttrs             : Map AltAttr Vertex
-         con                  : Identifier
-         inh                  : Attributes
-         nt                   : Identifier
-         syn                  : Attributes
-      synthesized attributes:
-         copy                 : SELF 
-         errors               : Seq Error
-         gathAltAttrs         : [AltAttr]
-         instVars             : [Identifier]
-         locVars              : [Identifier]
-         patternAttrs         : [(Identifier,Identifier,Bool,Patterns)]
-   alternatives:
-      alternative Cons:
-         child hd             : Pattern 
-         child tl             : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Nil:
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Patterns :: Patterns  ->
-                T_Patterns 
-sem_Patterns list  =
-    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
--- semantic domain
-newtype T_Patterns  = T_Patterns ((Map Identifier Type) ->
-                                  (Map AltAttr Vertex) ->
-                                  Identifier ->
-                                  Attributes ->
-                                  Identifier ->
-                                  Attributes ->
-                                  ( Patterns ,(Seq Error),([AltAttr]),([Identifier]),([Identifier]),([(Identifier,Identifier,Bool,Patterns)])))
-data Inh_Patterns  = Inh_Patterns {allTypeSigs_Inh_Patterns :: !((Map Identifier Type)),altAttrs_Inh_Patterns :: !((Map AltAttr Vertex)),con_Inh_Patterns :: !(Identifier),inh_Inh_Patterns :: !(Attributes),nt_Inh_Patterns :: !(Identifier),syn_Inh_Patterns :: !(Attributes)}
-data Syn_Patterns  = Syn_Patterns {copy_Syn_Patterns :: !(Patterns ),errors_Syn_Patterns :: !((Seq Error)),gathAltAttrs_Syn_Patterns :: !(([AltAttr])),instVars_Syn_Patterns :: !(([Identifier])),locVars_Syn_Patterns :: !(([Identifier])),patternAttrs_Syn_Patterns :: !(([(Identifier,Identifier,Bool,Patterns)]))}
-wrap_Patterns :: T_Patterns  ->
-                 Inh_Patterns  ->
-                 Syn_Patterns 
-wrap_Patterns (T_Patterns sem ) (Inh_Patterns _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn )  =
-    (let ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs) = sem _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn 
-     in  (Syn_Patterns _lhsOcopy _lhsOerrors _lhsOgathAltAttrs _lhsOinstVars _lhsOlocVars _lhsOpatternAttrs ))
-sem_Patterns_Cons :: T_Pattern  ->
-                     T_Patterns  ->
-                     T_Patterns 
-sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
-    (T_Patterns (\ _lhsIallTypeSigs
-                   _lhsIaltAttrs
-                   _lhsIcon
-                   _lhsIinh
-                   _lhsInt
-                   _lhsIsyn ->
-                     (let _lhsOerrors :: (Seq Error)
-                          _lhsOgathAltAttrs :: ([AltAttr])
-                          _lhsOinstVars :: ([Identifier])
-                          _lhsOlocVars :: ([Identifier])
-                          _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                          _lhsOcopy :: Patterns 
-                          _hdOallTypeSigs :: (Map Identifier Type)
-                          _hdOaltAttrs :: (Map AltAttr Vertex)
-                          _hdOcon :: Identifier
-                          _hdOinh :: Attributes
-                          _hdOnt :: Identifier
-                          _hdOsyn :: Attributes
-                          _tlOallTypeSigs :: (Map Identifier Type)
-                          _tlOaltAttrs :: (Map AltAttr Vertex)
-                          _tlOcon :: Identifier
-                          _tlOinh :: Attributes
-                          _tlOnt :: Identifier
-                          _tlOsyn :: Attributes
-                          _hdIcopy :: Pattern 
-                          _hdIerrors :: (Seq Error)
-                          _hdIgathAltAttrs :: ([AltAttr])
-                          _hdIinstVars :: ([Identifier])
-                          _hdIlocVars :: ([Identifier])
-                          _hdIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                          _tlIcopy :: Patterns 
-                          _tlIerrors :: (Seq Error)
-                          _tlIgathAltAttrs :: ([AltAttr])
-                          _tlIinstVars :: ([Identifier])
-                          _tlIlocVars :: ([Identifier])
-                          _tlIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                          -- use rule "Order.ag"(line 84, column 70)
-                          _lhsOerrors =
-                              ({-# LINE 84 "Order.ag" #-}
-                               _hdIerrors Seq.>< _tlIerrors
-                               {-# LINE 3104 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 170, column 68)
-                          _lhsOgathAltAttrs =
-                              ({-# LINE 170 "Order.ag" #-}
-                               _hdIgathAltAttrs ++ _tlIgathAltAttrs
-                               {-# LINE 3110 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 677, column 86)
-                          _lhsOinstVars =
-                              ({-# LINE 677 "Order.ag" #-}
-                               _hdIinstVars ++ _tlIinstVars
-                               {-# LINE 3116 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 677, column 48)
-                          _lhsOlocVars =
-                              ({-# LINE 677 "Order.ag" #-}
-                               _hdIlocVars ++ _tlIlocVars
-                               {-# LINE 3122 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 249, column 42)
-                          _lhsOpatternAttrs =
-                              ({-# LINE 249 "Order.ag" #-}
-                               _hdIpatternAttrs ++ _tlIpatternAttrs
-                               {-# LINE 3128 "Order.hs" #-}
-                               )
-                          -- self rule
-                          _copy =
-                              ({-# LINE 23 "./Patterns.ag" #-}
-                               (:) _hdIcopy _tlIcopy
-                               {-# LINE 3134 "Order.hs" #-}
-                               )
-                          -- self rule
-                          _lhsOcopy =
-                              ({-# LINE 23 "./Patterns.ag" #-}
-                               _copy
-                               {-# LINE 3140 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOallTypeSigs =
-                              ({-# LINE 533 "Order.ag" #-}
-                               _lhsIallTypeSigs
-                               {-# LINE 3146 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOaltAttrs =
-                              ({-# LINE 186 "Order.ag" #-}
-                               _lhsIaltAttrs
-                               {-# LINE 3152 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOcon =
-                              ({-# LINE 90 "Order.ag" #-}
-                               _lhsIcon
-                               {-# LINE 3158 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOinh =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIinh
-                               {-# LINE 3164 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOnt =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsInt
-                               {-# LINE 3170 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOsyn =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIsyn
-                               {-# LINE 3176 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOallTypeSigs =
-                              ({-# LINE 533 "Order.ag" #-}
-                               _lhsIallTypeSigs
-                               {-# LINE 3182 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOaltAttrs =
-                              ({-# LINE 186 "Order.ag" #-}
-                               _lhsIaltAttrs
-                               {-# LINE 3188 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOcon =
-                              ({-# LINE 90 "Order.ag" #-}
-                               _lhsIcon
-                               {-# LINE 3194 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOinh =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIinh
-                               {-# LINE 3200 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOnt =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsInt
-                               {-# LINE 3206 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _tlOsyn =
-                              ({-# LINE 89 "Order.ag" #-}
-                               _lhsIsyn
-                               {-# LINE 3212 "Order.hs" #-}
-                               )
-                          ( _hdIcopy,_hdIerrors,_hdIgathAltAttrs,_hdIinstVars,_hdIlocVars,_hdIpatternAttrs) =
-                              hd_ _hdOallTypeSigs _hdOaltAttrs _hdOcon _hdOinh _hdOnt _hdOsyn 
-                          ( _tlIcopy,_tlIerrors,_tlIgathAltAttrs,_tlIinstVars,_tlIlocVars,_tlIpatternAttrs) =
-                              tl_ _tlOallTypeSigs _tlOaltAttrs _tlOcon _tlOinh _tlOnt _tlOsyn 
-                      in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
-sem_Patterns_Nil :: T_Patterns 
-sem_Patterns_Nil  =
-    (T_Patterns (\ _lhsIallTypeSigs
-                   _lhsIaltAttrs
-                   _lhsIcon
-                   _lhsIinh
-                   _lhsInt
-                   _lhsIsyn ->
-                     (let _lhsOerrors :: (Seq Error)
-                          _lhsOgathAltAttrs :: ([AltAttr])
-                          _lhsOinstVars :: ([Identifier])
-                          _lhsOlocVars :: ([Identifier])
-                          _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                          _lhsOcopy :: Patterns 
-                          -- use rule "Order.ag"(line 84, column 70)
-                          _lhsOerrors =
-                              ({-# LINE 84 "Order.ag" #-}
-                               Seq.empty
-                               {-# LINE 3237 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 170, column 68)
-                          _lhsOgathAltAttrs =
-                              ({-# LINE 170 "Order.ag" #-}
-                               []
-                               {-# LINE 3243 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 677, column 86)
-                          _lhsOinstVars =
-                              ({-# LINE 677 "Order.ag" #-}
-                               []
-                               {-# LINE 3249 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 677, column 48)
-                          _lhsOlocVars =
-                              ({-# LINE 677 "Order.ag" #-}
-                               []
-                               {-# LINE 3255 "Order.hs" #-}
-                               )
-                          -- use rule "Order.ag"(line 249, column 42)
-                          _lhsOpatternAttrs =
-                              ({-# LINE 249 "Order.ag" #-}
-                               []
-                               {-# LINE 3261 "Order.hs" #-}
-                               )
-                          -- self rule
-                          _copy =
-                              ({-# LINE 23 "./Patterns.ag" #-}
-                               []
-                               {-# LINE 3267 "Order.hs" #-}
-                               )
-                          -- self rule
-                          _lhsOcopy =
-                              ({-# LINE 23 "./Patterns.ag" #-}
-                               _copy
-                               {-# LINE 3273 "Order.hs" #-}
-                               )
-                      in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
--- Production --------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allnts               : [Identifier]
-         aroundMap            : Map ConstructorIdent (Map Identifier [Expression])
-         cVisitsMap           : CVisitsMap
-         inh                  : Attributes
-         manualAttrDepMap     : AttrOrderMap
-         mergeMap             : Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))
-         nt                   : Identifier
-         o_case               : Bool
-         o_cata               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_unbox              : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-         syn                  : Attributes
-      chained attribute:
-         vcount               : Int
-      synthesized attributes:
-         additionalDep        : Seq Edge
-         aroundDep            : Seq Edge
-         cProduction          : CProduction
-         cons                 : [ConstructorIdent]
-         directDep            : Seq Edge
-         errors               : Seq Error
-         instDep              : Seq Edge
-         mergeDep             : Seq Edge
-         nAutoRules           : Int
-         nExplicitRules       : Int
-         rules                : Seq (Vertex,CRule)
-   alternatives:
-      alternative Production:
-         child con            : {ConstructorIdent}
-         child children       : Children 
-         child rules          : Rules 
-         child typeSigs       : TypeSigs 
-         visit 0:
-            local gathAltAttrs : _
-            local altAttrs    : _
-            local inhRules    : _
-            local gathRules   : _
-            local manualDeps  : _
-            local mergeMap    : _
-            local mergeDep1   : _
-            local mergeDep2   : _
-            local aroundMap   : _
-            local aroundDep1  : _
-            local aroundDep2  : _
-            local cVisits     : _
-            local allfields   : _
-            local attrs       : _
-            local inhnames    : _
-            local synnames    : _
--}
--- cata
-sem_Production :: Production  ->
-                  T_Production 
-sem_Production (Production _con _children _rules _typeSigs )  =
-    (sem_Production_Production _con (sem_Children _children ) (sem_Rules _rules ) (sem_TypeSigs _typeSigs ) )
--- semantic domain
-newtype T_Production  = T_Production (([Identifier]) ->
-                                      (Map ConstructorIdent (Map Identifier [Expression])) ->
-                                      CVisitsMap ->
-                                      Attributes ->
-                                      AttrOrderMap ->
-                                      (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
-                                      Identifier ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      Bool ->
-                                      String ->
-                                      Attributes ->
-                                      Int ->
-                                      ( (Seq Edge),(Seq Edge),CProduction,([ConstructorIdent]),(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,(Seq (Vertex,CRule)),Int))
-data Inh_Production  = Inh_Production {allnts_Inh_Production :: !(([Identifier])),aroundMap_Inh_Production :: !((Map ConstructorIdent (Map Identifier [Expression]))),cVisitsMap_Inh_Production :: !(CVisitsMap),inh_Inh_Production :: !(Attributes),manualAttrDepMap_Inh_Production :: !(AttrOrderMap),mergeMap_Inh_Production :: !((Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),nt_Inh_Production :: !(Identifier),o_case_Inh_Production :: !(Bool),o_cata_Inh_Production :: !(Bool),o_dovisit_Inh_Production :: !(Bool),o_newtypes_Inh_Production :: !(Bool),o_rename_Inh_Production :: !(Bool),o_sem_Inh_Production :: !(Bool),o_sig_Inh_Production :: !(Bool),o_unbox_Inh_Production :: !(Bool),o_wantvisit_Inh_Production :: !(Bool),prefix_Inh_Production :: !(String),syn_Inh_Production :: !(Attributes),vcount_Inh_Production :: !(Int)}
-data Syn_Production  = Syn_Production {additionalDep_Syn_Production :: !((Seq Edge)),aroundDep_Syn_Production :: !((Seq Edge)),cProduction_Syn_Production :: !(CProduction),cons_Syn_Production :: !(([ConstructorIdent])),directDep_Syn_Production :: !((Seq Edge)),errors_Syn_Production :: !((Seq Error)),instDep_Syn_Production :: !((Seq Edge)),mergeDep_Syn_Production :: !((Seq Edge)),nAutoRules_Syn_Production :: !(Int),nExplicitRules_Syn_Production :: !(Int),rules_Syn_Production :: !((Seq (Vertex,CRule))),vcount_Syn_Production :: !(Int)}
-wrap_Production :: T_Production  ->
-                   Inh_Production  ->
-                   Syn_Production 
-wrap_Production (T_Production sem ) (Inh_Production _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount )  =
-    (let ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProduction,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount) = sem _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount 
-     in  (Syn_Production _lhsOadditionalDep _lhsOaroundDep _lhsOcProduction _lhsOcons _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOrules _lhsOvcount ))
-sem_Production_Production :: ConstructorIdent ->
-                             T_Children  ->
-                             T_Rules  ->
-                             T_TypeSigs  ->
-                             T_Production 
-sem_Production_Production con_ (T_Children children_ ) (T_Rules rules_ ) (T_TypeSigs typeSigs_ )  =
-    (T_Production (\ _lhsIallnts
-                     _lhsIaroundMap
-                     _lhsIcVisitsMap
-                     _lhsIinh
-                     _lhsImanualAttrDepMap
-                     _lhsImergeMap
-                     _lhsInt
-                     _lhsIo_case
-                     _lhsIo_cata
-                     _lhsIo_dovisit
-                     _lhsIo_newtypes
-                     _lhsIo_rename
-                     _lhsIo_sem
-                     _lhsIo_sig
-                     _lhsIo_unbox
-                     _lhsIo_wantvisit
-                     _lhsIprefix
-                     _lhsIsyn
-                     _lhsIvcount ->
-                       (let _childrenOcon :: Identifier
-                            _rulesOcon :: Identifier
-                            _rulesOchildNts :: (Map Identifier NontermIdent)
-                            _rulesOchildInhs :: (Map Identifier Attributes)
-                            _lhsOrules :: (Seq (Vertex,CRule))
-                            _lhsOvcount :: Int
-                            _lhsOadditionalDep :: (Seq Edge)
-                            _rulesOsynsOfChildren :: (Map Identifier Attributes)
-                            _rulesOinhsOfChildren :: (Map Identifier Attributes)
-                            _lhsOmergeDep :: (Seq Edge)
-                            _lhsOaroundDep :: (Seq Edge)
-                            _lhsOcons :: ([ConstructorIdent])
-                            _typeSigsOtypeSigs :: (Map Identifier Type)
-                            _rulesOallTypeSigs :: (Map Identifier Type)
-                            _lhsOcProduction :: CProduction
-                            _lhsOdirectDep :: (Seq Edge)
-                            _lhsOerrors :: (Seq Error)
-                            _lhsOinstDep :: (Seq Edge)
-                            _lhsOnAutoRules :: Int
-                            _lhsOnExplicitRules :: Int
-                            _childrenOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                            _childrenOallnts :: ([Identifier])
-                            _childrenOattrs :: ([(Identifier,Identifier)])
-                            _childrenOinh :: Attributes
-                            _childrenOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                            _childrenOnt :: Identifier
-                            _childrenOo_unbox :: Bool
-                            _childrenOsyn :: Attributes
-                            _rulesOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                            _rulesOallnts :: ([Identifier])
-                            _rulesOaltAttrs :: (Map AltAttr Vertex)
-                            _rulesOattrs :: ([(Identifier,Identifier)])
-                            _rulesOinh :: Attributes
-                            _rulesOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                            _rulesOnt :: Identifier
-                            _rulesOo_case :: Bool
-                            _rulesOo_cata :: Bool
-                            _rulesOo_dovisit :: Bool
-                            _rulesOo_newtypes :: Bool
-                            _rulesOo_rename :: Bool
-                            _rulesOo_sem :: Bool
-                            _rulesOo_sig :: Bool
-                            _rulesOo_wantvisit :: Bool
-                            _rulesOprefix :: String
-                            _rulesOsyn :: Attributes
-                            _childrenIattributes :: ([(Identifier,Attributes,Attributes)])
-                            _childrenIcollectChildrenInhs :: (Map Identifier Attributes )
-                            _childrenIcollectChildrenSyns :: (Map Identifier Attributes )
-                            _childrenIerrors :: (Seq Error)
-                            _childrenIfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                            _childrenIgathAltAttrs :: ([AltAttr])
-                            _childrenIgathRules :: (Seq CRule)
-                            _childrenIinhs :: (Seq (Identifier,Attributes))
-                            _childrenInts :: (Seq (Identifier,NontermIdent))
-                            _childrenIsinglevisits :: ([CRule])
-                            _childrenIterminals :: ([Identifier])
-                            _rulesIdirectDep :: (Seq Edge)
-                            _rulesIerrors :: (Seq Error)
-                            _rulesIgathAltAttrs :: ([AltAttr])
-                            _rulesIgathRules :: (Seq CRule)
-                            _rulesIinstDep :: (Seq Edge)
-                            _rulesIinstVars :: ([Identifier])
-                            _rulesIlocVars :: ([Identifier])
-                            _rulesInAutoRules :: Int
-                            _rulesInExplicitRules :: Int
-                            _typeSigsItypeSigs :: (Map Identifier Type)
-                            -- "Order.ag"(line 93, column 16)
-                            _childrenOcon =
-                                ({-# LINE 93 "Order.ag" #-}
-                                 con_
-                                 {-# LINE 3465 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 95, column 16)
-                            _rulesOcon =
-                                ({-# LINE 95 "Order.ag" #-}
-                                 con_
-                                 {-# LINE 3471 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 172, column 18)
-                            _gathAltAttrs =
-                                ({-# LINE 172 "Order.ag" #-}
-                                 [ AltAttr _LHS inh True | inh <- Map.keys _lhsIinh ]
-                                  ++ _childrenIgathAltAttrs
-                                  ++ _rulesIgathAltAttrs
-                                 {-# LINE 3479 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 188, column 17)
-                            _altAttrs =
-                                ({-# LINE 188 "Order.ag" #-}
-                                 Map.fromList (zip _gathAltAttrs [_lhsIvcount..])
-                                 {-# LINE 3485 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 201, column 18)
-                            _rulesOchildNts =
-                                ({-# LINE 201 "Order.ag" #-}
-                                 Map.fromList (toList _childrenInts)
-                                 {-# LINE 3491 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 202, column 19)
-                            _rulesOchildInhs =
-                                ({-# LINE 202 "Order.ag" #-}
-                                 Map.fromList (toList _childrenIinhs)
-                                 {-# LINE 3497 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 208, column 18)
-                            _inhRules =
-                                ({-# LINE 208 "Order.ag" #-}
-                                 [ cRuleLhsInh inh _lhsInt con_ tp | (inh,tp) <- Map.assocs _lhsIinh ]
-                                 {-# LINE 3503 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 209, column 19)
-                            _gathRules =
-                                ({-# LINE 209 "Order.ag" #-}
-                                 _inhRules ++ toList (_childrenIgathRules Seq.>< _rulesIgathRules)
-                                 {-# LINE 3509 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 263, column 18)
-                            _lhsOrules =
-                                ({-# LINE 263 "Order.ag" #-}
-                                 Seq.fromList (zip [_lhsIvcount..] _gathRules)
-                                 {-# LINE 3515 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 264, column 19)
-                            _lhsOvcount =
-                                ({-# LINE 264 "Order.ag" #-}
-                                 _lhsIvcount + length _gathRules
-                                 {-# LINE 3521 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 291, column 7)
-                            _manualDeps =
-                                ({-# LINE 291 "Order.ag" #-}
-                                 Set.toList $ Map.findWithDefault Set.empty con_ $ Map.findWithDefault Map.empty _lhsInt _lhsImanualAttrDepMap
-                                 {-# LINE 3527 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 294, column 7)
-                            _lhsOadditionalDep =
-                                ({-# LINE 294 "Order.ag" #-}
-                                 Seq.fromList [ (vertex True occA, vertex False occB)
-                                              | Dependency occA occB <- _manualDeps
-                                              , let vertex inout (OccAttr child nm)
-                                                      | child == _LOC = findWithErr2 (AltAttr _LOC nm True) _altAttrs
-                                                      | otherwise     = findWithErr2 (AltAttr child nm inout) _altAttrs
-                                                    vertex _ (OccRule nm)
-                                                      = findWithErr2 (AltAttr _LOC (Ident ("_rule_" ++ show nm) (getPos nm)) True) _altAttrs
-                                              ]
-                                 {-# LINE 3540 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 341, column 17)
-                            _rulesOsynsOfChildren =
-                                ({-# LINE 341 "Order.ag" #-}
-                                 _childrenIcollectChildrenSyns
-                                 {-# LINE 3546 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 342, column 17)
-                            _rulesOinhsOfChildren =
-                                ({-# LINE 342 "Order.ag" #-}
-                                 _childrenIcollectChildrenInhs
-                                 {-# LINE 3552 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 360, column 32)
-                            _mergeMap =
-                                ({-# LINE 360 "Order.ag" #-}
-                                 Map.findWithDefault Map.empty con_ _lhsImergeMap
-                                 {-# LINE 3558 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 371, column 7)
-                            _lhsOmergeDep =
-                                ({-# LINE 371 "Order.ag" #-}
-                                 _mergeDep1     Seq.>< _mergeDep2
-                                 {-# LINE 3564 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 372, column 7)
-                            _mergeDep1 =
-                                ({-# LINE 372 "Order.ag" #-}
-                                 Seq.fromList $
-                                    [ (childVert, synVert)
-                                    | childNm <- Map.keys _mergeMap
-                                    , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
-                                    , let childNm' = Ident (show childNm ++ "_merge") (getPos childNm)
-                                          childAttr = AltAttr _LOC childNm' True
-                                          synAttr  = AltAttr childNm synNm True
-                                          childVert = findWithErr2 childAttr _altAttrs
-                                          synVert  = findWithErr2 synAttr _altAttrs
-                                    ]
-                                 {-# LINE 3579 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 383, column 7)
-                            _mergeDep2 =
-                                ({-# LINE 383 "Order.ag" #-}
-                                 Seq.fromList $
-                                    [ (mergedVert, sourceVert)
-                                    | (childNm, (_,cs)) <- Map.assocs _mergeMap
-                                    , c <- cs
-                                    , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
-                                    , let sourceAttr = AltAttr childNm synNm True
-                                          mergedAttr = AltAttr c synNm True
-                                          sourceVert = findWithErr2 sourceAttr _altAttrs
-                                          mergedVert = findWithErr2 mergedAttr _altAttrs
-                                    ]
-                                 {-# LINE 3594 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 413, column 32)
-                            _aroundMap =
-                                ({-# LINE 413 "Order.ag" #-}
-                                 Map.findWithDefault Map.empty con_ _lhsIaroundMap
-                                 {-# LINE 3600 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 420, column 6)
-                            _aroundDep1 =
-                                ({-# LINE 420 "Order.ag" #-}
-                                 Seq.fromList $
-                                   [ (childVert, synVert)
-                                   | childNm <- Map.keys _aroundMap
-                                   , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
-                                   , let childNm' = Ident (show childNm ++ "_around") (getPos childNm)
-                                         childAttr = AltAttr _LOC childNm' True
-                                         synAttr  = AltAttr childNm synNm True
-                                         childVert = findWithErr2 childAttr _altAttrs
-                                         synVert  = findWithErr2 synAttr _altAttrs
-                                   ]
-                                 {-# LINE 3615 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 431, column 6)
-                            _aroundDep2 =
-                                ({-# LINE 431 "Order.ag" #-}
-                                 Seq.fromList $
-                                   [ (childVert, inhVert)
-                                   | childNm <- Map.keys _aroundMap
-                                   , inhNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenInhs)
-                                   , let childNm'  = Ident (show childNm ++ "_around") (getPos childNm)
-                                         childAttr = AltAttr _LOC childNm' True
-                                         inhAttr   = AltAttr childNm inhNm False
-                                         childVert = findWithErr2 childAttr _altAttrs
-                                         inhVert   = findWithErr2 inhAttr _altAttrs
-                                   ]
-                                 {-# LINE 3630 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 442, column 6)
-                            _lhsOaroundDep =
-                                ({-# LINE 442 "Order.ag" #-}
-                                 _aroundDep1     Seq.>< _aroundDep2
-                                 {-# LINE 3636 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 522, column 18)
-                            _lhsOcons =
-                                ({-# LINE 522 "Order.ag" #-}
-                                 [con_]
-                                 {-# LINE 3642 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 529, column 16)
-                            _typeSigsOtypeSigs =
-                                ({-# LINE 529 "Order.ag" #-}
-                                 Map.empty
-                                 {-# LINE 3648 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 535, column 17)
-                            _rulesOallTypeSigs =
-                                ({-# LINE 535 "Order.ag" #-}
-                                 _typeSigsItypeSigs
-                                 {-# LINE 3654 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 603, column 17)
-                            _cVisits =
-                                ({-# LINE 603 "Order.ag" #-}
-                                 if  _lhsIo_dovisit
-                                      then let prodsVisitsMap = findWithErr1 "Production.cVisits.nt" _lhsInt _lhsIcVisitsMap
-                                               visits = findWithErr1 "Production.cVisits.con" con_ prodsVisitsMap
-                                            in visits
-                                      else  let  vss = nubBy eqCRuleDefines _gathRules ++ _childrenIsinglevisits
-                                            in  [CVisit _lhsIinh _lhsIsyn vss [] False]
-                                 {-# LINE 3665 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 629, column 18)
-                            _lhsOcProduction =
-                                ({-# LINE 629 "Order.ag" #-}
-                                 CProduction con_ _cVisits _childrenIfields _childrenIterminals
-                                 {-# LINE 3671 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 657, column 16)
-                            _allfields =
-                                ({-# LINE 657 "Order.ag" #-}
-                                 _childrenIfields
-                                 {-# LINE 3677 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 657, column 16)
-                            _attrs =
-                                ({-# LINE 658 "Order.ag" #-}
-                                 map ((,) _LOC)  _rulesIlocVars ++
-                                 map ((,) _INST) _rulesIinstVars ++
-                                 map ((,) _LHS)  _inhnames ++
-                                 concat [map ((,) nm) (Map.keys as) | (nm,_,as) <- _childrenIattributes]
-                                 {-# LINE 3686 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 657, column 16)
-                            _inhnames =
-                                ({-# LINE 662 "Order.ag" #-}
-                                 Map.keys _lhsIinh
-                                 {-# LINE 3692 "Order.hs" #-}
-                                 )
-                            -- "Order.ag"(line 657, column 16)
-                            _synnames =
-                                ({-# LINE 663 "Order.ag" #-}
-                                 Map.keys _lhsIsyn
-                                 {-# LINE 3698 "Order.hs" #-}
-                                 )
-                            -- use rule "Order.ag"(line 269, column 33)
-                            _lhsOdirectDep =
-                                ({-# LINE 269 "Order.ag" #-}
-                                 _rulesIdirectDep
-                                 {-# LINE 3704 "Order.hs" #-}
-                                 )
-                            -- use rule "Order.ag"(line 84, column 70)
-                            _lhsOerrors =
-                                ({-# LINE 84 "Order.ag" #-}
-                                 _childrenIerrors Seq.>< _rulesIerrors
-                                 {-# LINE 3710 "Order.hs" #-}
-                                 )
-                            -- use rule "Order.ag"(line 312, column 31)
-                            _lhsOinstDep =
-                                ({-# LINE 312 "Order.ag" #-}
-                                 _rulesIinstDep
-                                 {-# LINE 3716 "Order.hs" #-}
-                                 )
-                            -- use rule "Order.ag"(line 61, column 105)
-                            _lhsOnAutoRules =
-                                ({-# LINE 61 "Order.ag" #-}
-                                 _rulesInAutoRules
-                                 {-# LINE 3722 "Order.hs" #-}
-                                 )
-                            -- use rule "Order.ag"(line 61, column 105)
-                            _lhsOnExplicitRules =
-                                ({-# LINE 61 "Order.ag" #-}
-                                 _rulesInExplicitRules
-                                 {-# LINE 3728 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _childrenOallfields =
-                                ({-# LINE 654 "Order.ag" #-}
-                                 _allfields
-                                 {-# LINE 3734 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _childrenOallnts =
-                                ({-# LINE 647 "Order.ag" #-}
-                                 _lhsIallnts
-                                 {-# LINE 3740 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _childrenOattrs =
-                                ({-# LINE 654 "Order.ag" #-}
-                                 _attrs
-                                 {-# LINE 3746 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _childrenOinh =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsIinh
-                                 {-# LINE 3752 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _childrenOmergeMap =
-                                ({-# LINE 362 "Order.ag" #-}
-                                 _mergeMap
-                                 {-# LINE 3758 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _childrenOnt =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsInt
-                                 {-# LINE 3764 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _childrenOo_unbox =
-                                ({-# LINE 119 "Order.ag" #-}
-                                 _lhsIo_unbox
-                                 {-# LINE 3770 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _childrenOsyn =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsIsyn
-                                 {-# LINE 3776 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _rulesOallfields =
-                                ({-# LINE 654 "Order.ag" #-}
-                                 _allfields
-                                 {-# LINE 3782 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOallnts =
-                                ({-# LINE 647 "Order.ag" #-}
-                                 _lhsIallnts
-                                 {-# LINE 3788 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _rulesOaltAttrs =
-                                ({-# LINE 186 "Order.ag" #-}
-                                 _altAttrs
-                                 {-# LINE 3794 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _rulesOattrs =
-                                ({-# LINE 654 "Order.ag" #-}
-                                 _attrs
-                                 {-# LINE 3800 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOinh =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsIinh
-                                 {-# LINE 3806 "Order.hs" #-}
-                                 )
-                            -- copy rule (from local)
-                            _rulesOmergeMap =
-                                ({-# LINE 362 "Order.ag" #-}
-                                 _mergeMap
-                                 {-# LINE 3812 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOnt =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsInt
-                                 {-# LINE 3818 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_case =
-                                ({-# LINE 117 "Order.ag" #-}
-                                 _lhsIo_case
-                                 {-# LINE 3824 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_cata =
-                                ({-# LINE 111 "Order.ag" #-}
-                                 _lhsIo_cata
-                                 {-# LINE 3830 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_dovisit =
-                                ({-# LINE 116 "Order.ag" #-}
-                                 _lhsIo_dovisit
-                                 {-# LINE 3836 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_newtypes =
-                                ({-# LINE 110 "Order.ag" #-}
-                                 _lhsIo_newtypes
-                                 {-# LINE 3842 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_rename =
-                                ({-# LINE 114 "Order.ag" #-}
-                                 _lhsIo_rename
-                                 {-# LINE 3848 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_sem =
-                                ({-# LINE 113 "Order.ag" #-}
-                                 _lhsIo_sem
-                                 {-# LINE 3854 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_sig =
-                                ({-# LINE 112 "Order.ag" #-}
-                                 _lhsIo_sig
-                                 {-# LINE 3860 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOo_wantvisit =
-                                ({-# LINE 115 "Order.ag" #-}
-                                 _lhsIo_wantvisit
-                                 {-# LINE 3866 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOprefix =
-                                ({-# LINE 118 "Order.ag" #-}
-                                 _lhsIprefix
-                                 {-# LINE 3872 "Order.hs" #-}
-                                 )
-                            -- copy rule (down)
-                            _rulesOsyn =
-                                ({-# LINE 89 "Order.ag" #-}
-                                 _lhsIsyn
-                                 {-# LINE 3878 "Order.hs" #-}
-                                 )
-                            ( _childrenIattributes,_childrenIcollectChildrenInhs,_childrenIcollectChildrenSyns,_childrenIerrors,_childrenIfields,_childrenIgathAltAttrs,_childrenIgathRules,_childrenIinhs,_childrenInts,_childrenIsinglevisits,_childrenIterminals) =
-                                children_ _childrenOallfields _childrenOallnts _childrenOattrs _childrenOcon _childrenOinh _childrenOmergeMap _childrenOnt _childrenOo_unbox _childrenOsyn 
-                            ( _rulesIdirectDep,_rulesIerrors,_rulesIgathAltAttrs,_rulesIgathRules,_rulesIinstDep,_rulesIinstVars,_rulesIlocVars,_rulesInAutoRules,_rulesInExplicitRules) =
-                                rules_ _rulesOallTypeSigs _rulesOallfields _rulesOallnts _rulesOaltAttrs _rulesOattrs _rulesOchildInhs _rulesOchildNts _rulesOcon _rulesOinh _rulesOinhsOfChildren _rulesOmergeMap _rulesOnt _rulesOo_case _rulesOo_cata _rulesOo_dovisit _rulesOo_newtypes _rulesOo_rename _rulesOo_sem _rulesOo_sig _rulesOo_wantvisit _rulesOprefix _rulesOsyn _rulesOsynsOfChildren 
-                            ( _typeSigsItypeSigs) =
-                                typeSigs_ _typeSigsOtypeSigs 
-                        in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProduction,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
--- Productions -------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allnts               : [Identifier]
-         aroundMap            : Map ConstructorIdent (Map Identifier [Expression])
-         cVisitsMap           : CVisitsMap
-         inh                  : Attributes
-         manualAttrDepMap     : AttrOrderMap
-         mergeMap             : Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))
-         nt                   : Identifier
-         o_case               : Bool
-         o_cata               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_unbox              : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-         syn                  : Attributes
-      chained attribute:
-         vcount               : Int
-      synthesized attributes:
-         additionalDep        : Seq Edge
-         aroundDep            : Seq Edge
-         cProductions         : CProductions
-         cons                 : [ConstructorIdent]
-         directDep            : Seq Edge
-         errors               : Seq Error
-         instDep              : Seq Edge
-         mergeDep             : Seq Edge
-         nAutoRules           : Int
-         nExplicitRules       : Int
-         rules                : Seq (Vertex,CRule)
-   alternatives:
-      alternative Cons:
-         child hd             : Production 
-         child tl             : Productions 
-      alternative Nil:
--}
--- cata
-sem_Productions :: Productions  ->
-                   T_Productions 
-sem_Productions list  =
-    (Prelude.foldr sem_Productions_Cons sem_Productions_Nil (Prelude.map sem_Production list) )
--- semantic domain
-newtype T_Productions  = T_Productions (([Identifier]) ->
-                                        (Map ConstructorIdent (Map Identifier [Expression])) ->
-                                        CVisitsMap ->
-                                        Attributes ->
-                                        AttrOrderMap ->
-                                        (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
-                                        Identifier ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        Bool ->
-                                        String ->
-                                        Attributes ->
-                                        Int ->
-                                        ( (Seq Edge),(Seq Edge),CProductions,([ConstructorIdent]),(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,(Seq (Vertex,CRule)),Int))
-data Inh_Productions  = Inh_Productions {allnts_Inh_Productions :: !(([Identifier])),aroundMap_Inh_Productions :: !((Map ConstructorIdent (Map Identifier [Expression]))),cVisitsMap_Inh_Productions :: !(CVisitsMap),inh_Inh_Productions :: !(Attributes),manualAttrDepMap_Inh_Productions :: !(AttrOrderMap),mergeMap_Inh_Productions :: !((Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),nt_Inh_Productions :: !(Identifier),o_case_Inh_Productions :: !(Bool),o_cata_Inh_Productions :: !(Bool),o_dovisit_Inh_Productions :: !(Bool),o_newtypes_Inh_Productions :: !(Bool),o_rename_Inh_Productions :: !(Bool),o_sem_Inh_Productions :: !(Bool),o_sig_Inh_Productions :: !(Bool),o_unbox_Inh_Productions :: !(Bool),o_wantvisit_Inh_Productions :: !(Bool),prefix_Inh_Productions :: !(String),syn_Inh_Productions :: !(Attributes),vcount_Inh_Productions :: !(Int)}
-data Syn_Productions  = Syn_Productions {additionalDep_Syn_Productions :: !((Seq Edge)),aroundDep_Syn_Productions :: !((Seq Edge)),cProductions_Syn_Productions :: !(CProductions),cons_Syn_Productions :: !(([ConstructorIdent])),directDep_Syn_Productions :: !((Seq Edge)),errors_Syn_Productions :: !((Seq Error)),instDep_Syn_Productions :: !((Seq Edge)),mergeDep_Syn_Productions :: !((Seq Edge)),nAutoRules_Syn_Productions :: !(Int),nExplicitRules_Syn_Productions :: !(Int),rules_Syn_Productions :: !((Seq (Vertex,CRule))),vcount_Syn_Productions :: !(Int)}
-wrap_Productions :: T_Productions  ->
-                    Inh_Productions  ->
-                    Syn_Productions 
-wrap_Productions (T_Productions sem ) (Inh_Productions _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount )  =
-    (let ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount) = sem _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount 
-     in  (Syn_Productions _lhsOadditionalDep _lhsOaroundDep _lhsOcProductions _lhsOcons _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOrules _lhsOvcount ))
-sem_Productions_Cons :: T_Production  ->
-                        T_Productions  ->
-                        T_Productions 
-sem_Productions_Cons (T_Production hd_ ) (T_Productions tl_ )  =
-    (T_Productions (\ _lhsIallnts
-                      _lhsIaroundMap
-                      _lhsIcVisitsMap
-                      _lhsIinh
-                      _lhsImanualAttrDepMap
-                      _lhsImergeMap
-                      _lhsInt
-                      _lhsIo_case
-                      _lhsIo_cata
-                      _lhsIo_dovisit
-                      _lhsIo_newtypes
-                      _lhsIo_rename
-                      _lhsIo_sem
-                      _lhsIo_sig
-                      _lhsIo_unbox
-                      _lhsIo_wantvisit
-                      _lhsIprefix
-                      _lhsIsyn
-                      _lhsIvcount ->
-                        (let _lhsOcProductions :: CProductions
-                             _lhsOadditionalDep :: (Seq Edge)
-                             _lhsOaroundDep :: (Seq Edge)
-                             _lhsOcons :: ([ConstructorIdent])
-                             _lhsOdirectDep :: (Seq Edge)
-                             _lhsOerrors :: (Seq Error)
-                             _lhsOinstDep :: (Seq Edge)
-                             _lhsOmergeDep :: (Seq Edge)
-                             _lhsOnAutoRules :: Int
-                             _lhsOnExplicitRules :: Int
-                             _lhsOrules :: (Seq (Vertex,CRule))
-                             _lhsOvcount :: Int
-                             _hdOallnts :: ([Identifier])
-                             _hdOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
-                             _hdOcVisitsMap :: CVisitsMap
-                             _hdOinh :: Attributes
-                             _hdOmanualAttrDepMap :: AttrOrderMap
-                             _hdOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
-                             _hdOnt :: Identifier
-                             _hdOo_case :: Bool
-                             _hdOo_cata :: Bool
-                             _hdOo_dovisit :: Bool
-                             _hdOo_newtypes :: Bool
-                             _hdOo_rename :: Bool
-                             _hdOo_sem :: Bool
-                             _hdOo_sig :: Bool
-                             _hdOo_unbox :: Bool
-                             _hdOo_wantvisit :: Bool
-                             _hdOprefix :: String
-                             _hdOsyn :: Attributes
-                             _hdOvcount :: Int
-                             _tlOallnts :: ([Identifier])
-                             _tlOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
-                             _tlOcVisitsMap :: CVisitsMap
-                             _tlOinh :: Attributes
-                             _tlOmanualAttrDepMap :: AttrOrderMap
-                             _tlOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
-                             _tlOnt :: Identifier
-                             _tlOo_case :: Bool
-                             _tlOo_cata :: Bool
-                             _tlOo_dovisit :: Bool
-                             _tlOo_newtypes :: Bool
-                             _tlOo_rename :: Bool
-                             _tlOo_sem :: Bool
-                             _tlOo_sig :: Bool
-                             _tlOo_unbox :: Bool
-                             _tlOo_wantvisit :: Bool
-                             _tlOprefix :: String
-                             _tlOsyn :: Attributes
-                             _tlOvcount :: Int
-                             _hdIadditionalDep :: (Seq Edge)
-                             _hdIaroundDep :: (Seq Edge)
-                             _hdIcProduction :: CProduction
-                             _hdIcons :: ([ConstructorIdent])
-                             _hdIdirectDep :: (Seq Edge)
-                             _hdIerrors :: (Seq Error)
-                             _hdIinstDep :: (Seq Edge)
-                             _hdImergeDep :: (Seq Edge)
-                             _hdInAutoRules :: Int
-                             _hdInExplicitRules :: Int
-                             _hdIrules :: (Seq (Vertex,CRule))
-                             _hdIvcount :: Int
-                             _tlIadditionalDep :: (Seq Edge)
-                             _tlIaroundDep :: (Seq Edge)
-                             _tlIcProductions :: CProductions
-                             _tlIcons :: ([ConstructorIdent])
-                             _tlIdirectDep :: (Seq Edge)
-                             _tlIerrors :: (Seq Error)
-                             _tlIinstDep :: (Seq Edge)
-                             _tlImergeDep :: (Seq Edge)
-                             _tlInAutoRules :: Int
-                             _tlInExplicitRules :: Int
-                             _tlIrules :: (Seq (Vertex,CRule))
-                             _tlIvcount :: Int
-                             -- "Order.ag"(line 626, column 12)
-                             _lhsOcProductions =
-                                 ({-# LINE 626 "Order.ag" #-}
-                                  _hdIcProduction : _tlIcProductions
-                                  {-# LINE 4064 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 283, column 60)
-                             _lhsOadditionalDep =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  _hdIadditionalDep Seq.>< _tlIadditionalDep
-                                  {-# LINE 4070 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 404, column 24)
-                             _lhsOaroundDep =
-                                 ({-# LINE 404 "Order.ag" #-}
-                                  _hdIaroundDep Seq.>< _tlIaroundDep
-                                  {-# LINE 4076 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 520, column 40)
-                             _lhsOcons =
-                                 ({-# LINE 520 "Order.ag" #-}
-                                  _hdIcons ++ _tlIcons
-                                  {-# LINE 4082 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 269, column 33)
-                             _lhsOdirectDep =
-                                 ({-# LINE 269 "Order.ag" #-}
-                                  _hdIdirectDep Seq.>< _tlIdirectDep
-                                  {-# LINE 4088 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 84, column 70)
-                             _lhsOerrors =
-                                 ({-# LINE 84 "Order.ag" #-}
-                                  _hdIerrors Seq.>< _tlIerrors
-                                  {-# LINE 4094 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 312, column 31)
-                             _lhsOinstDep =
-                                 ({-# LINE 312 "Order.ag" #-}
-                                  _hdIinstDep Seq.>< _tlIinstDep
-                                  {-# LINE 4100 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 367, column 18)
-                             _lhsOmergeDep =
-                                 ({-# LINE 367 "Order.ag" #-}
-                                  _hdImergeDep Seq.>< _tlImergeDep
-                                  {-# LINE 4106 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnAutoRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  _hdInAutoRules + _tlInAutoRules
-                                  {-# LINE 4112 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnExplicitRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  _hdInExplicitRules + _tlInExplicitRules
-                                  {-# LINE 4118 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 259, column 18)
-                             _lhsOrules =
-                                 ({-# LINE 259 "Order.ag" #-}
-                                  _hdIrules Seq.>< _tlIrules
-                                  {-# LINE 4124 "Order.hs" #-}
-                                  )
-                             -- copy rule (up)
-                             _lhsOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _tlIvcount
-                                  {-# LINE 4130 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOallnts =
-                                 ({-# LINE 647 "Order.ag" #-}
-                                  _lhsIallnts
-                                  {-# LINE 4136 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOaroundMap =
-                                 ({-# LINE 410 "Order.ag" #-}
-                                  _lhsIaroundMap
-                                  {-# LINE 4142 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOcVisitsMap =
-                                 ({-# LINE 601 "Order.ag" #-}
-                                  _lhsIcVisitsMap
-                                  {-# LINE 4148 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOinh =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsIinh
-                                  {-# LINE 4154 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOmanualAttrDepMap =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  _lhsImanualAttrDepMap
-                                  {-# LINE 4160 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOmergeMap =
-                                 ({-# LINE 357 "Order.ag" #-}
-                                  _lhsImergeMap
-                                  {-# LINE 4166 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOnt =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsInt
-                                  {-# LINE 4172 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_case =
-                                 ({-# LINE 117 "Order.ag" #-}
-                                  _lhsIo_case
-                                  {-# LINE 4178 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_cata =
-                                 ({-# LINE 111 "Order.ag" #-}
-                                  _lhsIo_cata
-                                  {-# LINE 4184 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_dovisit =
-                                 ({-# LINE 116 "Order.ag" #-}
-                                  _lhsIo_dovisit
-                                  {-# LINE 4190 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_newtypes =
-                                 ({-# LINE 110 "Order.ag" #-}
-                                  _lhsIo_newtypes
-                                  {-# LINE 4196 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_rename =
-                                 ({-# LINE 114 "Order.ag" #-}
-                                  _lhsIo_rename
-                                  {-# LINE 4202 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_sem =
-                                 ({-# LINE 113 "Order.ag" #-}
-                                  _lhsIo_sem
-                                  {-# LINE 4208 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_sig =
-                                 ({-# LINE 112 "Order.ag" #-}
-                                  _lhsIo_sig
-                                  {-# LINE 4214 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_unbox =
-                                 ({-# LINE 119 "Order.ag" #-}
-                                  _lhsIo_unbox
-                                  {-# LINE 4220 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOo_wantvisit =
-                                 ({-# LINE 115 "Order.ag" #-}
-                                  _lhsIo_wantvisit
-                                  {-# LINE 4226 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOprefix =
-                                 ({-# LINE 118 "Order.ag" #-}
-                                  _lhsIprefix
-                                  {-# LINE 4232 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOsyn =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsIsyn
-                                  {-# LINE 4238 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _hdOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _lhsIvcount
-                                  {-# LINE 4244 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOallnts =
-                                 ({-# LINE 647 "Order.ag" #-}
-                                  _lhsIallnts
-                                  {-# LINE 4250 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOaroundMap =
-                                 ({-# LINE 410 "Order.ag" #-}
-                                  _lhsIaroundMap
-                                  {-# LINE 4256 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOcVisitsMap =
-                                 ({-# LINE 601 "Order.ag" #-}
-                                  _lhsIcVisitsMap
-                                  {-# LINE 4262 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOinh =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsIinh
-                                  {-# LINE 4268 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOmanualAttrDepMap =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  _lhsImanualAttrDepMap
-                                  {-# LINE 4274 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOmergeMap =
-                                 ({-# LINE 357 "Order.ag" #-}
-                                  _lhsImergeMap
-                                  {-# LINE 4280 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOnt =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsInt
-                                  {-# LINE 4286 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_case =
-                                 ({-# LINE 117 "Order.ag" #-}
-                                  _lhsIo_case
-                                  {-# LINE 4292 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_cata =
-                                 ({-# LINE 111 "Order.ag" #-}
-                                  _lhsIo_cata
-                                  {-# LINE 4298 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_dovisit =
-                                 ({-# LINE 116 "Order.ag" #-}
-                                  _lhsIo_dovisit
-                                  {-# LINE 4304 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_newtypes =
-                                 ({-# LINE 110 "Order.ag" #-}
-                                  _lhsIo_newtypes
-                                  {-# LINE 4310 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_rename =
-                                 ({-# LINE 114 "Order.ag" #-}
-                                  _lhsIo_rename
-                                  {-# LINE 4316 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_sem =
-                                 ({-# LINE 113 "Order.ag" #-}
-                                  _lhsIo_sem
-                                  {-# LINE 4322 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_sig =
-                                 ({-# LINE 112 "Order.ag" #-}
-                                  _lhsIo_sig
-                                  {-# LINE 4328 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_unbox =
-                                 ({-# LINE 119 "Order.ag" #-}
-                                  _lhsIo_unbox
-                                  {-# LINE 4334 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOo_wantvisit =
-                                 ({-# LINE 115 "Order.ag" #-}
-                                  _lhsIo_wantvisit
-                                  {-# LINE 4340 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOprefix =
-                                 ({-# LINE 118 "Order.ag" #-}
-                                  _lhsIprefix
-                                  {-# LINE 4346 "Order.hs" #-}
-                                  )
-                             -- copy rule (down)
-                             _tlOsyn =
-                                 ({-# LINE 89 "Order.ag" #-}
-                                  _lhsIsyn
-                                  {-# LINE 4352 "Order.hs" #-}
-                                  )
-                             -- copy rule (chain)
-                             _tlOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _hdIvcount
-                                  {-# LINE 4358 "Order.hs" #-}
-                                  )
-                             ( _hdIadditionalDep,_hdIaroundDep,_hdIcProduction,_hdIcons,_hdIdirectDep,_hdIerrors,_hdIinstDep,_hdImergeDep,_hdInAutoRules,_hdInExplicitRules,_hdIrules,_hdIvcount) =
-                                 hd_ _hdOallnts _hdOaroundMap _hdOcVisitsMap _hdOinh _hdOmanualAttrDepMap _hdOmergeMap _hdOnt _hdOo_case _hdOo_cata _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_unbox _hdOo_wantvisit _hdOprefix _hdOsyn _hdOvcount 
-                             ( _tlIadditionalDep,_tlIaroundDep,_tlIcProductions,_tlIcons,_tlIdirectDep,_tlIerrors,_tlIinstDep,_tlImergeDep,_tlInAutoRules,_tlInExplicitRules,_tlIrules,_tlIvcount) =
-                                 tl_ _tlOallnts _tlOaroundMap _tlOcVisitsMap _tlOinh _tlOmanualAttrDepMap _tlOmergeMap _tlOnt _tlOo_case _tlOo_cata _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_unbox _tlOo_wantvisit _tlOprefix _tlOsyn _tlOvcount 
-                         in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
-sem_Productions_Nil :: T_Productions 
-sem_Productions_Nil  =
-    (T_Productions (\ _lhsIallnts
-                      _lhsIaroundMap
-                      _lhsIcVisitsMap
-                      _lhsIinh
-                      _lhsImanualAttrDepMap
-                      _lhsImergeMap
-                      _lhsInt
-                      _lhsIo_case
-                      _lhsIo_cata
-                      _lhsIo_dovisit
-                      _lhsIo_newtypes
-                      _lhsIo_rename
-                      _lhsIo_sem
-                      _lhsIo_sig
-                      _lhsIo_unbox
-                      _lhsIo_wantvisit
-                      _lhsIprefix
-                      _lhsIsyn
-                      _lhsIvcount ->
-                        (let _lhsOcProductions :: CProductions
-                             _lhsOadditionalDep :: (Seq Edge)
-                             _lhsOaroundDep :: (Seq Edge)
-                             _lhsOcons :: ([ConstructorIdent])
-                             _lhsOdirectDep :: (Seq Edge)
-                             _lhsOerrors :: (Seq Error)
-                             _lhsOinstDep :: (Seq Edge)
-                             _lhsOmergeDep :: (Seq Edge)
-                             _lhsOnAutoRules :: Int
-                             _lhsOnExplicitRules :: Int
-                             _lhsOrules :: (Seq (Vertex,CRule))
-                             _lhsOvcount :: Int
-                             -- "Order.ag"(line 627, column 12)
-                             _lhsOcProductions =
-                                 ({-# LINE 627 "Order.ag" #-}
-                                  []
-                                  {-# LINE 4402 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 283, column 60)
-                             _lhsOadditionalDep =
-                                 ({-# LINE 283 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4408 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 404, column 24)
-                             _lhsOaroundDep =
-                                 ({-# LINE 404 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4414 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 520, column 40)
-                             _lhsOcons =
-                                 ({-# LINE 520 "Order.ag" #-}
-                                  []
-                                  {-# LINE 4420 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 269, column 33)
-                             _lhsOdirectDep =
-                                 ({-# LINE 269 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4426 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 84, column 70)
-                             _lhsOerrors =
-                                 ({-# LINE 84 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4432 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 312, column 31)
-                             _lhsOinstDep =
-                                 ({-# LINE 312 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4438 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 367, column 18)
-                             _lhsOmergeDep =
-                                 ({-# LINE 367 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4444 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnAutoRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  0
-                                  {-# LINE 4450 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 61, column 105)
-                             _lhsOnExplicitRules =
-                                 ({-# LINE 61 "Order.ag" #-}
-                                  0
-                                  {-# LINE 4456 "Order.hs" #-}
-                                  )
-                             -- use rule "Order.ag"(line 259, column 18)
-                             _lhsOrules =
-                                 ({-# LINE 259 "Order.ag" #-}
-                                  Seq.empty
-                                  {-# LINE 4462 "Order.hs" #-}
-                                  )
-                             -- copy rule (chain)
-                             _lhsOvcount =
-                                 ({-# LINE 258 "Order.ag" #-}
-                                  _lhsIvcount
-                                  {-# LINE 4468 "Order.hs" #-}
-                                  )
-                         in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
--- Rule --------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allTypeSigs          : Map Identifier Type
-         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
-         allnts               : [Identifier]
-         altAttrs             : Map AltAttr Vertex
-         attrs                : [(Identifier,Identifier)]
-         childInhs            : Map Identifier Attributes
-         childNts             : Map Identifier NontermIdent
-         con                  : Identifier
-         inh                  : Attributes
-         inhsOfChildren       : Map Identifier Attributes
-         mergeMap             : Map Identifier (Identifier,[Identifier])
-         nt                   : Identifier
-         o_case               : Bool
-         o_cata               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-         syn                  : Attributes
-         synsOfChildren       : Map Identifier Attributes
-      synthesized attributes:
-         directDep            : Seq Edge
-         errors               : Seq Error
-         gathAltAttrs         : [AltAttr]
-         gathRules            : Seq CRule
-         instDep              : Seq Edge
-         instVars             : [Identifier]
-         locVars              : [Identifier]
-         nAutoRules           : Int
-         nExplicitRules       : Int
-   alternatives:
-      alternative Rule:
-         child mbName         : {Maybe Identifier}
-         child pattern        : Pattern 
-         child rhs            : Expression 
-         child owrt           : {Bool}
-         child origin         : {String}
-         child explicit       : {Bool}
-         visit 0:
-            local defines     : _
-            local gathRules   : _
-            local instDep1    : _
-            local instDep2    : _
--}
--- cata
-sem_Rule :: Rule  ->
-            T_Rule 
-sem_Rule (Rule _mbName _pattern _rhs _owrt _origin _explicit )  =
-    (sem_Rule_Rule _mbName (sem_Pattern _pattern ) (sem_Expression _rhs ) _owrt _origin _explicit )
--- semantic domain
-newtype T_Rule  = T_Rule ((Map Identifier Type) ->
-                          ([(Identifier,Type,Maybe (Maybe Type))]) ->
-                          ([Identifier]) ->
-                          (Map AltAttr Vertex) ->
-                          ([(Identifier,Identifier)]) ->
-                          (Map Identifier Attributes) ->
-                          (Map Identifier NontermIdent) ->
-                          Identifier ->
-                          Attributes ->
-                          (Map Identifier Attributes) ->
-                          (Map Identifier (Identifier,[Identifier])) ->
-                          Identifier ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          Bool ->
-                          String ->
-                          Attributes ->
-                          (Map Identifier Attributes) ->
-                          ( (Seq Edge),(Seq Error),([AltAttr]),(Seq CRule),(Seq Edge),([Identifier]),([Identifier]),Int,Int))
-data Inh_Rule  = Inh_Rule {allTypeSigs_Inh_Rule :: !((Map Identifier Type)),allfields_Inh_Rule :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Rule :: !(([Identifier])),altAttrs_Inh_Rule :: !((Map AltAttr Vertex)),attrs_Inh_Rule :: !(([(Identifier,Identifier)])),childInhs_Inh_Rule :: !((Map Identifier Attributes)),childNts_Inh_Rule :: !((Map Identifier NontermIdent)),con_Inh_Rule :: !(Identifier),inh_Inh_Rule :: !(Attributes),inhsOfChildren_Inh_Rule :: !((Map Identifier Attributes)),mergeMap_Inh_Rule :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Rule :: !(Identifier),o_case_Inh_Rule :: !(Bool),o_cata_Inh_Rule :: !(Bool),o_dovisit_Inh_Rule :: !(Bool),o_newtypes_Inh_Rule :: !(Bool),o_rename_Inh_Rule :: !(Bool),o_sem_Inh_Rule :: !(Bool),o_sig_Inh_Rule :: !(Bool),o_wantvisit_Inh_Rule :: !(Bool),prefix_Inh_Rule :: !(String),syn_Inh_Rule :: !(Attributes),synsOfChildren_Inh_Rule :: !((Map Identifier Attributes))}
-data Syn_Rule  = Syn_Rule {directDep_Syn_Rule :: !((Seq Edge)),errors_Syn_Rule :: !((Seq Error)),gathAltAttrs_Syn_Rule :: !(([AltAttr])),gathRules_Syn_Rule :: !((Seq CRule)),instDep_Syn_Rule :: !((Seq Edge)),instVars_Syn_Rule :: !(([Identifier])),locVars_Syn_Rule :: !(([Identifier])),nAutoRules_Syn_Rule :: !(Int),nExplicitRules_Syn_Rule :: !(Int)}
-wrap_Rule :: T_Rule  ->
-             Inh_Rule  ->
-             Syn_Rule 
-wrap_Rule (T_Rule sem ) (Inh_Rule _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren )  =
-    (let ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules) = sem _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren 
-     in  (Syn_Rule _lhsOdirectDep _lhsOerrors _lhsOgathAltAttrs _lhsOgathRules _lhsOinstDep _lhsOinstVars _lhsOlocVars _lhsOnAutoRules _lhsOnExplicitRules ))
-sem_Rule_Rule :: (Maybe Identifier) ->
-                 T_Pattern  ->
-                 T_Expression  ->
-                 Bool ->
-                 String ->
-                 Bool ->
-                 T_Rule 
-sem_Rule_Rule mbName_ (T_Pattern pattern_ ) (T_Expression rhs_ ) owrt_ origin_ explicit_  =
-    (T_Rule (\ _lhsIallTypeSigs
-               _lhsIallfields
-               _lhsIallnts
-               _lhsIaltAttrs
-               _lhsIattrs
-               _lhsIchildInhs
-               _lhsIchildNts
-               _lhsIcon
-               _lhsIinh
-               _lhsIinhsOfChildren
-               _lhsImergeMap
-               _lhsInt
-               _lhsIo_case
-               _lhsIo_cata
-               _lhsIo_dovisit
-               _lhsIo_newtypes
-               _lhsIo_rename
-               _lhsIo_sem
-               _lhsIo_sig
-               _lhsIo_wantvisit
-               _lhsIprefix
-               _lhsIsyn
-               _lhsIsynsOfChildren ->
-                 (let _lhsOnExplicitRules :: Int
-                      _lhsOnAutoRules :: Int
-                      _lhsOdirectDep :: (Seq Edge)
-                      _lhsOinstDep :: (Seq Edge)
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOgathAltAttrs :: ([AltAttr])
-                      _lhsOgathRules :: (Seq CRule)
-                      _lhsOinstVars :: ([Identifier])
-                      _lhsOlocVars :: ([Identifier])
-                      _patternOallTypeSigs :: (Map Identifier Type)
-                      _patternOaltAttrs :: (Map AltAttr Vertex)
-                      _patternOcon :: Identifier
-                      _patternOinh :: Attributes
-                      _patternOnt :: Identifier
-                      _patternOsyn :: Attributes
-                      _rhsOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                      _rhsOallnts :: ([Identifier])
-                      _rhsOattrs :: ([(Identifier,Identifier)])
-                      _rhsOcon :: Identifier
-                      _rhsOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                      _rhsOnt :: Identifier
-                      _patternIcopy :: Pattern 
-                      _patternIerrors :: (Seq Error)
-                      _patternIgathAltAttrs :: ([AltAttr])
-                      _patternIinstVars :: ([Identifier])
-                      _patternIlocVars :: ([Identifier])
-                      _patternIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
-                      _rhsIallRhsVars :: (Set (Identifier,Identifier))
-                      _rhsIcopy :: Expression 
-                      _rhsIerrors :: (Seq Error)
-                      _rhsItextLines :: ([String])
-                      _rhsIusedAttrs :: ([(Identifier,Identifier)])
-                      _rhsIusedFields :: ([Identifier])
-                      _rhsIusedLocals :: ([Identifier])
-                      -- "Order.ag"(line 64, column 11)
-                      _lhsOnExplicitRules =
-                          ({-# LINE 64 "Order.ag" #-}
-                           if explicit_
-                           then 1
-                           else 0
-                           {-# LINE 4631 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 67, column 11)
-                      _lhsOnAutoRules =
-                          ({-# LINE 67 "Order.ag" #-}
-                           if startsWith "use rule" origin_ || startsWith "copy rule" origin_
-                           then 1
-                           else 0
-                           {-# LINE 4639 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 217, column 12)
-                      _defines =
-                          ({-# LINE 217 "Order.ag" #-}
-                           let  tp field attr parts | field == _LOC || field == _INST
-                                                                    = case parts of
-                                                                        [] -> Map.lookup attr _lhsIallTypeSigs
-                                                                        _  -> (sequence (map typ parts)) >>= (haskellTupel . map (substSelf _lhsInt))
-                                                    | field == _LHS = Map.lookup attr _lhsIsyn
-                                                    | otherwise     = Map.lookup attr (findWithErr1 "Rule.defines.tp" field _lhsIchildInhs)
-                                typ :: Pattern -> Maybe Type
-                                typ (Alias field attr _ parts) = tp field attr parts
-                                typ (Underscore _)             = Nothing
-                                typ _                          = Nothing
-                           in Map.fromList  [ (findWithErr1 "Rule.defines" aa _lhsIaltAttrs, (field,attr,(tp field attr parts)))
-                                            | (field,attr,isLocalOrInst,parts) <- _patternIpatternAttrs
-                                            , let aa = AltAttr field attr isLocalOrInst
-                                            ]
-                           {-# LINE 4658 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 233, column 12)
-                      _gathRules =
-                          ({-# LINE 233 "Order.ag" #-}
-                           let childnt field = Map.lookup field _lhsIchildNts
-                           in Seq.fromList [ CRule attr False True _lhsInt _lhsIcon field (childnt field) tp _patternIcopy _rhsItextLines _defines owrt_ origin_ _rhsIallRhsVars explicit_ mbName_
-                                           | (field,attr,tp) <- Map.elems _defines
-                                           ]
-                           {-# LINE 4667 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 271, column 12)
-                      _lhsOdirectDep =
-                          ({-# LINE 271 "Order.ag" #-}
-                           let  defined = Map.keys _defines
-                                used =  [ Map.lookup (AltAttr field attr True) _lhsIaltAttrs | (field,attr) <- _rhsIusedAttrs]
-                                        ++ [ Map.lookup (AltAttr _LOC attr True) _lhsIaltAttrs | attr <- _rhsIusedLocals ++ _rhsIusedFields ]
-                           in Seq.fromList [ (x,y) | Just x <- used, y <- defined ]
-                           {-# LINE 4676 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 315, column 6)
-                      _instDep1 =
-                          ({-# LINE 315 "Order.ag" #-}
-                           Seq.fromList $
-                             [ (instVert, synVert)
-                             | (field,instNm,_) <- Map.elems _defines
-                             , field == _INST
-                             , synNm <- Map.keys (findWithErr2 instNm _lhsIsynsOfChildren)
-                             , let instAttr = AltAttr _INST instNm True
-                                   synAttr  = AltAttr instNm synNm True
-                                   instVert = findWithErr2 instAttr _lhsIaltAttrs
-                                   synVert  = findWithErr2 synAttr _lhsIaltAttrs
-                             ]
-                           {-# LINE 4691 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 326, column 6)
-                      _instDep2 =
-                          ({-# LINE 326 "Order.ag" #-}
-                           Seq.fromList $
-                             [ (instVert, inhVert)
-                             | (field,instNm,_) <- Map.elems _defines
-                             , field == _INST
-                             , inhNm <- Map.keys (findWithErr2 instNm _lhsIinhsOfChildren)
-                             , let instAttr = AltAttr _INST instNm True
-                                   inhAttr  = AltAttr instNm inhNm False
-                                   instVert = findWithErr2 instAttr _lhsIaltAttrs
-                                   inhVert  = findWithErr2 inhAttr _lhsIaltAttrs
-                             ]
-                           {-# LINE 4706 "Order.hs" #-}
-                           )
-                      -- "Order.ag"(line 337, column 6)
-                      _lhsOinstDep =
-                          ({-# LINE 337 "Order.ag" #-}
-                           _instDep1     Seq.>< _instDep2
-                           {-# LINE 4712 "Order.hs" #-}
-                           )
-                      -- use rule "Order.ag"(line 84, column 70)
-                      _lhsOerrors =
-                          ({-# LINE 84 "Order.ag" #-}
-                           _patternIerrors Seq.>< _rhsIerrors
-                           {-# LINE 4718 "Order.hs" #-}
-                           )
-                      -- use rule "Order.ag"(line 170, column 68)
-                      _lhsOgathAltAttrs =
-                          ({-# LINE 170 "Order.ag" #-}
-                           _patternIgathAltAttrs
-                           {-# LINE 4724 "Order.hs" #-}
-                           )
-                      -- use rule "Order.ag"(line 206, column 23)
-                      _lhsOgathRules =
-                          ({-# LINE 206 "Order.ag" #-}
-                           _gathRules
-                           {-# LINE 4730 "Order.hs" #-}
-                           )
-                      -- use rule "Order.ag"(line 677, column 86)
-                      _lhsOinstVars =
-                          ({-# LINE 677 "Order.ag" #-}
-                           _patternIinstVars
-                           {-# LINE 4736 "Order.hs" #-}
-                           )
-                      -- use rule "Order.ag"(line 677, column 48)
-                      _lhsOlocVars =
-                          ({-# LINE 677 "Order.ag" #-}
-                           _patternIlocVars
-                           {-# LINE 4742 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOallTypeSigs =
-                          ({-# LINE 533 "Order.ag" #-}
-                           _lhsIallTypeSigs
-                           {-# LINE 4748 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOaltAttrs =
-                          ({-# LINE 186 "Order.ag" #-}
-                           _lhsIaltAttrs
-                           {-# LINE 4754 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOcon =
-                          ({-# LINE 90 "Order.ag" #-}
-                           _lhsIcon
-                           {-# LINE 4760 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOinh =
-                          ({-# LINE 89 "Order.ag" #-}
-                           _lhsIinh
-                           {-# LINE 4766 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOnt =
-                          ({-# LINE 89 "Order.ag" #-}
-                           _lhsInt
-                           {-# LINE 4772 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _patternOsyn =
-                          ({-# LINE 89 "Order.ag" #-}
-                           _lhsIsyn
-                           {-# LINE 4778 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOallfields =
-                          ({-# LINE 448 "Order.ag" #-}
-                           _lhsIallfields
-                           {-# LINE 4784 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOallnts =
-                          ({-# LINE 449 "Order.ag" #-}
-                           _lhsIallnts
-                           {-# LINE 4790 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOattrs =
-                          ({-# LINE 450 "Order.ag" #-}
-                           _lhsIattrs
-                           {-# LINE 4796 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOcon =
-                          ({-# LINE 447 "Order.ag" #-}
-                           _lhsIcon
-                           {-# LINE 4802 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOmergeMap =
-                          ({-# LINE 362 "Order.ag" #-}
-                           _lhsImergeMap
-                           {-# LINE 4808 "Order.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _rhsOnt =
-                          ({-# LINE 447 "Order.ag" #-}
-                           _lhsInt
-                           {-# LINE 4814 "Order.hs" #-}
-                           )
-                      ( _patternIcopy,_patternIerrors,_patternIgathAltAttrs,_patternIinstVars,_patternIlocVars,_patternIpatternAttrs) =
-                          pattern_ _patternOallTypeSigs _patternOaltAttrs _patternOcon _patternOinh _patternOnt _patternOsyn 
-                      ( _rhsIallRhsVars,_rhsIcopy,_rhsIerrors,_rhsItextLines,_rhsIusedAttrs,_rhsIusedFields,_rhsIusedLocals) =
-                          rhs_ _rhsOallfields _rhsOallnts _rhsOattrs _rhsOcon _rhsOmergeMap _rhsOnt 
-                  in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
--- Rules -------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allTypeSigs          : Map Identifier Type
-         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
-         allnts               : [Identifier]
-         altAttrs             : Map AltAttr Vertex
-         attrs                : [(Identifier,Identifier)]
-         childInhs            : Map Identifier Attributes
-         childNts             : Map Identifier NontermIdent
-         con                  : Identifier
-         inh                  : Attributes
-         inhsOfChildren       : Map Identifier Attributes
-         mergeMap             : Map Identifier (Identifier,[Identifier])
-         nt                   : Identifier
-         o_case               : Bool
-         o_cata               : Bool
-         o_dovisit            : Bool
-         o_newtypes           : Bool
-         o_rename             : Bool
-         o_sem                : Bool
-         o_sig                : Bool
-         o_wantvisit          : Bool
-         prefix               : String
-         syn                  : Attributes
-         synsOfChildren       : Map Identifier Attributes
-      synthesized attributes:
-         directDep            : Seq Edge
-         errors               : Seq Error
-         gathAltAttrs         : [AltAttr]
-         gathRules            : Seq CRule
-         instDep              : Seq Edge
-         instVars             : [Identifier]
-         locVars              : [Identifier]
-         nAutoRules           : Int
-         nExplicitRules       : Int
-   alternatives:
-      alternative Cons:
-         child hd             : Rule 
-         child tl             : Rules 
-      alternative Nil:
--}
--- cata
-sem_Rules :: Rules  ->
-             T_Rules 
-sem_Rules list  =
-    (Prelude.foldr sem_Rules_Cons sem_Rules_Nil (Prelude.map sem_Rule list) )
--- semantic domain
-newtype T_Rules  = T_Rules ((Map Identifier Type) ->
-                            ([(Identifier,Type,Maybe (Maybe Type))]) ->
-                            ([Identifier]) ->
-                            (Map AltAttr Vertex) ->
-                            ([(Identifier,Identifier)]) ->
-                            (Map Identifier Attributes) ->
-                            (Map Identifier NontermIdent) ->
-                            Identifier ->
-                            Attributes ->
-                            (Map Identifier Attributes) ->
-                            (Map Identifier (Identifier,[Identifier])) ->
-                            Identifier ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            Bool ->
-                            String ->
-                            Attributes ->
-                            (Map Identifier Attributes) ->
-                            ( (Seq Edge),(Seq Error),([AltAttr]),(Seq CRule),(Seq Edge),([Identifier]),([Identifier]),Int,Int))
-data Inh_Rules  = Inh_Rules {allTypeSigs_Inh_Rules :: !((Map Identifier Type)),allfields_Inh_Rules :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Rules :: !(([Identifier])),altAttrs_Inh_Rules :: !((Map AltAttr Vertex)),attrs_Inh_Rules :: !(([(Identifier,Identifier)])),childInhs_Inh_Rules :: !((Map Identifier Attributes)),childNts_Inh_Rules :: !((Map Identifier NontermIdent)),con_Inh_Rules :: !(Identifier),inh_Inh_Rules :: !(Attributes),inhsOfChildren_Inh_Rules :: !((Map Identifier Attributes)),mergeMap_Inh_Rules :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Rules :: !(Identifier),o_case_Inh_Rules :: !(Bool),o_cata_Inh_Rules :: !(Bool),o_dovisit_Inh_Rules :: !(Bool),o_newtypes_Inh_Rules :: !(Bool),o_rename_Inh_Rules :: !(Bool),o_sem_Inh_Rules :: !(Bool),o_sig_Inh_Rules :: !(Bool),o_wantvisit_Inh_Rules :: !(Bool),prefix_Inh_Rules :: !(String),syn_Inh_Rules :: !(Attributes),synsOfChildren_Inh_Rules :: !((Map Identifier Attributes))}
-data Syn_Rules  = Syn_Rules {directDep_Syn_Rules :: !((Seq Edge)),errors_Syn_Rules :: !((Seq Error)),gathAltAttrs_Syn_Rules :: !(([AltAttr])),gathRules_Syn_Rules :: !((Seq CRule)),instDep_Syn_Rules :: !((Seq Edge)),instVars_Syn_Rules :: !(([Identifier])),locVars_Syn_Rules :: !(([Identifier])),nAutoRules_Syn_Rules :: !(Int),nExplicitRules_Syn_Rules :: !(Int)}
-wrap_Rules :: T_Rules  ->
-              Inh_Rules  ->
-              Syn_Rules 
-wrap_Rules (T_Rules sem ) (Inh_Rules _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren )  =
-    (let ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules) = sem _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren 
-     in  (Syn_Rules _lhsOdirectDep _lhsOerrors _lhsOgathAltAttrs _lhsOgathRules _lhsOinstDep _lhsOinstVars _lhsOlocVars _lhsOnAutoRules _lhsOnExplicitRules ))
-sem_Rules_Cons :: T_Rule  ->
-                  T_Rules  ->
-                  T_Rules 
-sem_Rules_Cons (T_Rule hd_ ) (T_Rules tl_ )  =
-    (T_Rules (\ _lhsIallTypeSigs
-                _lhsIallfields
-                _lhsIallnts
-                _lhsIaltAttrs
-                _lhsIattrs
-                _lhsIchildInhs
-                _lhsIchildNts
-                _lhsIcon
-                _lhsIinh
-                _lhsIinhsOfChildren
-                _lhsImergeMap
-                _lhsInt
-                _lhsIo_case
-                _lhsIo_cata
-                _lhsIo_dovisit
-                _lhsIo_newtypes
-                _lhsIo_rename
-                _lhsIo_sem
-                _lhsIo_sig
-                _lhsIo_wantvisit
-                _lhsIprefix
-                _lhsIsyn
-                _lhsIsynsOfChildren ->
-                  (let _lhsOdirectDep :: (Seq Edge)
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOgathAltAttrs :: ([AltAttr])
-                       _lhsOgathRules :: (Seq CRule)
-                       _lhsOinstDep :: (Seq Edge)
-                       _lhsOinstVars :: ([Identifier])
-                       _lhsOlocVars :: ([Identifier])
-                       _lhsOnAutoRules :: Int
-                       _lhsOnExplicitRules :: Int
-                       _hdOallTypeSigs :: (Map Identifier Type)
-                       _hdOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                       _hdOallnts :: ([Identifier])
-                       _hdOaltAttrs :: (Map AltAttr Vertex)
-                       _hdOattrs :: ([(Identifier,Identifier)])
-                       _hdOchildInhs :: (Map Identifier Attributes)
-                       _hdOchildNts :: (Map Identifier NontermIdent)
-                       _hdOcon :: Identifier
-                       _hdOinh :: Attributes
-                       _hdOinhsOfChildren :: (Map Identifier Attributes)
-                       _hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                       _hdOnt :: Identifier
-                       _hdOo_case :: Bool
-                       _hdOo_cata :: Bool
-                       _hdOo_dovisit :: Bool
-                       _hdOo_newtypes :: Bool
-                       _hdOo_rename :: Bool
-                       _hdOo_sem :: Bool
-                       _hdOo_sig :: Bool
-                       _hdOo_wantvisit :: Bool
-                       _hdOprefix :: String
-                       _hdOsyn :: Attributes
-                       _hdOsynsOfChildren :: (Map Identifier Attributes)
-                       _tlOallTypeSigs :: (Map Identifier Type)
-                       _tlOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
-                       _tlOallnts :: ([Identifier])
-                       _tlOaltAttrs :: (Map AltAttr Vertex)
-                       _tlOattrs :: ([(Identifier,Identifier)])
-                       _tlOchildInhs :: (Map Identifier Attributes)
-                       _tlOchildNts :: (Map Identifier NontermIdent)
-                       _tlOcon :: Identifier
-                       _tlOinh :: Attributes
-                       _tlOinhsOfChildren :: (Map Identifier Attributes)
-                       _tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
-                       _tlOnt :: Identifier
-                       _tlOo_case :: Bool
-                       _tlOo_cata :: Bool
-                       _tlOo_dovisit :: Bool
-                       _tlOo_newtypes :: Bool
-                       _tlOo_rename :: Bool
-                       _tlOo_sem :: Bool
-                       _tlOo_sig :: Bool
-                       _tlOo_wantvisit :: Bool
-                       _tlOprefix :: String
-                       _tlOsyn :: Attributes
-                       _tlOsynsOfChildren :: (Map Identifier Attributes)
-                       _hdIdirectDep :: (Seq Edge)
-                       _hdIerrors :: (Seq Error)
-                       _hdIgathAltAttrs :: ([AltAttr])
-                       _hdIgathRules :: (Seq CRule)
-                       _hdIinstDep :: (Seq Edge)
-                       _hdIinstVars :: ([Identifier])
-                       _hdIlocVars :: ([Identifier])
-                       _hdInAutoRules :: Int
-                       _hdInExplicitRules :: Int
-                       _tlIdirectDep :: (Seq Edge)
-                       _tlIerrors :: (Seq Error)
-                       _tlIgathAltAttrs :: ([AltAttr])
-                       _tlIgathRules :: (Seq CRule)
-                       _tlIinstDep :: (Seq Edge)
-                       _tlIinstVars :: ([Identifier])
-                       _tlIlocVars :: ([Identifier])
-                       _tlInAutoRules :: Int
-                       _tlInExplicitRules :: Int
-                       -- use rule "Order.ag"(line 269, column 33)
-                       _lhsOdirectDep =
-                           ({-# LINE 269 "Order.ag" #-}
-                            _hdIdirectDep Seq.>< _tlIdirectDep
-                            {-# LINE 5006 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 84, column 70)
-                       _lhsOerrors =
-                           ({-# LINE 84 "Order.ag" #-}
-                            _hdIerrors Seq.>< _tlIerrors
-                            {-# LINE 5012 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 170, column 68)
-                       _lhsOgathAltAttrs =
-                           ({-# LINE 170 "Order.ag" #-}
-                            _hdIgathAltAttrs ++ _tlIgathAltAttrs
-                            {-# LINE 5018 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 206, column 23)
-                       _lhsOgathRules =
-                           ({-# LINE 206 "Order.ag" #-}
-                            _hdIgathRules Seq.>< _tlIgathRules
-                            {-# LINE 5024 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 312, column 31)
-                       _lhsOinstDep =
-                           ({-# LINE 312 "Order.ag" #-}
-                            _hdIinstDep Seq.>< _tlIinstDep
-                            {-# LINE 5030 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 677, column 86)
-                       _lhsOinstVars =
-                           ({-# LINE 677 "Order.ag" #-}
-                            _hdIinstVars ++ _tlIinstVars
-                            {-# LINE 5036 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 677, column 48)
-                       _lhsOlocVars =
-                           ({-# LINE 677 "Order.ag" #-}
-                            _hdIlocVars ++ _tlIlocVars
-                            {-# LINE 5042 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 61, column 105)
-                       _lhsOnAutoRules =
-                           ({-# LINE 61 "Order.ag" #-}
-                            _hdInAutoRules + _tlInAutoRules
-                            {-# LINE 5048 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 61, column 105)
-                       _lhsOnExplicitRules =
-                           ({-# LINE 61 "Order.ag" #-}
-                            _hdInExplicitRules + _tlInExplicitRules
-                            {-# LINE 5054 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallTypeSigs =
-                           ({-# LINE 533 "Order.ag" #-}
-                            _lhsIallTypeSigs
-                            {-# LINE 5060 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallfields =
-                           ({-# LINE 654 "Order.ag" #-}
-                            _lhsIallfields
-                            {-# LINE 5066 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallnts =
-                           ({-# LINE 647 "Order.ag" #-}
-                            _lhsIallnts
-                            {-# LINE 5072 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOaltAttrs =
-                           ({-# LINE 186 "Order.ag" #-}
-                            _lhsIaltAttrs
-                            {-# LINE 5078 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOattrs =
-                           ({-# LINE 654 "Order.ag" #-}
-                            _lhsIattrs
-                            {-# LINE 5084 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOchildInhs =
-                           ({-# LINE 199 "Order.ag" #-}
-                            _lhsIchildInhs
-                            {-# LINE 5090 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOchildNts =
-                           ({-# LINE 198 "Order.ag" #-}
-                            _lhsIchildNts
-                            {-# LINE 5096 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOcon =
-                           ({-# LINE 90 "Order.ag" #-}
-                            _lhsIcon
-                            {-# LINE 5102 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOinh =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsIinh
-                            {-# LINE 5108 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOinhsOfChildren =
-                           ({-# LINE 339 "Order.ag" #-}
-                            _lhsIinhsOfChildren
-                            {-# LINE 5114 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOmergeMap =
-                           ({-# LINE 362 "Order.ag" #-}
-                            _lhsImergeMap
-                            {-# LINE 5120 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOnt =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsInt
-                            {-# LINE 5126 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_case =
-                           ({-# LINE 117 "Order.ag" #-}
-                            _lhsIo_case
-                            {-# LINE 5132 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_cata =
-                           ({-# LINE 111 "Order.ag" #-}
-                            _lhsIo_cata
-                            {-# LINE 5138 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_dovisit =
-                           ({-# LINE 116 "Order.ag" #-}
-                            _lhsIo_dovisit
-                            {-# LINE 5144 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_newtypes =
-                           ({-# LINE 110 "Order.ag" #-}
-                            _lhsIo_newtypes
-                            {-# LINE 5150 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_rename =
-                           ({-# LINE 114 "Order.ag" #-}
-                            _lhsIo_rename
-                            {-# LINE 5156 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_sem =
-                           ({-# LINE 113 "Order.ag" #-}
-                            _lhsIo_sem
-                            {-# LINE 5162 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_sig =
-                           ({-# LINE 112 "Order.ag" #-}
-                            _lhsIo_sig
-                            {-# LINE 5168 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOo_wantvisit =
-                           ({-# LINE 115 "Order.ag" #-}
-                            _lhsIo_wantvisit
-                            {-# LINE 5174 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOprefix =
-                           ({-# LINE 118 "Order.ag" #-}
-                            _lhsIprefix
-                            {-# LINE 5180 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOsyn =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsIsyn
-                            {-# LINE 5186 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOsynsOfChildren =
-                           ({-# LINE 339 "Order.ag" #-}
-                            _lhsIsynsOfChildren
-                            {-# LINE 5192 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallTypeSigs =
-                           ({-# LINE 533 "Order.ag" #-}
-                            _lhsIallTypeSigs
-                            {-# LINE 5198 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallfields =
-                           ({-# LINE 654 "Order.ag" #-}
-                            _lhsIallfields
-                            {-# LINE 5204 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallnts =
-                           ({-# LINE 647 "Order.ag" #-}
-                            _lhsIallnts
-                            {-# LINE 5210 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOaltAttrs =
-                           ({-# LINE 186 "Order.ag" #-}
-                            _lhsIaltAttrs
-                            {-# LINE 5216 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOattrs =
-                           ({-# LINE 654 "Order.ag" #-}
-                            _lhsIattrs
-                            {-# LINE 5222 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOchildInhs =
-                           ({-# LINE 199 "Order.ag" #-}
-                            _lhsIchildInhs
-                            {-# LINE 5228 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOchildNts =
-                           ({-# LINE 198 "Order.ag" #-}
-                            _lhsIchildNts
-                            {-# LINE 5234 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOcon =
-                           ({-# LINE 90 "Order.ag" #-}
-                            _lhsIcon
-                            {-# LINE 5240 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOinh =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsIinh
-                            {-# LINE 5246 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOinhsOfChildren =
-                           ({-# LINE 339 "Order.ag" #-}
-                            _lhsIinhsOfChildren
-                            {-# LINE 5252 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOmergeMap =
-                           ({-# LINE 362 "Order.ag" #-}
-                            _lhsImergeMap
-                            {-# LINE 5258 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOnt =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsInt
-                            {-# LINE 5264 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_case =
-                           ({-# LINE 117 "Order.ag" #-}
-                            _lhsIo_case
-                            {-# LINE 5270 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_cata =
-                           ({-# LINE 111 "Order.ag" #-}
-                            _lhsIo_cata
-                            {-# LINE 5276 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_dovisit =
-                           ({-# LINE 116 "Order.ag" #-}
-                            _lhsIo_dovisit
-                            {-# LINE 5282 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_newtypes =
-                           ({-# LINE 110 "Order.ag" #-}
-                            _lhsIo_newtypes
-                            {-# LINE 5288 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_rename =
-                           ({-# LINE 114 "Order.ag" #-}
-                            _lhsIo_rename
-                            {-# LINE 5294 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_sem =
-                           ({-# LINE 113 "Order.ag" #-}
-                            _lhsIo_sem
-                            {-# LINE 5300 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_sig =
-                           ({-# LINE 112 "Order.ag" #-}
-                            _lhsIo_sig
-                            {-# LINE 5306 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOo_wantvisit =
-                           ({-# LINE 115 "Order.ag" #-}
-                            _lhsIo_wantvisit
-                            {-# LINE 5312 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOprefix =
-                           ({-# LINE 118 "Order.ag" #-}
-                            _lhsIprefix
-                            {-# LINE 5318 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOsyn =
-                           ({-# LINE 89 "Order.ag" #-}
-                            _lhsIsyn
-                            {-# LINE 5324 "Order.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOsynsOfChildren =
-                           ({-# LINE 339 "Order.ag" #-}
-                            _lhsIsynsOfChildren
-                            {-# LINE 5330 "Order.hs" #-}
-                            )
-                       ( _hdIdirectDep,_hdIerrors,_hdIgathAltAttrs,_hdIgathRules,_hdIinstDep,_hdIinstVars,_hdIlocVars,_hdInAutoRules,_hdInExplicitRules) =
-                           hd_ _hdOallTypeSigs _hdOallfields _hdOallnts _hdOaltAttrs _hdOattrs _hdOchildInhs _hdOchildNts _hdOcon _hdOinh _hdOinhsOfChildren _hdOmergeMap _hdOnt _hdOo_case _hdOo_cata _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_wantvisit _hdOprefix _hdOsyn _hdOsynsOfChildren 
-                       ( _tlIdirectDep,_tlIerrors,_tlIgathAltAttrs,_tlIgathRules,_tlIinstDep,_tlIinstVars,_tlIlocVars,_tlInAutoRules,_tlInExplicitRules) =
-                           tl_ _tlOallTypeSigs _tlOallfields _tlOallnts _tlOaltAttrs _tlOattrs _tlOchildInhs _tlOchildNts _tlOcon _tlOinh _tlOinhsOfChildren _tlOmergeMap _tlOnt _tlOo_case _tlOo_cata _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_wantvisit _tlOprefix _tlOsyn _tlOsynsOfChildren 
-                   in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
-sem_Rules_Nil :: T_Rules 
-sem_Rules_Nil  =
-    (T_Rules (\ _lhsIallTypeSigs
-                _lhsIallfields
-                _lhsIallnts
-                _lhsIaltAttrs
-                _lhsIattrs
-                _lhsIchildInhs
-                _lhsIchildNts
-                _lhsIcon
-                _lhsIinh
-                _lhsIinhsOfChildren
-                _lhsImergeMap
-                _lhsInt
-                _lhsIo_case
-                _lhsIo_cata
-                _lhsIo_dovisit
-                _lhsIo_newtypes
-                _lhsIo_rename
-                _lhsIo_sem
-                _lhsIo_sig
-                _lhsIo_wantvisit
-                _lhsIprefix
-                _lhsIsyn
-                _lhsIsynsOfChildren ->
-                  (let _lhsOdirectDep :: (Seq Edge)
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOgathAltAttrs :: ([AltAttr])
-                       _lhsOgathRules :: (Seq CRule)
-                       _lhsOinstDep :: (Seq Edge)
-                       _lhsOinstVars :: ([Identifier])
-                       _lhsOlocVars :: ([Identifier])
-                       _lhsOnAutoRules :: Int
-                       _lhsOnExplicitRules :: Int
-                       -- use rule "Order.ag"(line 269, column 33)
-                       _lhsOdirectDep =
-                           ({-# LINE 269 "Order.ag" #-}
-                            Seq.empty
-                            {-# LINE 5375 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 84, column 70)
-                       _lhsOerrors =
-                           ({-# LINE 84 "Order.ag" #-}
-                            Seq.empty
-                            {-# LINE 5381 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 170, column 68)
-                       _lhsOgathAltAttrs =
-                           ({-# LINE 170 "Order.ag" #-}
-                            []
-                            {-# LINE 5387 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 206, column 23)
-                       _lhsOgathRules =
-                           ({-# LINE 206 "Order.ag" #-}
-                            Seq.empty
-                            {-# LINE 5393 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 312, column 31)
-                       _lhsOinstDep =
-                           ({-# LINE 312 "Order.ag" #-}
-                            Seq.empty
-                            {-# LINE 5399 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 677, column 86)
-                       _lhsOinstVars =
-                           ({-# LINE 677 "Order.ag" #-}
-                            []
-                            {-# LINE 5405 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 677, column 48)
-                       _lhsOlocVars =
-                           ({-# LINE 677 "Order.ag" #-}
-                            []
-                            {-# LINE 5411 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 61, column 105)
-                       _lhsOnAutoRules =
-                           ({-# LINE 61 "Order.ag" #-}
-                            0
-                            {-# LINE 5417 "Order.hs" #-}
-                            )
-                       -- use rule "Order.ag"(line 61, column 105)
-                       _lhsOnExplicitRules =
-                           ({-# LINE 61 "Order.ag" #-}
-                            0
-                            {-# LINE 5423 "Order.hs" #-}
-                            )
-                   in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
--- TypeSig -----------------------------------------------------
-{-
-   visit 0:
-      chained attribute:
-         typeSigs             : Map Identifier Type
-   alternatives:
-      alternative TypeSig:
-         child name           : {Identifier}
-         child tp             : {Type}
--}
--- cata
-sem_TypeSig :: TypeSig  ->
-               T_TypeSig 
-sem_TypeSig (TypeSig _name _tp )  =
-    (sem_TypeSig_TypeSig _name _tp )
--- semantic domain
-newtype T_TypeSig  = T_TypeSig ((Map Identifier Type) ->
-                                ( (Map Identifier Type)))
-data Inh_TypeSig  = Inh_TypeSig {typeSigs_Inh_TypeSig :: !((Map Identifier Type))}
-data Syn_TypeSig  = Syn_TypeSig {typeSigs_Syn_TypeSig :: !((Map Identifier Type))}
-wrap_TypeSig :: T_TypeSig  ->
-                Inh_TypeSig  ->
-                Syn_TypeSig 
-wrap_TypeSig (T_TypeSig sem ) (Inh_TypeSig _lhsItypeSigs )  =
-    (let ( _lhsOtypeSigs) = sem _lhsItypeSigs 
-     in  (Syn_TypeSig _lhsOtypeSigs ))
-sem_TypeSig_TypeSig :: Identifier ->
-                       Type ->
-                       T_TypeSig 
-sem_TypeSig_TypeSig name_ tp_  =
-    (T_TypeSig (\ _lhsItypeSigs ->
-                    (let _lhsOtypeSigs :: (Map Identifier Type)
-                         -- "Order.ag"(line 531, column 13)
-                         _lhsOtypeSigs =
-                             ({-# LINE 531 "Order.ag" #-}
-                              Map.insert name_ tp_ _lhsItypeSigs
-                              {-# LINE 5462 "Order.hs" #-}
-                              )
-                     in  ( _lhsOtypeSigs))) )
--- TypeSigs ----------------------------------------------------
-{-
-   visit 0:
-      chained attribute:
-         typeSigs             : Map Identifier Type
-   alternatives:
-      alternative Cons:
-         child hd             : TypeSig 
-         child tl             : TypeSigs 
-      alternative Nil:
--}
--- cata
-sem_TypeSigs :: TypeSigs  ->
-                T_TypeSigs 
-sem_TypeSigs list  =
-    (Prelude.foldr sem_TypeSigs_Cons sem_TypeSigs_Nil (Prelude.map sem_TypeSig list) )
--- semantic domain
-newtype T_TypeSigs  = T_TypeSigs ((Map Identifier Type) ->
-                                  ( (Map Identifier Type)))
-data Inh_TypeSigs  = Inh_TypeSigs {typeSigs_Inh_TypeSigs :: !((Map Identifier Type))}
-data Syn_TypeSigs  = Syn_TypeSigs {typeSigs_Syn_TypeSigs :: !((Map Identifier Type))}
-wrap_TypeSigs :: T_TypeSigs  ->
-                 Inh_TypeSigs  ->
-                 Syn_TypeSigs 
-wrap_TypeSigs (T_TypeSigs sem ) (Inh_TypeSigs _lhsItypeSigs )  =
-    (let ( _lhsOtypeSigs) = sem _lhsItypeSigs 
-     in  (Syn_TypeSigs _lhsOtypeSigs ))
-sem_TypeSigs_Cons :: T_TypeSig  ->
-                     T_TypeSigs  ->
-                     T_TypeSigs 
-sem_TypeSigs_Cons (T_TypeSig hd_ ) (T_TypeSigs tl_ )  =
-    (T_TypeSigs (\ _lhsItypeSigs ->
-                     (let _lhsOtypeSigs :: (Map Identifier Type)
-                          _hdOtypeSigs :: (Map Identifier Type)
-                          _tlOtypeSigs :: (Map Identifier Type)
-                          _hdItypeSigs :: (Map Identifier Type)
-                          _tlItypeSigs :: (Map Identifier Type)
-                          -- copy rule (up)
-                          _lhsOtypeSigs =
-                              ({-# LINE 527 "Order.ag" #-}
-                               _tlItypeSigs
-                               {-# LINE 5506 "Order.hs" #-}
-                               )
-                          -- copy rule (down)
-                          _hdOtypeSigs =
-                              ({-# LINE 527 "Order.ag" #-}
-                               _lhsItypeSigs
-                               {-# LINE 5512 "Order.hs" #-}
-                               )
-                          -- copy rule (chain)
-                          _tlOtypeSigs =
-                              ({-# LINE 527 "Order.ag" #-}
-                               _hdItypeSigs
-                               {-# LINE 5518 "Order.hs" #-}
-                               )
-                          ( _hdItypeSigs) =
-                              hd_ _hdOtypeSigs 
-                          ( _tlItypeSigs) =
-                              tl_ _tlOtypeSigs 
-                      in  ( _lhsOtypeSigs))) )
-sem_TypeSigs_Nil :: T_TypeSigs 
-sem_TypeSigs_Nil  =
-    (T_TypeSigs (\ _lhsItypeSigs ->
-                     (let _lhsOtypeSigs :: (Map Identifier Type)
-                          -- copy rule (chain)
-                          _lhsOtypeSigs =
-                              ({-# LINE 527 "Order.ag" #-}
-                               _lhsItypeSigs
-                               {-# LINE 5533 "Order.hs" #-}
+-- UUAGC 0.9.38.6 (Order.ag)
+module Order where
+{-# LINE 9 "Order.ag" #-}
+
+-- From uuagc
+import CommonTypes
+import Patterns
+import ErrorMessages
+import AbstractSyntax
+import Code hiding (Type)
+import qualified Code
+import Expression
+import Options
+import SequentialComputation
+import SequentialTypes
+import CodeSyntax
+import GrammarInfo
+import HsToken(HsTokensRoot(HsTokensRoot))
+import HsTokenScanner(lexTokens)
+import SemHsTokens(sem_HsTokensRoot,wrap_HsTokensRoot, Syn_HsTokensRoot(..),Inh_HsTokensRoot(..))
+-- From uulib
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import qualified Data.Sequence as Seq
+import Data.Map(Map)
+import Data.Set(Set)
+import Data.Sequence(Seq, (><))
+import UU.Util.Utils
+import UU.Scanner.Position(Pos(..),initPos)
+import Data.Foldable(toList)
+
+-- From haskell libraries
+import Control.Monad(liftM)
+import qualified Data.Array as Array
+import Data.Array((!),bounds,inRange)
+import Data.List(elemIndex,partition,sort,mapAccumL,find,nubBy,intersperse,groupBy,transpose)
+import qualified Data.Tree as Tree
+import Maybe
+{-# LINE 42 "../src-derived/Order.hs" #-}
+
+{-# LINE 2 "./Patterns.ag" #-}
+
+-- Patterns.ag imports
+import UU.Scanner.Position(Pos)
+import CommonTypes (ConstructorIdent,Identifier)
+{-# LINE 49 "../src-derived/Order.hs" #-}
+
+{-# LINE 2 "./Expression.ag" #-}
+
+import UU.Scanner.Position(Pos)
+import HsToken
+{-# LINE 55 "../src-derived/Order.hs" #-}
+
+{-# LINE 2 "./AbstractSyntax.ag" #-}
+
+-- AbstractSyntax.ag imports
+import Data.Set(Set)
+import Data.Map(Map)
+import Patterns    (Pattern(..),Patterns)
+import Expression  (Expression(..))
+import CommonTypes
+{-# LINE 65 "../src-derived/Order.hs" #-}
+{-# LINE 46 "Order.ag" #-}
+
+-- Terminates with an error if the key is not in the map
+findWithErr1 :: (Ord k, Show k) => String -> k -> Map k a -> a
+findWithErr1 s k
+  = Map.findWithDefault (error ("findWithErr1 " ++ s ++ ": key " ++ show k ++ " not in map.")) k
+
+findWithErr2 :: (Ord k, Show k, Show a) => k -> Map k a -> a
+findWithErr2 k m
+  = Map.findWithDefault (error ("findWithErr2: key " ++ show k ++ " not in map: " ++ show m)) k m
+{-# LINE 76 "../src-derived/Order.hs" #-}
+
+{-# LINE 71 "Order.ag" #-}
+
+startsWith :: String -> String -> Bool
+startsWith k h = k == take (length k) h
+{-# LINE 82 "../src-derived/Order.hs" #-}
+
+{-# LINE 138 "Order.ag" #-}
+
+getNtName :: Type -> NontermIdent
+getNtName (NT nt _) = maybe nt id (deforestedNt nt)
+getNtName _         = nullIdent
+{-# LINE 89 "../src-derived/Order.hs" #-}
+
+{-# LINE 166 "Order.ag" #-}
+
+data AltAttr = AltAttr Identifier Identifier Bool
+               deriving (Eq, Ord, Show)
+{-# LINE 95 "../src-derived/Order.hs" #-}
+
+{-# LINE 238 "Order.ag" #-}
+
+substSelf nt tp
+  = case tp of
+      NT n tps | n == _SELF -> NT nt tps
+      _                     -> tp
+
+haskellTupel :: [Type] -> Maybe Type
+haskellTupel ts =  Just ( Haskell ( '(' : (concat (intersperse "," (map show ts))) ++ ")" ))
+{-# LINE 106 "../src-derived/Order.hs" #-}
+
+{-# LINE 689 "Order.ag" #-}
+
+swap (a,b) = (b,a)
+
+showPath :: Table CRule -> [Vertex] -> [String]
+showPath ruleTable path
+  =  let  look a | inRange (bounds ruleTable) a = [showOrigin (ruleTable ! a)]
+                 | otherwise = ["Vertex " ++ show a]
+          showOrigin cr  | getHasCode cr && getName (getAttr cr) /= "self" = prettyCRule cr ++ " (" ++ show (getPos (getAttr cr)) ++ ")"
+                         | otherwise = prettyCRule cr
+     in concatMap look path
+
+
+showPathLocal :: Table CRule -> [Vertex] -> [String]
+showPathLocal _ [] = []
+showPathLocal ruleTable xs = showP (xs++[-1])
+ where showP []         = []
+       showP (v1:v2:vs) = let line  = step v1 v2
+                              lines = showP vs
+                          in  line:lines
+       step v1 v2  = " - " ++ a1
+        where r1 = ruleTable ! v1
+              a1 = show (getAttr  r1)
+
+
+limitTo :: Int -> [String] -> [String]
+limitTo _ [] = []
+limitTo 0 _ = ["....etcetera, etcetera...."]
+limitTo n (x:xs) = x : limitTo (n-1) xs
+
+showPathNice :: Table CRule -> [Vertex] -> [String]
+showPathNice _ [] = []
+showPathNice ruleTable xs = limitTo 100 (showP ((-1):xs++[-1]))
+ where [maxf, maxa, maxn, maxc] = maxWidths ruleTable (take 100 xs)
+       showP []         = []
+       showP (v1:v2:vs) = let line  = step v1 v2
+                              lines = showP vs
+                          in  if null line  then lines  else line:lines
+       step v1 v2  |  last &&      first    = induced
+                   |  last &&     isSyn r1  = "pass up        "  ++ alignR maxf ""    ++ " " ++ alignL maxa a1 ++ " in " ++ alignR maxn n1 ++ "|" ++ c1 ++ induced
+                   |  first&& not(isSyn r2) = "get from above "  ++ alignR maxf ""    ++ " " ++ alignL maxa a2 ++ " in " ++ alignR maxn n2 ++ "|" ++ c2
+                   |  last                  = "pass down      "  ++ alignR maxf f1    ++ "." ++ a1                                                      ++ induced
+                   |              isSyn r2  = "get from below "  ++ alignR maxf f2    ++ "." ++ alignL maxa a2 ++ " in " ++ alignR maxn n2 ++ "|" ++ c2
+                   |  isLocal r1  = if head a1 == '_'
+                                         then ""
+                                         else "calculate      "  ++ alignR maxf "loc" ++ "." ++ a1
+                   |  otherwise             = "pass down      "  ++ alignR maxf f1    ++ "." ++ alignL maxa a1 ++ " to " ++ alignR maxn n2 ++ "|" ++ c2
+          where
+              first = v1<0
+              last  = v2<0
+              r1 = ruleTable ! v1
+              r2 = ruleTable ! v2
+              a1 = show (getAttr  r1)
+              a2 = show (getAttr  r2)
+              f1 = show (getField r1)
+              f2 = show (getField r2)
+              n1 = show (getLhsNt r1)
+              n2 = show (getLhsNt r2)
+              c1 = show (getCon   r1)
+              c2 = show (getCon   r2)
+              induced | v2== -2   =  " INDUCED dependency to "
+                      | otherwise = ""
+
+
+maxWidths ruleTable vs
+  = map maximum (transpose (map getWidth vs))
+  where getWidth v | v<0       = [0,0,0,0]
+                   | otherwise = map (length . show . ($ (ruleTable!v))) [getField, getAttr, getLhsNt, getCon]
+
+alignL n xs | k<n       = xs ++ replicate (n-k) ' '
+            | otherwise = xs
+              where k = length xs
+
+alignR n xs | k<n       = replicate (n-k) ' ' ++ xs
+            | otherwise = xs
+              where k = length xs
+
+localCycleErr :: Table CRule -> Bool -> Route -> Error
+localCycleErr ruleTable o_visit (s:path)
+  =  let cr = ruleTable ! s
+         attr = getAttr cr
+         nt = getLhsNt cr
+         con = getCon cr
+     in LocalCirc nt con attr o_visit (showPathLocal ruleTable path)
+
+instCycleErr :: Table CRule -> Bool -> Route -> Error
+instCycleErr ruleTable o_visit (s:path)
+  =  let cr = ruleTable ! s
+         attr = getAttr cr
+         nt = getLhsNt cr
+         con = getCon cr
+     in InstCirc nt con attr o_visit (showPathLocal ruleTable path)
+
+directCycleErrs :: Table NTAttr -> Table CRule -> Bool -> [EdgeRoutes] -> [Error]
+directCycleErrs attrTable ruleTable o_visit xs
+  = let getNont v = case attrTable ! v of
+                      NTASyn nt _ _ -> nt
+                      NTAInh nt _ _ -> nt
+        getAttr v = case attrTable ! v of
+                      NTASyn _ a _  -> a
+                      NTAInh _ a _  -> a
+        sameNont ((v1,_),_,_) ((v2,_),_,_) =  getNont v1 == getNont v2
+        procCycle ((v1,v2),p1,p2) = ((getAttr v1, getAttr v2), showPathNice ruleTable p1, showPathNice ruleTable p2)
+        wrapGroup gr@(((v1,_),_,_):_) = DirectCirc (getNont v1) o_visit (map procCycle gr)
+    in  map wrapGroup (groupBy sameNont xs)
+
+inducedCycleErrs :: Table NTAttr -> Table CRule -> CInterfaceMap -> [EdgeRoutes] -> [Error]
+inducedCycleErrs attrTable ruleTable cim xs
+  = let getNont v = case attrTable ! v of
+                      NTASyn nt _ _ -> nt
+                      NTAInh nt _ _ -> nt
+        getAttr v = case attrTable ! v of
+                      NTASyn _ a _  -> a
+                      NTAInh _ a _  -> a
+        sameNont ((v1,_),_,_) ((v2,_),_,_) =  getNont v1 == getNont v2
+        procCycle ((v1,v2),p1,p2) = ((getAttr v1, getAttr v2), showPathNice ruleTable p1, showPathNice ruleTable p2)
+        wrapGroup gr@(((v1,_),_,_):_) = InducedCirc (getNont v1) (findWithErr1 "inducedCycleErr.cinter" (getNont v1) cim) (map procCycle gr)
+    in  map wrapGroup (groupBy sameNont xs)
+{-# LINE 226 "../src-derived/Order.hs" #-}
+-- Child -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
+         allnts               : [Identifier]
+         attrs                : [(Identifier,Identifier)]
+         con                  : Identifier
+         inh                  : Attributes
+         mergeMap             : Map Identifier (Identifier,[Identifier])
+         nt                   : Identifier
+         o_unbox              : Bool
+         syn                  : Attributes
+      synthesized attributes:
+         attributes           : [(Identifier,Attributes,Attributes)]
+         collectChildrenInhs  : Map Identifier Attributes 
+         collectChildrenSyns  : Map Identifier Attributes 
+         errors               : Seq Error
+         field                : (Identifier,Type,Maybe (Maybe Type))
+         gathAltAttrs         : [AltAttr]
+         gathRules            : Seq CRule
+         inhs                 : Seq (Identifier,Attributes)
+         nts                  : Seq (Identifier,NontermIdent)
+         singlevisits         : [CRule]
+         terminals            : [Identifier]
+   alternatives:
+      alternative Child:
+         child name           : {Identifier}
+         child tp             : {Type}
+         child inh            : {Attributes}
+         child syn            : {Attributes}
+         child virtual        : {Maybe (Maybe Type)}
+         visit 0:
+            local maptolocal  : _
+            local gathRules   : _
+-}
+-- cata
+sem_Child :: Child  ->
+             T_Child 
+sem_Child (Child _name _tp _inh _syn _virtual )  =
+    (sem_Child_Child _name _tp _inh _syn _virtual )
+-- semantic domain
+newtype T_Child  = T_Child (([(Identifier,Type,Maybe (Maybe Type))]) ->
+                            ([Identifier]) ->
+                            ([(Identifier,Identifier)]) ->
+                            Identifier ->
+                            Attributes ->
+                            (Map Identifier (Identifier,[Identifier])) ->
+                            Identifier ->
+                            Bool ->
+                            Attributes ->
+                            ( ([(Identifier,Attributes,Attributes)]),(Map Identifier Attributes ),(Map Identifier Attributes ),(Seq Error),((Identifier,Type,Maybe (Maybe Type))),([AltAttr]),(Seq CRule),(Seq (Identifier,Attributes)),(Seq (Identifier,NontermIdent)),([CRule]),([Identifier])))
+data Inh_Child  = Inh_Child {allfields_Inh_Child :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Child :: !(([Identifier])),attrs_Inh_Child :: !(([(Identifier,Identifier)])),con_Inh_Child :: !(Identifier),inh_Inh_Child :: !(Attributes),mergeMap_Inh_Child :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Child :: !(Identifier),o_unbox_Inh_Child :: !(Bool),syn_Inh_Child :: !(Attributes)}
+data Syn_Child  = Syn_Child {attributes_Syn_Child :: !(([(Identifier,Attributes,Attributes)])),collectChildrenInhs_Syn_Child :: !((Map Identifier Attributes )),collectChildrenSyns_Syn_Child :: !((Map Identifier Attributes )),errors_Syn_Child :: !((Seq Error)),field_Syn_Child :: !(((Identifier,Type,Maybe (Maybe Type)))),gathAltAttrs_Syn_Child :: !(([AltAttr])),gathRules_Syn_Child :: !((Seq CRule)),inhs_Syn_Child :: !((Seq (Identifier,Attributes))),nts_Syn_Child :: !((Seq (Identifier,NontermIdent))),singlevisits_Syn_Child :: !(([CRule])),terminals_Syn_Child :: !(([Identifier]))}
+wrap_Child :: T_Child  ->
+              Inh_Child  ->
+              Syn_Child 
+wrap_Child (T_Child sem ) (Inh_Child _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn )  =
+    (let ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfield,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn 
+     in  (Syn_Child _lhsOattributes _lhsOcollectChildrenInhs _lhsOcollectChildrenSyns _lhsOerrors _lhsOfield _lhsOgathAltAttrs _lhsOgathRules _lhsOinhs _lhsOnts _lhsOsinglevisits _lhsOterminals ))
+sem_Child_Child :: Identifier ->
+                   Type ->
+                   Attributes ->
+                   Attributes ->
+                   (Maybe (Maybe Type)) ->
+                   T_Child 
+sem_Child_Child name_ tp_ inh_ syn_ virtual_  =
+    (T_Child (\ _lhsIallfields
+                _lhsIallnts
+                _lhsIattrs
+                _lhsIcon
+                _lhsIinh
+                _lhsImergeMap
+                _lhsInt
+                _lhsIo_unbox
+                _lhsIsyn ->
+                  (let _lhsOgathAltAttrs :: ([AltAttr])
+                       _lhsOnts :: (Seq (Identifier,NontermIdent))
+                       _lhsOinhs :: (Seq (Identifier,Attributes))
+                       _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
+                       _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
+                       _lhsOsinglevisits :: ([CRule])
+                       _lhsOterminals :: ([Identifier])
+                       _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
+                       _lhsOfield :: ((Identifier,Type,Maybe (Maybe Type)))
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOgathRules :: (Seq CRule)
+                       -- "Order.ag"(line 177, column 13)
+                       _maptolocal =
+                           ({-# LINE 177 "Order.ag" #-}
+                            case tp_ of
+                              NT nt _ -> Map.null syn_
+                              _       -> True
+                            {-# LINE 320 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 180, column 13)
+                       _lhsOgathAltAttrs =
+                           ({-# LINE 180 "Order.ag" #-}
+                            if  _maptolocal
+                                then [ AltAttr _LOC name_ True ]
+                                else [ AltAttr name_ syn True | syn <- Map.keys syn_ ]
+                            {-# LINE 328 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 195, column 13)
+                       _lhsOnts =
+                           ({-# LINE 195 "Order.ag" #-}
+                            Seq.singleton (name_,getNtName tp_)
+                            {-# LINE 334 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 196, column 13)
+                       _lhsOinhs =
+                           ({-# LINE 196 "Order.ag" #-}
+                            Seq.singleton (name_,inh_)
+                            {-# LINE 340 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 212, column 13)
+                       _gathRules =
+                           ({-# LINE 212 "Order.ag" #-}
+                            if  _maptolocal
+                                then Seq.singleton (cRuleTerminal name_ _lhsInt _lhsIcon tp_)
+                                else Seq.fromList [ cRuleRhsSyn syn _lhsInt _lhsIcon tp name_ (getNtName tp_) | (syn,tp) <- Map.assocs syn_]
+                            {-# LINE 348 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 346, column 12)
+                       _lhsOcollectChildrenSyns =
+                           ({-# LINE 346 "Order.ag" #-}
+                            Map.singleton name_ syn_
+                            {-# LINE 354 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 347, column 12)
+                       _lhsOcollectChildrenInhs =
+                           ({-# LINE 347 "Order.ag" #-}
+                            Map.singleton name_ inh_
+                            {-# LINE 360 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 615, column 11)
+                       _lhsOsinglevisits =
+                           ({-# LINE 615 "Order.ag" #-}
+                            if  _maptolocal
+                                then []
+                                else [CChildVisit name_ (getNtName tp_) 0 inh_ syn_ True]
+                            {-# LINE 368 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 640, column 11)
+                       _lhsOterminals =
+                           ({-# LINE 640 "Order.ag" #-}
+                            if _maptolocal
+                            then [name_]
+                            else []
+                            {-# LINE 376 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 669, column 11)
+                       _lhsOattributes =
+                           ({-# LINE 669 "Order.ag" #-}
+                            [(name_, inh_, syn_)]
+                            {-# LINE 382 "Order.hs" #-}
+                            )
+                       -- "Order.ag"(line 673, column 11)
+                       _lhsOfield =
+                           ({-# LINE 673 "Order.ag" #-}
+                            (name_, tp_, virtual_)
+                            {-# LINE 388 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 84, column 70)
+                       _lhsOerrors =
+                           ({-# LINE 84 "Order.ag" #-}
+                            Seq.empty
+                            {-# LINE 394 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 206, column 23)
+                       _lhsOgathRules =
+                           ({-# LINE 206 "Order.ag" #-}
+                            _gathRules
+                            {-# LINE 400 "Order.hs" #-}
+                            )
+                   in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfield,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
+-- Children ----------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
+         allnts               : [Identifier]
+         attrs                : [(Identifier,Identifier)]
+         con                  : Identifier
+         inh                  : Attributes
+         mergeMap             : Map Identifier (Identifier,[Identifier])
+         nt                   : Identifier
+         o_unbox              : Bool
+         syn                  : Attributes
+      synthesized attributes:
+         attributes           : [(Identifier,Attributes,Attributes)]
+         collectChildrenInhs  : Map Identifier Attributes 
+         collectChildrenSyns  : Map Identifier Attributes 
+         errors               : Seq Error
+         fields               : [(Identifier,Type,Maybe (Maybe Type))]
+         gathAltAttrs         : [AltAttr]
+         gathRules            : Seq CRule
+         inhs                 : Seq (Identifier,Attributes)
+         nts                  : Seq (Identifier,NontermIdent)
+         singlevisits         : [CRule]
+         terminals            : [Identifier]
+   alternatives:
+      alternative Cons:
+         child hd             : Child 
+         child tl             : Children 
+      alternative Nil:
+-}
+-- cata
+sem_Children :: Children  ->
+                T_Children 
+sem_Children list  =
+    (Prelude.foldr sem_Children_Cons sem_Children_Nil (Prelude.map sem_Child list) )
+-- semantic domain
+newtype T_Children  = T_Children (([(Identifier,Type,Maybe (Maybe Type))]) ->
+                                  ([Identifier]) ->
+                                  ([(Identifier,Identifier)]) ->
+                                  Identifier ->
+                                  Attributes ->
+                                  (Map Identifier (Identifier,[Identifier])) ->
+                                  Identifier ->
+                                  Bool ->
+                                  Attributes ->
+                                  ( ([(Identifier,Attributes,Attributes)]),(Map Identifier Attributes ),(Map Identifier Attributes ),(Seq Error),([(Identifier,Type,Maybe (Maybe Type))]),([AltAttr]),(Seq CRule),(Seq (Identifier,Attributes)),(Seq (Identifier,NontermIdent)),([CRule]),([Identifier])))
+data Inh_Children  = Inh_Children {allfields_Inh_Children :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Children :: !(([Identifier])),attrs_Inh_Children :: !(([(Identifier,Identifier)])),con_Inh_Children :: !(Identifier),inh_Inh_Children :: !(Attributes),mergeMap_Inh_Children :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Children :: !(Identifier),o_unbox_Inh_Children :: !(Bool),syn_Inh_Children :: !(Attributes)}
+data Syn_Children  = Syn_Children {attributes_Syn_Children :: !(([(Identifier,Attributes,Attributes)])),collectChildrenInhs_Syn_Children :: !((Map Identifier Attributes )),collectChildrenSyns_Syn_Children :: !((Map Identifier Attributes )),errors_Syn_Children :: !((Seq Error)),fields_Syn_Children :: !(([(Identifier,Type,Maybe (Maybe Type))])),gathAltAttrs_Syn_Children :: !(([AltAttr])),gathRules_Syn_Children :: !((Seq CRule)),inhs_Syn_Children :: !((Seq (Identifier,Attributes))),nts_Syn_Children :: !((Seq (Identifier,NontermIdent))),singlevisits_Syn_Children :: !(([CRule])),terminals_Syn_Children :: !(([Identifier]))}
+wrap_Children :: T_Children  ->
+                 Inh_Children  ->
+                 Syn_Children 
+wrap_Children (T_Children sem ) (Inh_Children _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn )  =
+    (let ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIinh _lhsImergeMap _lhsInt _lhsIo_unbox _lhsIsyn 
+     in  (Syn_Children _lhsOattributes _lhsOcollectChildrenInhs _lhsOcollectChildrenSyns _lhsOerrors _lhsOfields _lhsOgathAltAttrs _lhsOgathRules _lhsOinhs _lhsOnts _lhsOsinglevisits _lhsOterminals ))
+sem_Children_Cons :: T_Child  ->
+                     T_Children  ->
+                     T_Children 
+sem_Children_Cons (T_Child hd_ ) (T_Children tl_ )  =
+    (T_Children (\ _lhsIallfields
+                   _lhsIallnts
+                   _lhsIattrs
+                   _lhsIcon
+                   _lhsIinh
+                   _lhsImergeMap
+                   _lhsInt
+                   _lhsIo_unbox
+                   _lhsIsyn ->
+                     (let _lhsOfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                          _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
+                          _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
+                          _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
+                          _lhsOerrors :: (Seq Error)
+                          _lhsOgathAltAttrs :: ([AltAttr])
+                          _lhsOgathRules :: (Seq CRule)
+                          _lhsOinhs :: (Seq (Identifier,Attributes))
+                          _lhsOnts :: (Seq (Identifier,NontermIdent))
+                          _lhsOsinglevisits :: ([CRule])
+                          _lhsOterminals :: ([Identifier])
+                          _hdOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                          _hdOallnts :: ([Identifier])
+                          _hdOattrs :: ([(Identifier,Identifier)])
+                          _hdOcon :: Identifier
+                          _hdOinh :: Attributes
+                          _hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                          _hdOnt :: Identifier
+                          _hdOo_unbox :: Bool
+                          _hdOsyn :: Attributes
+                          _tlOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                          _tlOallnts :: ([Identifier])
+                          _tlOattrs :: ([(Identifier,Identifier)])
+                          _tlOcon :: Identifier
+                          _tlOinh :: Attributes
+                          _tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                          _tlOnt :: Identifier
+                          _tlOo_unbox :: Bool
+                          _tlOsyn :: Attributes
+                          _hdIattributes :: ([(Identifier,Attributes,Attributes)])
+                          _hdIcollectChildrenInhs :: (Map Identifier Attributes )
+                          _hdIcollectChildrenSyns :: (Map Identifier Attributes )
+                          _hdIerrors :: (Seq Error)
+                          _hdIfield :: ((Identifier,Type,Maybe (Maybe Type)))
+                          _hdIgathAltAttrs :: ([AltAttr])
+                          _hdIgathRules :: (Seq CRule)
+                          _hdIinhs :: (Seq (Identifier,Attributes))
+                          _hdInts :: (Seq (Identifier,NontermIdent))
+                          _hdIsinglevisits :: ([CRule])
+                          _hdIterminals :: ([Identifier])
+                          _tlIattributes :: ([(Identifier,Attributes,Attributes)])
+                          _tlIcollectChildrenInhs :: (Map Identifier Attributes )
+                          _tlIcollectChildrenSyns :: (Map Identifier Attributes )
+                          _tlIerrors :: (Seq Error)
+                          _tlIfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                          _tlIgathAltAttrs :: ([AltAttr])
+                          _tlIgathRules :: (Seq CRule)
+                          _tlIinhs :: (Seq (Identifier,Attributes))
+                          _tlInts :: (Seq (Identifier,NontermIdent))
+                          _tlIsinglevisits :: ([CRule])
+                          _tlIterminals :: ([Identifier])
+                          -- "Order.ag"(line 676, column 11)
+                          _lhsOfields =
+                              ({-# LINE 676 "Order.ag" #-}
+                               _hdIfield : _tlIfields
+                               {-# LINE 526 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 667, column 32)
+                          _lhsOattributes =
+                              ({-# LINE 667 "Order.ag" #-}
+                               _hdIattributes ++ _tlIattributes
+                               {-# LINE 532 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 344, column 68)
+                          _lhsOcollectChildrenInhs =
+                              ({-# LINE 344 "Order.ag" #-}
+                               _hdIcollectChildrenInhs `Map.union` _tlIcollectChildrenInhs
+                               {-# LINE 538 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 344, column 68)
+                          _lhsOcollectChildrenSyns =
+                              ({-# LINE 344 "Order.ag" #-}
+                               _hdIcollectChildrenSyns `Map.union` _tlIcollectChildrenSyns
+                               {-# LINE 544 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 84, column 70)
+                          _lhsOerrors =
+                              ({-# LINE 84 "Order.ag" #-}
+                               _hdIerrors Seq.>< _tlIerrors
+                               {-# LINE 550 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 170, column 68)
+                          _lhsOgathAltAttrs =
+                              ({-# LINE 170 "Order.ag" #-}
+                               _hdIgathAltAttrs ++ _tlIgathAltAttrs
+                               {-# LINE 556 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 206, column 23)
+                          _lhsOgathRules =
+                              ({-# LINE 206 "Order.ag" #-}
+                               _hdIgathRules Seq.>< _tlIgathRules
+                               {-# LINE 562 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 193, column 20)
+                          _lhsOinhs =
+                              ({-# LINE 193 "Order.ag" #-}
+                               _hdIinhs Seq.>< _tlIinhs
+                               {-# LINE 568 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 192, column 19)
+                          _lhsOnts =
+                              ({-# LINE 192 "Order.ag" #-}
+                               _hdInts Seq.>< _tlInts
+                               {-# LINE 574 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 613, column 40)
+                          _lhsOsinglevisits =
+                              ({-# LINE 613 "Order.ag" #-}
+                               _hdIsinglevisits ++ _tlIsinglevisits
+                               {-# LINE 580 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 638, column 38)
+                          _lhsOterminals =
+                              ({-# LINE 638 "Order.ag" #-}
+                               _hdIterminals ++ _tlIterminals
+                               {-# LINE 586 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOallfields =
+                              ({-# LINE 656 "Order.ag" #-}
+                               _lhsIallfields
+                               {-# LINE 592 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOallnts =
+                              ({-# LINE 649 "Order.ag" #-}
+                               _lhsIallnts
+                               {-# LINE 598 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOattrs =
+                              ({-# LINE 656 "Order.ag" #-}
+                               _lhsIattrs
+                               {-# LINE 604 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOcon =
+                              ({-# LINE 90 "Order.ag" #-}
+                               _lhsIcon
+                               {-# LINE 610 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOinh =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIinh
+                               {-# LINE 616 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOmergeMap =
+                              ({-# LINE 362 "Order.ag" #-}
+                               _lhsImergeMap
+                               {-# LINE 622 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOnt =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsInt
+                               {-# LINE 628 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOo_unbox =
+                              ({-# LINE 119 "Order.ag" #-}
+                               _lhsIo_unbox
+                               {-# LINE 634 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOsyn =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIsyn
+                               {-# LINE 640 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOallfields =
+                              ({-# LINE 656 "Order.ag" #-}
+                               _lhsIallfields
+                               {-# LINE 646 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOallnts =
+                              ({-# LINE 649 "Order.ag" #-}
+                               _lhsIallnts
+                               {-# LINE 652 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOattrs =
+                              ({-# LINE 656 "Order.ag" #-}
+                               _lhsIattrs
+                               {-# LINE 658 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOcon =
+                              ({-# LINE 90 "Order.ag" #-}
+                               _lhsIcon
+                               {-# LINE 664 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOinh =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIinh
+                               {-# LINE 670 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOmergeMap =
+                              ({-# LINE 362 "Order.ag" #-}
+                               _lhsImergeMap
+                               {-# LINE 676 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOnt =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsInt
+                               {-# LINE 682 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOo_unbox =
+                              ({-# LINE 119 "Order.ag" #-}
+                               _lhsIo_unbox
+                               {-# LINE 688 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOsyn =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIsyn
+                               {-# LINE 694 "Order.hs" #-}
+                               )
+                          ( _hdIattributes,_hdIcollectChildrenInhs,_hdIcollectChildrenSyns,_hdIerrors,_hdIfield,_hdIgathAltAttrs,_hdIgathRules,_hdIinhs,_hdInts,_hdIsinglevisits,_hdIterminals) =
+                              hd_ _hdOallfields _hdOallnts _hdOattrs _hdOcon _hdOinh _hdOmergeMap _hdOnt _hdOo_unbox _hdOsyn 
+                          ( _tlIattributes,_tlIcollectChildrenInhs,_tlIcollectChildrenSyns,_tlIerrors,_tlIfields,_tlIgathAltAttrs,_tlIgathRules,_tlIinhs,_tlInts,_tlIsinglevisits,_tlIterminals) =
+                              tl_ _tlOallfields _tlOallnts _tlOattrs _tlOcon _tlOinh _tlOmergeMap _tlOnt _tlOo_unbox _tlOsyn 
+                      in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
+sem_Children_Nil :: T_Children 
+sem_Children_Nil  =
+    (T_Children (\ _lhsIallfields
+                   _lhsIallnts
+                   _lhsIattrs
+                   _lhsIcon
+                   _lhsIinh
+                   _lhsImergeMap
+                   _lhsInt
+                   _lhsIo_unbox
+                   _lhsIsyn ->
+                     (let _lhsOfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                          _lhsOattributes :: ([(Identifier,Attributes,Attributes)])
+                          _lhsOcollectChildrenInhs :: (Map Identifier Attributes )
+                          _lhsOcollectChildrenSyns :: (Map Identifier Attributes )
+                          _lhsOerrors :: (Seq Error)
+                          _lhsOgathAltAttrs :: ([AltAttr])
+                          _lhsOgathRules :: (Seq CRule)
+                          _lhsOinhs :: (Seq (Identifier,Attributes))
+                          _lhsOnts :: (Seq (Identifier,NontermIdent))
+                          _lhsOsinglevisits :: ([CRule])
+                          _lhsOterminals :: ([Identifier])
+                          -- "Order.ag"(line 677, column 11)
+                          _lhsOfields =
+                              ({-# LINE 677 "Order.ag" #-}
+                               []
+                               {-# LINE 727 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 667, column 32)
+                          _lhsOattributes =
+                              ({-# LINE 667 "Order.ag" #-}
+                               []
+                               {-# LINE 733 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 344, column 68)
+                          _lhsOcollectChildrenInhs =
+                              ({-# LINE 344 "Order.ag" #-}
+                               Map.empty
+                               {-# LINE 739 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 344, column 68)
+                          _lhsOcollectChildrenSyns =
+                              ({-# LINE 344 "Order.ag" #-}
+                               Map.empty
+                               {-# LINE 745 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 84, column 70)
+                          _lhsOerrors =
+                              ({-# LINE 84 "Order.ag" #-}
+                               Seq.empty
+                               {-# LINE 751 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 170, column 68)
+                          _lhsOgathAltAttrs =
+                              ({-# LINE 170 "Order.ag" #-}
+                               []
+                               {-# LINE 757 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 206, column 23)
+                          _lhsOgathRules =
+                              ({-# LINE 206 "Order.ag" #-}
+                               Seq.empty
+                               {-# LINE 763 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 193, column 20)
+                          _lhsOinhs =
+                              ({-# LINE 193 "Order.ag" #-}
+                               Seq.empty
+                               {-# LINE 769 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 192, column 19)
+                          _lhsOnts =
+                              ({-# LINE 192 "Order.ag" #-}
+                               Seq.empty
+                               {-# LINE 775 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 613, column 40)
+                          _lhsOsinglevisits =
+                              ({-# LINE 613 "Order.ag" #-}
+                               []
+                               {-# LINE 781 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 638, column 38)
+                          _lhsOterminals =
+                              ({-# LINE 638 "Order.ag" #-}
+                               []
+                               {-# LINE 787 "Order.hs" #-}
+                               )
+                      in  ( _lhsOattributes,_lhsOcollectChildrenInhs,_lhsOcollectChildrenSyns,_lhsOerrors,_lhsOfields,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinhs,_lhsOnts,_lhsOsinglevisits,_lhsOterminals))) )
+-- Expression --------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
+         allnts               : [Identifier]
+         attrs                : [(Identifier,Identifier)]
+         con                  : Identifier
+         mergeMap             : Map Identifier (Identifier,[Identifier])
+         nt                   : Identifier
+      synthesized attributes:
+         allRhsVars           : Set (Identifier,Identifier)
+         copy                 : SELF 
+         errors               : Seq Error
+         textLines            : [String]
+         usedAttrs            : [(Identifier,Identifier)]
+         usedFields           : [Identifier]
+         usedLocals           : [Identifier]
+   alternatives:
+      alternative Expression:
+         child pos            : {Pos}
+         child tks            : {[HsToken]}
+         visit 0:
+            local _tup1       : _
+            local textLines   : _
+            local usedAttrs   : _
+            local usedLocals  : _
+            local usedFields  : _
+            local copy        : _
+-}
+-- cata
+sem_Expression :: Expression  ->
+                  T_Expression 
+sem_Expression (Expression _pos _tks )  =
+    (sem_Expression_Expression _pos _tks )
+-- semantic domain
+newtype T_Expression  = T_Expression (([(Identifier,Type,Maybe (Maybe Type))]) ->
+                                      ([Identifier]) ->
+                                      ([(Identifier,Identifier)]) ->
+                                      Identifier ->
+                                      (Map Identifier (Identifier,[Identifier])) ->
+                                      Identifier ->
+                                      ( (Set (Identifier,Identifier)),Expression ,(Seq Error),([String]),([(Identifier,Identifier)]),([Identifier]),([Identifier])))
+data Inh_Expression  = Inh_Expression {allfields_Inh_Expression :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Expression :: !(([Identifier])),attrs_Inh_Expression :: !(([(Identifier,Identifier)])),con_Inh_Expression :: !(Identifier),mergeMap_Inh_Expression :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Expression :: !(Identifier)}
+data Syn_Expression  = Syn_Expression {allRhsVars_Syn_Expression :: !((Set (Identifier,Identifier))),copy_Syn_Expression :: !(Expression ),errors_Syn_Expression :: !((Seq Error)),textLines_Syn_Expression :: !(([String])),usedAttrs_Syn_Expression :: !(([(Identifier,Identifier)])),usedFields_Syn_Expression :: !(([Identifier])),usedLocals_Syn_Expression :: !(([Identifier]))}
+wrap_Expression :: T_Expression  ->
+                   Inh_Expression  ->
+                   Syn_Expression 
+wrap_Expression (T_Expression sem ) (Inh_Expression _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt )  =
+    (let ( _lhsOallRhsVars,_lhsOcopy,_lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsImergeMap _lhsInt 
+     in  (Syn_Expression _lhsOallRhsVars _lhsOcopy _lhsOerrors _lhsOtextLines _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
+sem_Expression_Expression :: Pos ->
+                             ([HsToken]) ->
+                             T_Expression 
+sem_Expression_Expression pos_ tks_  =
+    (T_Expression (\ _lhsIallfields
+                     _lhsIallnts
+                     _lhsIattrs
+                     _lhsIcon
+                     _lhsImergeMap
+                     _lhsInt ->
+                       (let _lhsOerrors :: (Seq Error)
+                            _lhsOallRhsVars :: (Set (Identifier,Identifier))
+                            _lhsOcopy :: Expression 
+                            _lhsOtextLines :: ([String])
+                            _lhsOusedAttrs :: ([(Identifier,Identifier)])
+                            _lhsOusedFields :: ([Identifier])
+                            _lhsOusedLocals :: ([Identifier])
+                            -- "Order.ag"(line 466, column 21)
+                            __tup1 =
+                                ({-# LINE 466 "Order.ag" #-}
+                                 let mergedChildren = [ x | (_,xs) <- Map.elems _lhsImergeMap, x <- xs ]
+                                     attrsIn = filter (\(fld,_) -> not (fld `elem` mergedChildren)) _lhsIattrs
+                                     inherited = Inh_HsTokensRoot
+                                                 { attrs_Inh_HsTokensRoot      = attrsIn
+                                                 , con_Inh_HsTokensRoot        = _lhsIcon
+                                                 , allfields_Inh_HsTokensRoot  = _lhsIallfields
+                                                 , allnts_Inh_HsTokensRoot     = _lhsIallnts
+                                                 , nt_Inh_HsTokensRoot         = _lhsInt
+                                                 }
+                                     synthesized = wrap_HsTokensRoot (sem_HsTokensRoot (HsTokensRoot tks_)) inherited
+                                 in case synthesized of
+                                      Syn_HsTokensRoot
+                                       { textLines_Syn_HsTokensRoot  = textLines
+                                       , usedAttrs_Syn_HsTokensRoot  = usedAttrs
+                                       , usedLocals_Syn_HsTokensRoot = usedLocals
+                                       , usedFields_Syn_HsTokensRoot = usedFields
+                                       }  -> let extraAttrs = [ (src,attr)
+                                                              | (fld,attr) <- usedAttrs, let mbMerged = Map.lookup fld _lhsImergeMap, isJust mbMerged
+                                                              , let (Just (_, srcs)) = mbMerged, src <- srcs ]
+                                                 usedAttrs' = usedAttrs ++ extraAttrs
+                                             in (textLines,usedAttrs',usedLocals,usedFields)
+                                 {-# LINE 882 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 466, column 21)
+                            (_textLines,_,_,_) =
+                                ({-# LINE 466 "Order.ag" #-}
+                                 __tup1
+                                 {-# LINE 888 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 466, column 21)
+                            (_,_usedAttrs,_,_) =
+                                ({-# LINE 466 "Order.ag" #-}
+                                 __tup1
+                                 {-# LINE 894 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 466, column 21)
+                            (_,_,_usedLocals,_) =
+                                ({-# LINE 466 "Order.ag" #-}
+                                 __tup1
+                                 {-# LINE 900 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 466, column 21)
+                            (_,_,_,_usedFields) =
+                                ({-# LINE 466 "Order.ag" #-}
+                                 __tup1
+                                 {-# LINE 906 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 489, column 17)
+                            _lhsOerrors =
+                                ({-# LINE 489 "Order.ag" #-}
+                                 Seq.empty
+                                 {-# LINE 912 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 490, column 17)
+                            _lhsOallRhsVars =
+                                ({-# LINE 490 "Order.ag" #-}
+                                 Set.fromList _usedAttrs
+                                 `Set.union`
+                                 Set.fromList [ (_LOC, l) | l <- _usedLocals    ]
+                                 `Set.union`
+                                 Set.fromList [ (_FIELD, fld) | fld <- _usedFields    ]
+                                 {-# LINE 922 "Order.hs" #-}
+                                 )
+                            -- self rule
+                            _copy =
+                                ({-# LINE 457 "Order.ag" #-}
+                                 Expression pos_ tks_
+                                 {-# LINE 928 "Order.hs" #-}
+                                 )
+                            -- self rule
+                            _lhsOcopy =
+                                ({-# LINE 457 "Order.ag" #-}
+                                 _copy
+                                 {-# LINE 934 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _lhsOtextLines =
+                                ({-# LINE 456 "Order.ag" #-}
+                                 _textLines
+                                 {-# LINE 940 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _lhsOusedAttrs =
+                                ({-# LINE 454 "Order.ag" #-}
+                                 _usedAttrs
+                                 {-# LINE 946 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _lhsOusedFields =
+                                ({-# LINE 455 "Order.ag" #-}
+                                 _usedFields
+                                 {-# LINE 952 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _lhsOusedLocals =
+                                ({-# LINE 453 "Order.ag" #-}
+                                 _usedLocals
+                                 {-# LINE 958 "Order.hs" #-}
+                                 )
+                        in  ( _lhsOallRhsVars,_lhsOcopy,_lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+-- Grammar -----------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         options              : Options
+      synthesized attributes:
+         errors               : Seq Error
+         nAutoRules           : Int
+         nExplicitRules       : Int
+         output               : CGrammar
+   alternatives:
+      alternative Grammar:
+         child typeSyns       : {TypeSyns}
+         child useMap         : {UseMap}
+         child derivings      : {Derivings}
+         child wrappers       : {Set NontermIdent}
+         child nonts          : Nonterminals 
+         child pragmas        : {PragmaMap}
+         child manualAttrOrderMap : {AttrOrderMap}
+         child paramMap       : {ParamMap}
+         child contextMap     : {ContextMap}
+         child quantMap       : {QuantMap}
+         child uniqueMap      : {UniqueMap}
+         child augmentsMap    : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
+         child aroundsMap     : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
+         child mergeMap       : {Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))}
+         visit 0:
+            local o_dovisit   : _
+            local ruleTable   : _
+            local attrTable   : _
+            local attrVertex  : _
+            local tdpToTds    : _
+            local tdsToTdp    : _
+            local directDep   : _
+            local instDep     : _
+            local aroundDep   : _
+            local mergeDep    : _
+            local info        : _
+            local _tup2       : _
+            local cInterfaceMap : _
+            local cVisitsMap  : _
+            local cyclesErrors : _
+            local aroundMap   : _
+            local mergeMap    : _
+-}
+-- cata
+sem_Grammar :: Grammar  ->
+               T_Grammar 
+sem_Grammar (Grammar _typeSyns _useMap _derivings _wrappers _nonts _pragmas _manualAttrOrderMap _paramMap _contextMap _quantMap _uniqueMap _augmentsMap _aroundsMap _mergeMap )  =
+    (sem_Grammar_Grammar _typeSyns _useMap _derivings _wrappers (sem_Nonterminals _nonts ) _pragmas _manualAttrOrderMap _paramMap _contextMap _quantMap _uniqueMap _augmentsMap _aroundsMap _mergeMap )
+-- semantic domain
+newtype T_Grammar  = T_Grammar (Options ->
+                                ( (Seq Error),Int,Int,CGrammar))
+data Inh_Grammar  = Inh_Grammar {options_Inh_Grammar :: !(Options)}
+data Syn_Grammar  = Syn_Grammar {errors_Syn_Grammar :: !((Seq Error)),nAutoRules_Syn_Grammar :: !(Int),nExplicitRules_Syn_Grammar :: !(Int),output_Syn_Grammar :: !(CGrammar)}
+wrap_Grammar :: T_Grammar  ->
+                Inh_Grammar  ->
+                Syn_Grammar 
+wrap_Grammar (T_Grammar sem ) (Inh_Grammar _lhsIoptions )  =
+    (let ( _lhsOerrors,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOoutput) = sem _lhsIoptions 
+     in  (Syn_Grammar _lhsOerrors _lhsOnAutoRules _lhsOnExplicitRules _lhsOoutput ))
+sem_Grammar_Grammar :: TypeSyns ->
+                       UseMap ->
+                       Derivings ->
+                       (Set NontermIdent) ->
+                       T_Nonterminals  ->
+                       PragmaMap ->
+                       AttrOrderMap ->
+                       ParamMap ->
+                       ContextMap ->
+                       QuantMap ->
+                       UniqueMap ->
+                       (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
+                       (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
+                       (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))) ->
+                       T_Grammar 
+sem_Grammar_Grammar typeSyns_ useMap_ derivings_ wrappers_ (T_Nonterminals nonts_ ) pragmas_ manualAttrOrderMap_ paramMap_ contextMap_ quantMap_ uniqueMap_ augmentsMap_ aroundsMap_ mergeMap_  =
+    (T_Grammar (\ _lhsIoptions ->
+                    (let _nontsOo_cata :: Bool
+                         _nontsOo_data :: Bool
+                         _nontsOo_sig :: Bool
+                         _nontsOo_sem :: Bool
+                         _nontsOo_rename :: Bool
+                         _nontsOo_newtypes :: Bool
+                         _nontsOo_wantvisit :: Bool
+                         _nontsOo_unbox :: Bool
+                         _nontsOo_case :: Bool
+                         _nontsOprefix :: String
+                         _nontsOvcount :: Int
+                         _nontsOmanualAttrDepMap :: AttrOrderMap
+                         _nontsOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
+                         _nontsOacount :: Int
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOoutput :: CGrammar
+                         _nontsOallnts :: ([Identifier])
+                         _lhsOnAutoRules :: Int
+                         _lhsOnExplicitRules :: Int
+                         _nontsOcInterfaceMap :: CInterfaceMap
+                         _nontsOcVisitsMap :: CVisitsMap
+                         _nontsOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
+                         _nontsOo_dovisit :: Bool
+                         _nontsIacount :: Int
+                         _nontsIadditionalDep :: (Seq Edge)
+                         _nontsIaranges :: (Seq (Int,Int,Int))
+                         _nontsIaroundDep :: (Seq Edge)
+                         _nontsIcNonterminals :: CNonterminals
+                         _nontsIdirectDep :: (Seq Edge)
+                         _nontsIerrors :: (Seq Error)
+                         _nontsIinstDep :: (Seq Edge)
+                         _nontsImergeDep :: (Seq Edge)
+                         _nontsInAutoRules :: Int
+                         _nontsInExplicitRules :: Int
+                         _nontsInonts :: ([(NontermIdent,[ConstructorIdent])])
+                         _nontsIntattrs :: (Seq (Vertex,NTAttr))
+                         _nontsIrules :: (Seq (Vertex,CRule))
+                         _nontsIvcount :: Int
+                         -- "Order.ag"(line 123, column 17)
+                         _o_dovisit =
+                             ({-# LINE 123 "Order.ag" #-}
+                              visit     _lhsIoptions && null _cyclesErrors
+                              {-# LINE 1081 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_cata =
+                             ({-# LINE 124 "Order.ag" #-}
+                              folds     _lhsIoptions
+                              {-# LINE 1087 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_data =
+                             ({-# LINE 125 "Order.ag" #-}
+                              dataTypes _lhsIoptions
+                              {-# LINE 1093 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_sig =
+                             ({-# LINE 126 "Order.ag" #-}
+                              typeSigs  _lhsIoptions
+                              {-# LINE 1099 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_sem =
+                             ({-# LINE 127 "Order.ag" #-}
+                              semfuns   _lhsIoptions
+                              {-# LINE 1105 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_rename =
+                             ({-# LINE 128 "Order.ag" #-}
+                              rename    _lhsIoptions
+                              {-# LINE 1111 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_newtypes =
+                             ({-# LINE 129 "Order.ag" #-}
+                              newtypes  _lhsIoptions
+                              {-# LINE 1117 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_wantvisit =
+                             ({-# LINE 130 "Order.ag" #-}
+                              visit   _lhsIoptions
+                              {-# LINE 1123 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_unbox =
+                             ({-# LINE 131 "Order.ag" #-}
+                              unbox     _lhsIoptions
+                              {-# LINE 1129 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOo_case =
+                             ({-# LINE 132 "Order.ag" #-}
+                              cases     _lhsIoptions
+                              {-# LINE 1135 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 124, column 17)
+                         _nontsOprefix =
+                             ({-# LINE 133 "Order.ag" #-}
+                              prefix    _lhsIoptions
+                              {-# LINE 1141 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 261, column 15)
+                         _nontsOvcount =
+                             ({-# LINE 261 "Order.ag" #-}
+                              0
+                              {-# LINE 1147 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 287, column 7)
+                         _nontsOmanualAttrDepMap =
+                             ({-# LINE 287 "Order.ag" #-}
+                              manualAttrOrderMap_
+                              {-# LINE 1153 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 416, column 14)
+                         _nontsOaroundMap =
+                             ({-# LINE 416 "Order.ag" #-}
+                              aroundsMap_
+                              {-# LINE 1159 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 505, column 13)
+                         _nontsOacount =
+                             ({-# LINE 505 "Order.ag" #-}
+                              0
+                              {-# LINE 1165 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 543, column 13)
+                         _ruleTable =
+                             ({-# LINE 543 "Order.ag" #-}
+                              Array.array (0,_nontsIvcount-1) (toList _nontsIrules)
+                              {-# LINE 1171 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 544, column 13)
+                         _attrTable =
+                             ({-# LINE 544 "Order.ag" #-}
+                              Array.array (0,_nontsIacount-1) (toList _nontsIntattrs)
+                              {-# LINE 1177 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 545, column 13)
+                         _attrVertex =
+                             ({-# LINE 545 "Order.ag" #-}
+                              Map.fromList (map swap (toList _nontsIntattrs))
+                              {-# LINE 1183 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 546, column 13)
+                         _tdpToTds =
+                             ({-# LINE 546 "Order.ag" #-}
+                              [ (s, maybe (-1) (\v -> findWithErr1 "Grammar.tdpToTds" v _attrVertex) (ntattr cr))
+                              | (s,cr) <- toList _nontsIrules]
+                              {-# LINE 1190 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 548, column 13)
+                         _tdsToTdp =
+                             ({-# LINE 548 "Order.ag" #-}
+                              let  eq (_,v) (_,v') = v == v'
+                                   conv ((s,v):svs)  | v == -1 = Nothing
+                                                     | otherwise = Just (v,s:map fst svs)
+                              in mapMaybe conv (eqClasses eq _tdpToTds)
+                              {-# LINE 1199 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 552, column 13)
+                         _directDep =
+                             ({-# LINE 552 "Order.ag" #-}
+                              toList (_nontsIdirectDep Seq.>< _nontsIadditionalDep)
+                              {-# LINE 1205 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 553, column 13)
+                         _instDep =
+                             ({-# LINE 553 "Order.ag" #-}
+                              toList _nontsIinstDep
+                              {-# LINE 1211 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 554, column 13)
+                         _aroundDep =
+                             ({-# LINE 554 "Order.ag" #-}
+                              toList _nontsIaroundDep
+                              {-# LINE 1217 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 555, column 13)
+                         _mergeDep =
+                             ({-# LINE 555 "Order.ag" #-}
+                              toList _nontsImergeDep
+                              {-# LINE 1223 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 556, column 13)
+                         _info =
+                             ({-# LINE 556 "Order.ag" #-}
+                              let def [] = -1
+                                  def (v:vs) = v
+                               in Info { tdsToTdp   = Array.array (0,_nontsIacount-1) _tdsToTdp
+                                       , tdpToTds   = Array.array (0,_nontsIvcount-1) _tdpToTds
+                                       , attrTable  = _attrTable
+                                       , ruleTable  = _ruleTable
+                                       , lmh        = toList _nontsIaranges
+                                       , nonts      = _nontsInonts
+                                       , wraps      = wrappers_
+                                       }
+                              {-# LINE 1238 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 567, column 17)
+                         __tup2 =
+                             ({-# LINE 567 "Order.ag" #-}
+                              case computeSequential _info _directDep (_instDep ++ _aroundDep ++ _mergeDep    ) of
+                                           CycleFree    cim cvm   -> ( cim
+                                                                     , cvm
+                                                                     , []
+                                                                     )
+                                           LocalCycle   errs      -> ( error "No interfaces for AG with local cycles"
+                                                                     , error "No visit sub-sequences for AG with local cycles"
+                                                                     , map (localCycleErr _ruleTable (visit _lhsIoptions)) errs
+                                                                     )
+                                           InstCycle    errs      -> ( error "No interfaces for AG with cycles through insts"
+                                                                     , error "No visit sub-sequences for AG with cycles through insts"
+                                                                     , map (instCycleErr _ruleTable (visit _lhsIoptions)) errs
+                                                                     )
+                                           DirectCycle  errs      -> ( error "No interfaces for AG with direct cycles"
+                                                                     , error "No visit sub-sequences for AG with direct cycles"
+                                                                     , directCycleErrs _attrTable _ruleTable (visit _lhsIoptions) errs
+                                                                     )
+                                           InducedCycle cim errs ->  ( cim
+                                                                     , error "No visit sub-sequences for AG with induced cycles"
+                                                                     , inducedCycleErrs _attrTable _ruleTable cim errs
+                                                                     )
+                              {-# LINE 1264 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 567, column 17)
+                         (_cInterfaceMap,_,_) =
+                             ({-# LINE 567 "Order.ag" #-}
+                              __tup2
+                              {-# LINE 1270 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 567, column 17)
+                         (_,_cVisitsMap,_) =
+                             ({-# LINE 567 "Order.ag" #-}
+                              __tup2
+                              {-# LINE 1276 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 567, column 17)
+                         (_,_,_cyclesErrors) =
+                             ({-# LINE 567 "Order.ag" #-}
+                              __tup2
+                              {-# LINE 1282 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 589, column 13)
+                         _lhsOerrors =
+                             ({-# LINE 589 "Order.ag" #-}
+                              (if withCycle _lhsIoptions then Seq.fromList _cyclesErrors else Seq.empty)
+                              Seq.>< _nontsIerrors
+                              {-# LINE 1289 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 621, column 15)
+                         _lhsOoutput =
+                             ({-# LINE 621 "Order.ag" #-}
+                              CGrammar typeSyns_ derivings_ wrappers_ _nontsIcNonterminals pragmas_ paramMap_ contextMap_ quantMap_ _aroundMap     _mergeMap     _o_dovisit
+                              {-# LINE 1295 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 634, column 14)
+                         _aroundMap =
+                             ({-# LINE 634 "Order.ag" #-}
+                              Map.map (Map.map Map.keysSet) aroundsMap_
+                              {-# LINE 1301 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 635, column 14)
+                         _mergeMap =
+                             ({-# LINE 635 "Order.ag" #-}
+                              Map.map (Map.map (Map.map (\(nt,srcs,_) -> (nt,srcs)))) mergeMap_
+                              {-# LINE 1307 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 652, column 13)
+                         _nontsOallnts =
+                             ({-# LINE 652 "Order.ag" #-}
+                              map fst (_nontsInonts)
+                              {-# LINE 1313 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 61, column 105)
+                         _lhsOnAutoRules =
+                             ({-# LINE 61 "Order.ag" #-}
+                              _nontsInAutoRules
+                              {-# LINE 1319 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 61, column 105)
+                         _lhsOnExplicitRules =
+                             ({-# LINE 61 "Order.ag" #-}
+                              _nontsInExplicitRules
+                              {-# LINE 1325 "Order.hs" #-}
+                              )
+                         -- copy rule (from local)
+                         _nontsOcInterfaceMap =
+                             ({-# LINE 596 "Order.ag" #-}
+                              _cInterfaceMap
+                              {-# LINE 1331 "Order.hs" #-}
+                              )
+                         -- copy rule (from local)
+                         _nontsOcVisitsMap =
+                             ({-# LINE 603 "Order.ag" #-}
+                              _cVisitsMap
+                              {-# LINE 1337 "Order.hs" #-}
+                              )
+                         -- copy rule (from local)
+                         _nontsOmergeMap =
+                             ({-# LINE 354 "Order.ag" #-}
+                              _mergeMap
+                              {-# LINE 1343 "Order.hs" #-}
+                              )
+                         -- copy rule (from local)
+                         _nontsOo_dovisit =
+                             ({-# LINE 116 "Order.ag" #-}
+                              _o_dovisit
+                              {-# LINE 1349 "Order.hs" #-}
+                              )
+                         ( _nontsIacount,_nontsIadditionalDep,_nontsIaranges,_nontsIaroundDep,_nontsIcNonterminals,_nontsIdirectDep,_nontsIerrors,_nontsIinstDep,_nontsImergeDep,_nontsInAutoRules,_nontsInExplicitRules,_nontsInonts,_nontsIntattrs,_nontsIrules,_nontsIvcount) =
+                             nonts_ _nontsOacount _nontsOallnts _nontsOaroundMap _nontsOcInterfaceMap _nontsOcVisitsMap _nontsOmanualAttrDepMap _nontsOmergeMap _nontsOo_case _nontsOo_cata _nontsOo_data _nontsOo_dovisit _nontsOo_newtypes _nontsOo_rename _nontsOo_sem _nontsOo_sig _nontsOo_unbox _nontsOo_wantvisit _nontsOprefix _nontsOvcount 
+                     in  ( _lhsOerrors,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOoutput))) )
+-- Nonterminal -------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allnts               : [Identifier]
+         aroundMap            : Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
+         cInterfaceMap        : CInterfaceMap
+         cVisitsMap           : CVisitsMap
+         manualAttrDepMap     : AttrOrderMap
+         mergeMap             : Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
+         o_case               : Bool
+         o_cata               : Bool
+         o_data               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_unbox              : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+      chained attributes:
+         acount               : Int
+         vcount               : Int
+      synthesized attributes:
+         additionalDep        : Seq Edge
+         aranges              : Seq (Int,Int,Int)
+         aroundDep            : Seq Edge
+         cNonterminal         : CNonterminal
+         directDep            : Seq Edge
+         errors               : Seq Error
+         instDep              : Seq Edge
+         mergeDep             : Seq Edge
+         nAutoRules           : Int
+         nExplicitRules       : Int
+         nonts                : [(NontermIdent,[ConstructorIdent])]
+         ntattrs              : Seq (Vertex,NTAttr)
+         rules                : Seq (Vertex,CRule)
+   alternatives:
+      alternative Nonterminal:
+         child nt             : {NontermIdent}
+         child params         : {[Identifier]}
+         child inh            : {Attributes}
+         child syn            : {Attributes}
+         child prods          : Productions 
+         visit 0:
+            local mergeMap    : _
+            local aroundMap   : _
+            local ntattrs     : _
+            local cInter      : _
+-}
+-- cata
+sem_Nonterminal :: Nonterminal  ->
+                   T_Nonterminal 
+sem_Nonterminal (Nonterminal _nt _params _inh _syn _prods )  =
+    (sem_Nonterminal_Nonterminal _nt _params _inh _syn (sem_Productions _prods ) )
+-- semantic domain
+newtype T_Nonterminal  = T_Nonterminal (Int ->
+                                        ([Identifier]) ->
+                                        (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
+                                        CInterfaceMap ->
+                                        CVisitsMap ->
+                                        AttrOrderMap ->
+                                        (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        String ->
+                                        Int ->
+                                        ( Int,(Seq Edge),(Seq (Int,Int,Int)),(Seq Edge),CNonterminal,(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,([(NontermIdent,[ConstructorIdent])]),(Seq (Vertex,NTAttr)),(Seq (Vertex,CRule)),Int))
+data Inh_Nonterminal  = Inh_Nonterminal {acount_Inh_Nonterminal :: !(Int),allnts_Inh_Nonterminal :: !(([Identifier])),aroundMap_Inh_Nonterminal :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))),cInterfaceMap_Inh_Nonterminal :: !(CInterfaceMap),cVisitsMap_Inh_Nonterminal :: !(CVisitsMap),manualAttrDepMap_Inh_Nonterminal :: !(AttrOrderMap),mergeMap_Inh_Nonterminal :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))),o_case_Inh_Nonterminal :: !(Bool),o_cata_Inh_Nonterminal :: !(Bool),o_data_Inh_Nonterminal :: !(Bool),o_dovisit_Inh_Nonterminal :: !(Bool),o_newtypes_Inh_Nonterminal :: !(Bool),o_rename_Inh_Nonterminal :: !(Bool),o_sem_Inh_Nonterminal :: !(Bool),o_sig_Inh_Nonterminal :: !(Bool),o_unbox_Inh_Nonterminal :: !(Bool),o_wantvisit_Inh_Nonterminal :: !(Bool),prefix_Inh_Nonterminal :: !(String),vcount_Inh_Nonterminal :: !(Int)}
+data Syn_Nonterminal  = Syn_Nonterminal {acount_Syn_Nonterminal :: !(Int),additionalDep_Syn_Nonterminal :: !((Seq Edge)),aranges_Syn_Nonterminal :: !((Seq (Int,Int,Int))),aroundDep_Syn_Nonterminal :: !((Seq Edge)),cNonterminal_Syn_Nonterminal :: !(CNonterminal),directDep_Syn_Nonterminal :: !((Seq Edge)),errors_Syn_Nonterminal :: !((Seq Error)),instDep_Syn_Nonterminal :: !((Seq Edge)),mergeDep_Syn_Nonterminal :: !((Seq Edge)),nAutoRules_Syn_Nonterminal :: !(Int),nExplicitRules_Syn_Nonterminal :: !(Int),nonts_Syn_Nonterminal :: !(([(NontermIdent,[ConstructorIdent])])),ntattrs_Syn_Nonterminal :: !((Seq (Vertex,NTAttr))),rules_Syn_Nonterminal :: !((Seq (Vertex,CRule))),vcount_Syn_Nonterminal :: !(Int)}
+wrap_Nonterminal :: T_Nonterminal  ->
+                    Inh_Nonterminal  ->
+                    Syn_Nonterminal 
+wrap_Nonterminal (T_Nonterminal sem ) (Inh_Nonterminal _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount )  =
+    (let ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminal,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount) = sem _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount 
+     in  (Syn_Nonterminal _lhsOacount _lhsOadditionalDep _lhsOaranges _lhsOaroundDep _lhsOcNonterminal _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOnonts _lhsOntattrs _lhsOrules _lhsOvcount ))
+sem_Nonterminal_Nonterminal :: NontermIdent ->
+                               ([Identifier]) ->
+                               Attributes ->
+                               Attributes ->
+                               T_Productions  ->
+                               T_Nonterminal 
+sem_Nonterminal_Nonterminal nt_ params_ inh_ syn_ (T_Productions prods_ )  =
+    (T_Nonterminal (\ _lhsIacount
+                      _lhsIallnts
+                      _lhsIaroundMap
+                      _lhsIcInterfaceMap
+                      _lhsIcVisitsMap
+                      _lhsImanualAttrDepMap
+                      _lhsImergeMap
+                      _lhsIo_case
+                      _lhsIo_cata
+                      _lhsIo_data
+                      _lhsIo_dovisit
+                      _lhsIo_newtypes
+                      _lhsIo_rename
+                      _lhsIo_sem
+                      _lhsIo_sig
+                      _lhsIo_unbox
+                      _lhsIo_wantvisit
+                      _lhsIprefix
+                      _lhsIvcount ->
+                        (let _prodsOnt :: Identifier
+                             _prodsOinh :: Attributes
+                             _prodsOsyn :: Attributes
+                             _lhsOntattrs :: (Seq (Vertex,NTAttr))
+                             _lhsOacount :: Int
+                             _lhsOaranges :: (Seq (Int,Int,Int))
+                             _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
+                             _lhsOcNonterminal :: CNonterminal
+                             _lhsOadditionalDep :: (Seq Edge)
+                             _lhsOaroundDep :: (Seq Edge)
+                             _lhsOdirectDep :: (Seq Edge)
+                             _lhsOerrors :: (Seq Error)
+                             _lhsOinstDep :: (Seq Edge)
+                             _lhsOmergeDep :: (Seq Edge)
+                             _lhsOnAutoRules :: Int
+                             _lhsOnExplicitRules :: Int
+                             _lhsOrules :: (Seq (Vertex,CRule))
+                             _lhsOvcount :: Int
+                             _prodsOallnts :: ([Identifier])
+                             _prodsOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
+                             _prodsOcVisitsMap :: CVisitsMap
+                             _prodsOmanualAttrDepMap :: AttrOrderMap
+                             _prodsOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
+                             _prodsOo_case :: Bool
+                             _prodsOo_cata :: Bool
+                             _prodsOo_dovisit :: Bool
+                             _prodsOo_newtypes :: Bool
+                             _prodsOo_rename :: Bool
+                             _prodsOo_sem :: Bool
+                             _prodsOo_sig :: Bool
+                             _prodsOo_unbox :: Bool
+                             _prodsOo_wantvisit :: Bool
+                             _prodsOprefix :: String
+                             _prodsOvcount :: Int
+                             _prodsIadditionalDep :: (Seq Edge)
+                             _prodsIaroundDep :: (Seq Edge)
+                             _prodsIcProductions :: CProductions
+                             _prodsIcons :: ([ConstructorIdent])
+                             _prodsIdirectDep :: (Seq Edge)
+                             _prodsIerrors :: (Seq Error)
+                             _prodsIinstDep :: (Seq Edge)
+                             _prodsImergeDep :: (Seq Edge)
+                             _prodsInAutoRules :: Int
+                             _prodsInExplicitRules :: Int
+                             _prodsIrules :: (Seq (Vertex,CRule))
+                             _prodsIvcount :: Int
+                             -- "Order.ag"(line 97, column 17)
+                             _prodsOnt =
+                                 ({-# LINE 97 "Order.ag" #-}
+                                  nt_
+                                  {-# LINE 1515 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 100, column 17)
+                             _prodsOinh =
+                                 ({-# LINE 100 "Order.ag" #-}
+                                  inh_
+                                  {-# LINE 1521 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 101, column 17)
+                             _prodsOsyn =
+                                 ({-# LINE 101 "Order.ag" #-}
+                                  syn_
+                                  {-# LINE 1527 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 359, column 32)
+                             _mergeMap =
+                                 ({-# LINE 359 "Order.ag" #-}
+                                  Map.findWithDefault Map.empty nt_ _lhsImergeMap
+                                  {-# LINE 1533 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 412, column 32)
+                             _aroundMap =
+                                 ({-# LINE 412 "Order.ag" #-}
+                                  Map.findWithDefault Map.empty nt_ _lhsIaroundMap
+                                  {-# LINE 1539 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 508, column 17)
+                             _ntattrs =
+                                 ({-# LINE 508 "Order.ag" #-}
+                                  [ NTAInh nt_ inh tp | (inh,tp) <- Map.assocs inh_ ]
+                                  ++ [NTASyn nt_ syn tp | (syn,tp) <- Map.assocs syn_ ]
+                                  {-# LINE 1546 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 510, column 17)
+                             _lhsOntattrs =
+                                 ({-# LINE 510 "Order.ag" #-}
+                                  Seq.fromList (zip [_lhsIacount ..] _ntattrs)
+                                  {-# LINE 1552 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 511, column 17)
+                             _lhsOacount =
+                                 ({-# LINE 511 "Order.ag" #-}
+                                  _lhsIacount + Map.size inh_ + Map.size syn_
+                                  {-# LINE 1558 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 512, column 17)
+                             _lhsOaranges =
+                                 ({-# LINE 512 "Order.ag" #-}
+                                  Seq.singleton
+                                   (_lhsIacount
+                                   ,_lhsIacount + Map.size inh_
+                                   ,_lhsIacount + Map.size syn_ + Map.size inh_ - 1)
+                                  {-# LINE 1567 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 521, column 19)
+                             _lhsOnonts =
+                                 ({-# LINE 521 "Order.ag" #-}
+                                  [(nt_,_prodsIcons)]
+                                  {-# LINE 1573 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 598, column 19)
+                             _cInter =
+                                 ({-# LINE 598 "Order.ag" #-}
+                                  if  _lhsIo_dovisit
+                                         then findWithErr1 "Nonterminal.cInter" nt_ _lhsIcInterfaceMap
+                                         else CInterface [CSegment inh_ syn_]
+                                  {-# LINE 1581 "Order.hs" #-}
+                                  )
+                             -- "Order.ag"(line 626, column 19)
+                             _lhsOcNonterminal =
+                                 ({-# LINE 626 "Order.ag" #-}
+                                  CNonterminal nt_ params_ inh_ syn_ _prodsIcProductions _cInter
+                                  {-# LINE 1587 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 283, column 60)
+                             _lhsOadditionalDep =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  _prodsIadditionalDep
+                                  {-# LINE 1593 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 404, column 24)
+                             _lhsOaroundDep =
+                                 ({-# LINE 404 "Order.ag" #-}
+                                  _prodsIaroundDep
+                                  {-# LINE 1599 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 269, column 33)
+                             _lhsOdirectDep =
+                                 ({-# LINE 269 "Order.ag" #-}
+                                  _prodsIdirectDep
+                                  {-# LINE 1605 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 84, column 70)
+                             _lhsOerrors =
+                                 ({-# LINE 84 "Order.ag" #-}
+                                  _prodsIerrors
+                                  {-# LINE 1611 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 312, column 31)
+                             _lhsOinstDep =
+                                 ({-# LINE 312 "Order.ag" #-}
+                                  _prodsIinstDep
+                                  {-# LINE 1617 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 367, column 18)
+                             _lhsOmergeDep =
+                                 ({-# LINE 367 "Order.ag" #-}
+                                  _prodsImergeDep
+                                  {-# LINE 1623 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnAutoRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  _prodsInAutoRules
+                                  {-# LINE 1629 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnExplicitRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  _prodsInExplicitRules
+                                  {-# LINE 1635 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 259, column 18)
+                             _lhsOrules =
+                                 ({-# LINE 259 "Order.ag" #-}
+                                  _prodsIrules
+                                  {-# LINE 1641 "Order.hs" #-}
+                                  )
+                             -- copy rule (up)
+                             _lhsOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _prodsIvcount
+                                  {-# LINE 1647 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOallnts =
+                                 ({-# LINE 649 "Order.ag" #-}
+                                  _lhsIallnts
+                                  {-# LINE 1653 "Order.hs" #-}
+                                  )
+                             -- copy rule (from local)
+                             _prodsOaroundMap =
+                                 ({-# LINE 410 "Order.ag" #-}
+                                  _aroundMap
+                                  {-# LINE 1659 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOcVisitsMap =
+                                 ({-# LINE 603 "Order.ag" #-}
+                                  _lhsIcVisitsMap
+                                  {-# LINE 1665 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOmanualAttrDepMap =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  _lhsImanualAttrDepMap
+                                  {-# LINE 1671 "Order.hs" #-}
+                                  )
+                             -- copy rule (from local)
+                             _prodsOmergeMap =
+                                 ({-# LINE 357 "Order.ag" #-}
+                                  _mergeMap
+                                  {-# LINE 1677 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_case =
+                                 ({-# LINE 117 "Order.ag" #-}
+                                  _lhsIo_case
+                                  {-# LINE 1683 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_cata =
+                                 ({-# LINE 111 "Order.ag" #-}
+                                  _lhsIo_cata
+                                  {-# LINE 1689 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_dovisit =
+                                 ({-# LINE 116 "Order.ag" #-}
+                                  _lhsIo_dovisit
+                                  {-# LINE 1695 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_newtypes =
+                                 ({-# LINE 110 "Order.ag" #-}
+                                  _lhsIo_newtypes
+                                  {-# LINE 1701 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_rename =
+                                 ({-# LINE 114 "Order.ag" #-}
+                                  _lhsIo_rename
+                                  {-# LINE 1707 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_sem =
+                                 ({-# LINE 113 "Order.ag" #-}
+                                  _lhsIo_sem
+                                  {-# LINE 1713 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_sig =
+                                 ({-# LINE 112 "Order.ag" #-}
+                                  _lhsIo_sig
+                                  {-# LINE 1719 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_unbox =
+                                 ({-# LINE 119 "Order.ag" #-}
+                                  _lhsIo_unbox
+                                  {-# LINE 1725 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOo_wantvisit =
+                                 ({-# LINE 115 "Order.ag" #-}
+                                  _lhsIo_wantvisit
+                                  {-# LINE 1731 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOprefix =
+                                 ({-# LINE 118 "Order.ag" #-}
+                                  _lhsIprefix
+                                  {-# LINE 1737 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _prodsOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _lhsIvcount
+                                  {-# LINE 1743 "Order.hs" #-}
+                                  )
+                             ( _prodsIadditionalDep,_prodsIaroundDep,_prodsIcProductions,_prodsIcons,_prodsIdirectDep,_prodsIerrors,_prodsIinstDep,_prodsImergeDep,_prodsInAutoRules,_prodsInExplicitRules,_prodsIrules,_prodsIvcount) =
+                                 prods_ _prodsOallnts _prodsOaroundMap _prodsOcVisitsMap _prodsOinh _prodsOmanualAttrDepMap _prodsOmergeMap _prodsOnt _prodsOo_case _prodsOo_cata _prodsOo_dovisit _prodsOo_newtypes _prodsOo_rename _prodsOo_sem _prodsOo_sig _prodsOo_unbox _prodsOo_wantvisit _prodsOprefix _prodsOsyn _prodsOvcount 
+                         in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminal,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
+-- Nonterminals ------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allnts               : [Identifier]
+         aroundMap            : Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
+         cInterfaceMap        : CInterfaceMap
+         cVisitsMap           : CVisitsMap
+         manualAttrDepMap     : AttrOrderMap
+         mergeMap             : Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
+         o_case               : Bool
+         o_cata               : Bool
+         o_data               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_unbox              : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+      chained attributes:
+         acount               : Int
+         vcount               : Int
+      synthesized attributes:
+         additionalDep        : Seq Edge
+         aranges              : Seq (Int,Int,Int)
+         aroundDep            : Seq Edge
+         cNonterminals        : CNonterminals
+         directDep            : Seq Edge
+         errors               : Seq Error
+         instDep              : Seq Edge
+         mergeDep             : Seq Edge
+         nAutoRules           : Int
+         nExplicitRules       : Int
+         nonts                : [(NontermIdent,[ConstructorIdent])]
+         ntattrs              : Seq (Vertex,NTAttr)
+         rules                : Seq (Vertex,CRule)
+   alternatives:
+      alternative Cons:
+         child hd             : Nonterminal 
+         child tl             : Nonterminals 
+      alternative Nil:
+-}
+-- cata
+sem_Nonterminals :: Nonterminals  ->
+                    T_Nonterminals 
+sem_Nonterminals list  =
+    (Prelude.foldr sem_Nonterminals_Cons sem_Nonterminals_Nil (Prelude.map sem_Nonterminal list) )
+-- semantic domain
+newtype T_Nonterminals  = T_Nonterminals (Int ->
+                                          ([Identifier]) ->
+                                          (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))) ->
+                                          CInterfaceMap ->
+                                          CVisitsMap ->
+                                          AttrOrderMap ->
+                                          (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))) ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          Bool ->
+                                          String ->
+                                          Int ->
+                                          ( Int,(Seq Edge),(Seq (Int,Int,Int)),(Seq Edge),CNonterminals,(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,([(NontermIdent,[ConstructorIdent])]),(Seq (Vertex,NTAttr)),(Seq (Vertex,CRule)),Int))
+data Inh_Nonterminals  = Inh_Nonterminals {acount_Inh_Nonterminals :: !(Int),allnts_Inh_Nonterminals :: !(([Identifier])),aroundMap_Inh_Nonterminals :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))),cInterfaceMap_Inh_Nonterminals :: !(CInterfaceMap),cVisitsMap_Inh_Nonterminals :: !(CVisitsMap),manualAttrDepMap_Inh_Nonterminals :: !(AttrOrderMap),mergeMap_Inh_Nonterminals :: !((Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))),o_case_Inh_Nonterminals :: !(Bool),o_cata_Inh_Nonterminals :: !(Bool),o_data_Inh_Nonterminals :: !(Bool),o_dovisit_Inh_Nonterminals :: !(Bool),o_newtypes_Inh_Nonterminals :: !(Bool),o_rename_Inh_Nonterminals :: !(Bool),o_sem_Inh_Nonterminals :: !(Bool),o_sig_Inh_Nonterminals :: !(Bool),o_unbox_Inh_Nonterminals :: !(Bool),o_wantvisit_Inh_Nonterminals :: !(Bool),prefix_Inh_Nonterminals :: !(String),vcount_Inh_Nonterminals :: !(Int)}
+data Syn_Nonterminals  = Syn_Nonterminals {acount_Syn_Nonterminals :: !(Int),additionalDep_Syn_Nonterminals :: !((Seq Edge)),aranges_Syn_Nonterminals :: !((Seq (Int,Int,Int))),aroundDep_Syn_Nonterminals :: !((Seq Edge)),cNonterminals_Syn_Nonterminals :: !(CNonterminals),directDep_Syn_Nonterminals :: !((Seq Edge)),errors_Syn_Nonterminals :: !((Seq Error)),instDep_Syn_Nonterminals :: !((Seq Edge)),mergeDep_Syn_Nonterminals :: !((Seq Edge)),nAutoRules_Syn_Nonterminals :: !(Int),nExplicitRules_Syn_Nonterminals :: !(Int),nonts_Syn_Nonterminals :: !(([(NontermIdent,[ConstructorIdent])])),ntattrs_Syn_Nonterminals :: !((Seq (Vertex,NTAttr))),rules_Syn_Nonterminals :: !((Seq (Vertex,CRule))),vcount_Syn_Nonterminals :: !(Int)}
+wrap_Nonterminals :: T_Nonterminals  ->
+                     Inh_Nonterminals  ->
+                     Syn_Nonterminals 
+wrap_Nonterminals (T_Nonterminals sem ) (Inh_Nonterminals _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount )  =
+    (let ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount) = sem _lhsIacount _lhsIallnts _lhsIaroundMap _lhsIcInterfaceMap _lhsIcVisitsMap _lhsImanualAttrDepMap _lhsImergeMap _lhsIo_case _lhsIo_cata _lhsIo_data _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIvcount 
+     in  (Syn_Nonterminals _lhsOacount _lhsOadditionalDep _lhsOaranges _lhsOaroundDep _lhsOcNonterminals _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOnonts _lhsOntattrs _lhsOrules _lhsOvcount ))
+sem_Nonterminals_Cons :: T_Nonterminal  ->
+                         T_Nonterminals  ->
+                         T_Nonterminals 
+sem_Nonterminals_Cons (T_Nonterminal hd_ ) (T_Nonterminals tl_ )  =
+    (T_Nonterminals (\ _lhsIacount
+                       _lhsIallnts
+                       _lhsIaroundMap
+                       _lhsIcInterfaceMap
+                       _lhsIcVisitsMap
+                       _lhsImanualAttrDepMap
+                       _lhsImergeMap
+                       _lhsIo_case
+                       _lhsIo_cata
+                       _lhsIo_data
+                       _lhsIo_dovisit
+                       _lhsIo_newtypes
+                       _lhsIo_rename
+                       _lhsIo_sem
+                       _lhsIo_sig
+                       _lhsIo_unbox
+                       _lhsIo_wantvisit
+                       _lhsIprefix
+                       _lhsIvcount ->
+                         (let _lhsOcNonterminals :: CNonterminals
+                              _lhsOadditionalDep :: (Seq Edge)
+                              _lhsOaranges :: (Seq (Int,Int,Int))
+                              _lhsOaroundDep :: (Seq Edge)
+                              _lhsOdirectDep :: (Seq Edge)
+                              _lhsOerrors :: (Seq Error)
+                              _lhsOinstDep :: (Seq Edge)
+                              _lhsOmergeDep :: (Seq Edge)
+                              _lhsOnAutoRules :: Int
+                              _lhsOnExplicitRules :: Int
+                              _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
+                              _lhsOntattrs :: (Seq (Vertex,NTAttr))
+                              _lhsOrules :: (Seq (Vertex,CRule))
+                              _lhsOacount :: Int
+                              _lhsOvcount :: Int
+                              _hdOacount :: Int
+                              _hdOallnts :: ([Identifier])
+                              _hdOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
+                              _hdOcInterfaceMap :: CInterfaceMap
+                              _hdOcVisitsMap :: CVisitsMap
+                              _hdOmanualAttrDepMap :: AttrOrderMap
+                              _hdOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
+                              _hdOo_case :: Bool
+                              _hdOo_cata :: Bool
+                              _hdOo_data :: Bool
+                              _hdOo_dovisit :: Bool
+                              _hdOo_newtypes :: Bool
+                              _hdOo_rename :: Bool
+                              _hdOo_sem :: Bool
+                              _hdOo_sig :: Bool
+                              _hdOo_unbox :: Bool
+                              _hdOo_wantvisit :: Bool
+                              _hdOprefix :: String
+                              _hdOvcount :: Int
+                              _tlOacount :: Int
+                              _tlOallnts :: ([Identifier])
+                              _tlOaroundMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))
+                              _tlOcInterfaceMap :: CInterfaceMap
+                              _tlOcVisitsMap :: CVisitsMap
+                              _tlOmanualAttrDepMap :: AttrOrderMap
+                              _tlOmergeMap :: (Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))))
+                              _tlOo_case :: Bool
+                              _tlOo_cata :: Bool
+                              _tlOo_data :: Bool
+                              _tlOo_dovisit :: Bool
+                              _tlOo_newtypes :: Bool
+                              _tlOo_rename :: Bool
+                              _tlOo_sem :: Bool
+                              _tlOo_sig :: Bool
+                              _tlOo_unbox :: Bool
+                              _tlOo_wantvisit :: Bool
+                              _tlOprefix :: String
+                              _tlOvcount :: Int
+                              _hdIacount :: Int
+                              _hdIadditionalDep :: (Seq Edge)
+                              _hdIaranges :: (Seq (Int,Int,Int))
+                              _hdIaroundDep :: (Seq Edge)
+                              _hdIcNonterminal :: CNonterminal
+                              _hdIdirectDep :: (Seq Edge)
+                              _hdIerrors :: (Seq Error)
+                              _hdIinstDep :: (Seq Edge)
+                              _hdImergeDep :: (Seq Edge)
+                              _hdInAutoRules :: Int
+                              _hdInExplicitRules :: Int
+                              _hdInonts :: ([(NontermIdent,[ConstructorIdent])])
+                              _hdIntattrs :: (Seq (Vertex,NTAttr))
+                              _hdIrules :: (Seq (Vertex,CRule))
+                              _hdIvcount :: Int
+                              _tlIacount :: Int
+                              _tlIadditionalDep :: (Seq Edge)
+                              _tlIaranges :: (Seq (Int,Int,Int))
+                              _tlIaroundDep :: (Seq Edge)
+                              _tlIcNonterminals :: CNonterminals
+                              _tlIdirectDep :: (Seq Edge)
+                              _tlIerrors :: (Seq Error)
+                              _tlIinstDep :: (Seq Edge)
+                              _tlImergeDep :: (Seq Edge)
+                              _tlInAutoRules :: Int
+                              _tlInExplicitRules :: Int
+                              _tlInonts :: ([(NontermIdent,[ConstructorIdent])])
+                              _tlIntattrs :: (Seq (Vertex,NTAttr))
+                              _tlIrules :: (Seq (Vertex,CRule))
+                              _tlIvcount :: Int
+                              -- "Order.ag"(line 623, column 12)
+                              _lhsOcNonterminals =
+                                  ({-# LINE 623 "Order.ag" #-}
+                                   _hdIcNonterminal : _tlIcNonterminals
+                                   {-# LINE 1936 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 283, column 60)
+                              _lhsOadditionalDep =
+                                  ({-# LINE 283 "Order.ag" #-}
+                                   _hdIadditionalDep Seq.>< _tlIadditionalDep
+                                   {-# LINE 1942 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 502, column 36)
+                              _lhsOaranges =
+                                  ({-# LINE 502 "Order.ag" #-}
+                                   _hdIaranges Seq.>< _tlIaranges
+                                   {-# LINE 1948 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 404, column 24)
+                              _lhsOaroundDep =
+                                  ({-# LINE 404 "Order.ag" #-}
+                                   _hdIaroundDep Seq.>< _tlIaroundDep
+                                   {-# LINE 1954 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 269, column 33)
+                              _lhsOdirectDep =
+                                  ({-# LINE 269 "Order.ag" #-}
+                                   _hdIdirectDep Seq.>< _tlIdirectDep
+                                   {-# LINE 1960 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 84, column 70)
+                              _lhsOerrors =
+                                  ({-# LINE 84 "Order.ag" #-}
+                                   _hdIerrors Seq.>< _tlIerrors
+                                   {-# LINE 1966 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 312, column 31)
+                              _lhsOinstDep =
+                                  ({-# LINE 312 "Order.ag" #-}
+                                   _hdIinstDep Seq.>< _tlIinstDep
+                                   {-# LINE 1972 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 367, column 18)
+                              _lhsOmergeDep =
+                                  ({-# LINE 367 "Order.ag" #-}
+                                   _hdImergeDep Seq.>< _tlImergeDep
+                                   {-# LINE 1978 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 61, column 105)
+                              _lhsOnAutoRules =
+                                  ({-# LINE 61 "Order.ag" #-}
+                                   _hdInAutoRules + _tlInAutoRules
+                                   {-# LINE 1984 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 61, column 105)
+                              _lhsOnExplicitRules =
+                                  ({-# LINE 61 "Order.ag" #-}
+                                   _hdInExplicitRules + _tlInExplicitRules
+                                   {-# LINE 1990 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 519, column 43)
+                              _lhsOnonts =
+                                  ({-# LINE 519 "Order.ag" #-}
+                                   _hdInonts ++ _tlInonts
+                                   {-# LINE 1996 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 501, column 35)
+                              _lhsOntattrs =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   _hdIntattrs Seq.>< _tlIntattrs
+                                   {-# LINE 2002 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 259, column 18)
+                              _lhsOrules =
+                                  ({-# LINE 259 "Order.ag" #-}
+                                   _hdIrules Seq.>< _tlIrules
+                                   {-# LINE 2008 "Order.hs" #-}
+                                   )
+                              -- copy rule (up)
+                              _lhsOacount =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   _tlIacount
+                                   {-# LINE 2014 "Order.hs" #-}
+                                   )
+                              -- copy rule (up)
+                              _lhsOvcount =
+                                  ({-# LINE 258 "Order.ag" #-}
+                                   _tlIvcount
+                                   {-# LINE 2020 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOacount =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   _lhsIacount
+                                   {-# LINE 2026 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOallnts =
+                                  ({-# LINE 649 "Order.ag" #-}
+                                   _lhsIallnts
+                                   {-# LINE 2032 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOaroundMap =
+                                  ({-# LINE 407 "Order.ag" #-}
+                                   _lhsIaroundMap
+                                   {-# LINE 2038 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOcInterfaceMap =
+                                  ({-# LINE 596 "Order.ag" #-}
+                                   _lhsIcInterfaceMap
+                                   {-# LINE 2044 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOcVisitsMap =
+                                  ({-# LINE 603 "Order.ag" #-}
+                                   _lhsIcVisitsMap
+                                   {-# LINE 2050 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOmanualAttrDepMap =
+                                  ({-# LINE 283 "Order.ag" #-}
+                                   _lhsImanualAttrDepMap
+                                   {-# LINE 2056 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOmergeMap =
+                                  ({-# LINE 354 "Order.ag" #-}
+                                   _lhsImergeMap
+                                   {-# LINE 2062 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_case =
+                                  ({-# LINE 117 "Order.ag" #-}
+                                   _lhsIo_case
+                                   {-# LINE 2068 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_cata =
+                                  ({-# LINE 111 "Order.ag" #-}
+                                   _lhsIo_cata
+                                   {-# LINE 2074 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_data =
+                                  ({-# LINE 120 "Order.ag" #-}
+                                   _lhsIo_data
+                                   {-# LINE 2080 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_dovisit =
+                                  ({-# LINE 116 "Order.ag" #-}
+                                   _lhsIo_dovisit
+                                   {-# LINE 2086 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_newtypes =
+                                  ({-# LINE 110 "Order.ag" #-}
+                                   _lhsIo_newtypes
+                                   {-# LINE 2092 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_rename =
+                                  ({-# LINE 114 "Order.ag" #-}
+                                   _lhsIo_rename
+                                   {-# LINE 2098 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_sem =
+                                  ({-# LINE 113 "Order.ag" #-}
+                                   _lhsIo_sem
+                                   {-# LINE 2104 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_sig =
+                                  ({-# LINE 112 "Order.ag" #-}
+                                   _lhsIo_sig
+                                   {-# LINE 2110 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_unbox =
+                                  ({-# LINE 119 "Order.ag" #-}
+                                   _lhsIo_unbox
+                                   {-# LINE 2116 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOo_wantvisit =
+                                  ({-# LINE 115 "Order.ag" #-}
+                                   _lhsIo_wantvisit
+                                   {-# LINE 2122 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOprefix =
+                                  ({-# LINE 118 "Order.ag" #-}
+                                   _lhsIprefix
+                                   {-# LINE 2128 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _hdOvcount =
+                                  ({-# LINE 258 "Order.ag" #-}
+                                   _lhsIvcount
+                                   {-# LINE 2134 "Order.hs" #-}
+                                   )
+                              -- copy rule (chain)
+                              _tlOacount =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   _hdIacount
+                                   {-# LINE 2140 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOallnts =
+                                  ({-# LINE 649 "Order.ag" #-}
+                                   _lhsIallnts
+                                   {-# LINE 2146 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOaroundMap =
+                                  ({-# LINE 407 "Order.ag" #-}
+                                   _lhsIaroundMap
+                                   {-# LINE 2152 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOcInterfaceMap =
+                                  ({-# LINE 596 "Order.ag" #-}
+                                   _lhsIcInterfaceMap
+                                   {-# LINE 2158 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOcVisitsMap =
+                                  ({-# LINE 603 "Order.ag" #-}
+                                   _lhsIcVisitsMap
+                                   {-# LINE 2164 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOmanualAttrDepMap =
+                                  ({-# LINE 283 "Order.ag" #-}
+                                   _lhsImanualAttrDepMap
+                                   {-# LINE 2170 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOmergeMap =
+                                  ({-# LINE 354 "Order.ag" #-}
+                                   _lhsImergeMap
+                                   {-# LINE 2176 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_case =
+                                  ({-# LINE 117 "Order.ag" #-}
+                                   _lhsIo_case
+                                   {-# LINE 2182 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_cata =
+                                  ({-# LINE 111 "Order.ag" #-}
+                                   _lhsIo_cata
+                                   {-# LINE 2188 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_data =
+                                  ({-# LINE 120 "Order.ag" #-}
+                                   _lhsIo_data
+                                   {-# LINE 2194 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_dovisit =
+                                  ({-# LINE 116 "Order.ag" #-}
+                                   _lhsIo_dovisit
+                                   {-# LINE 2200 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_newtypes =
+                                  ({-# LINE 110 "Order.ag" #-}
+                                   _lhsIo_newtypes
+                                   {-# LINE 2206 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_rename =
+                                  ({-# LINE 114 "Order.ag" #-}
+                                   _lhsIo_rename
+                                   {-# LINE 2212 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_sem =
+                                  ({-# LINE 113 "Order.ag" #-}
+                                   _lhsIo_sem
+                                   {-# LINE 2218 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_sig =
+                                  ({-# LINE 112 "Order.ag" #-}
+                                   _lhsIo_sig
+                                   {-# LINE 2224 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_unbox =
+                                  ({-# LINE 119 "Order.ag" #-}
+                                   _lhsIo_unbox
+                                   {-# LINE 2230 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOo_wantvisit =
+                                  ({-# LINE 115 "Order.ag" #-}
+                                   _lhsIo_wantvisit
+                                   {-# LINE 2236 "Order.hs" #-}
+                                   )
+                              -- copy rule (down)
+                              _tlOprefix =
+                                  ({-# LINE 118 "Order.ag" #-}
+                                   _lhsIprefix
+                                   {-# LINE 2242 "Order.hs" #-}
+                                   )
+                              -- copy rule (chain)
+                              _tlOvcount =
+                                  ({-# LINE 258 "Order.ag" #-}
+                                   _hdIvcount
+                                   {-# LINE 2248 "Order.hs" #-}
+                                   )
+                              ( _hdIacount,_hdIadditionalDep,_hdIaranges,_hdIaroundDep,_hdIcNonterminal,_hdIdirectDep,_hdIerrors,_hdIinstDep,_hdImergeDep,_hdInAutoRules,_hdInExplicitRules,_hdInonts,_hdIntattrs,_hdIrules,_hdIvcount) =
+                                  hd_ _hdOacount _hdOallnts _hdOaroundMap _hdOcInterfaceMap _hdOcVisitsMap _hdOmanualAttrDepMap _hdOmergeMap _hdOo_case _hdOo_cata _hdOo_data _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_unbox _hdOo_wantvisit _hdOprefix _hdOvcount 
+                              ( _tlIacount,_tlIadditionalDep,_tlIaranges,_tlIaroundDep,_tlIcNonterminals,_tlIdirectDep,_tlIerrors,_tlIinstDep,_tlImergeDep,_tlInAutoRules,_tlInExplicitRules,_tlInonts,_tlIntattrs,_tlIrules,_tlIvcount) =
+                                  tl_ _tlOacount _tlOallnts _tlOaroundMap _tlOcInterfaceMap _tlOcVisitsMap _tlOmanualAttrDepMap _tlOmergeMap _tlOo_case _tlOo_cata _tlOo_data _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_unbox _tlOo_wantvisit _tlOprefix _tlOvcount 
+                          in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
+sem_Nonterminals_Nil :: T_Nonterminals 
+sem_Nonterminals_Nil  =
+    (T_Nonterminals (\ _lhsIacount
+                       _lhsIallnts
+                       _lhsIaroundMap
+                       _lhsIcInterfaceMap
+                       _lhsIcVisitsMap
+                       _lhsImanualAttrDepMap
+                       _lhsImergeMap
+                       _lhsIo_case
+                       _lhsIo_cata
+                       _lhsIo_data
+                       _lhsIo_dovisit
+                       _lhsIo_newtypes
+                       _lhsIo_rename
+                       _lhsIo_sem
+                       _lhsIo_sig
+                       _lhsIo_unbox
+                       _lhsIo_wantvisit
+                       _lhsIprefix
+                       _lhsIvcount ->
+                         (let _lhsOcNonterminals :: CNonterminals
+                              _lhsOadditionalDep :: (Seq Edge)
+                              _lhsOaranges :: (Seq (Int,Int,Int))
+                              _lhsOaroundDep :: (Seq Edge)
+                              _lhsOdirectDep :: (Seq Edge)
+                              _lhsOerrors :: (Seq Error)
+                              _lhsOinstDep :: (Seq Edge)
+                              _lhsOmergeDep :: (Seq Edge)
+                              _lhsOnAutoRules :: Int
+                              _lhsOnExplicitRules :: Int
+                              _lhsOnonts :: ([(NontermIdent,[ConstructorIdent])])
+                              _lhsOntattrs :: (Seq (Vertex,NTAttr))
+                              _lhsOrules :: (Seq (Vertex,CRule))
+                              _lhsOacount :: Int
+                              _lhsOvcount :: Int
+                              -- "Order.ag"(line 624, column 12)
+                              _lhsOcNonterminals =
+                                  ({-# LINE 624 "Order.ag" #-}
+                                   []
+                                   {-# LINE 2295 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 283, column 60)
+                              _lhsOadditionalDep =
+                                  ({-# LINE 283 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2301 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 502, column 36)
+                              _lhsOaranges =
+                                  ({-# LINE 502 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2307 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 404, column 24)
+                              _lhsOaroundDep =
+                                  ({-# LINE 404 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2313 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 269, column 33)
+                              _lhsOdirectDep =
+                                  ({-# LINE 269 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2319 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 84, column 70)
+                              _lhsOerrors =
+                                  ({-# LINE 84 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2325 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 312, column 31)
+                              _lhsOinstDep =
+                                  ({-# LINE 312 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2331 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 367, column 18)
+                              _lhsOmergeDep =
+                                  ({-# LINE 367 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2337 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 61, column 105)
+                              _lhsOnAutoRules =
+                                  ({-# LINE 61 "Order.ag" #-}
+                                   0
+                                   {-# LINE 2343 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 61, column 105)
+                              _lhsOnExplicitRules =
+                                  ({-# LINE 61 "Order.ag" #-}
+                                   0
+                                   {-# LINE 2349 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 519, column 43)
+                              _lhsOnonts =
+                                  ({-# LINE 519 "Order.ag" #-}
+                                   []
+                                   {-# LINE 2355 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 501, column 35)
+                              _lhsOntattrs =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2361 "Order.hs" #-}
+                                   )
+                              -- use rule "Order.ag"(line 259, column 18)
+                              _lhsOrules =
+                                  ({-# LINE 259 "Order.ag" #-}
+                                   Seq.empty
+                                   {-# LINE 2367 "Order.hs" #-}
+                                   )
+                              -- copy rule (chain)
+                              _lhsOacount =
+                                  ({-# LINE 501 "Order.ag" #-}
+                                   _lhsIacount
+                                   {-# LINE 2373 "Order.hs" #-}
+                                   )
+                              -- copy rule (chain)
+                              _lhsOvcount =
+                                  ({-# LINE 258 "Order.ag" #-}
+                                   _lhsIvcount
+                                   {-# LINE 2379 "Order.hs" #-}
+                                   )
+                          in  ( _lhsOacount,_lhsOadditionalDep,_lhsOaranges,_lhsOaroundDep,_lhsOcNonterminals,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOnonts,_lhsOntattrs,_lhsOrules,_lhsOvcount))) )
+-- Pattern -----------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allTypeSigs          : Map Identifier Type
+         altAttrs             : Map AltAttr Vertex
+         con                  : Identifier
+         inh                  : Attributes
+         nt                   : Identifier
+         syn                  : Attributes
+      synthesized attributes:
+         copy                 : SELF 
+         errors               : Seq Error
+         gathAltAttrs         : [AltAttr]
+         instVars             : [Identifier]
+         locVars              : [Identifier]
+         patternAttrs         : [(Identifier,Identifier,Bool,Patterns)]
+   alternatives:
+      alternative Alias:
+         child field          : {Identifier}
+         child attr           : {Identifier}
+         child pat            : Pattern 
+         child parts          : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Constr:
+         child name           : {ConstructorIdent}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Irrefutable:
+         child pat            : Pattern 
+         visit 0:
+            local copy        : _
+      alternative Product:
+         child pos            : {Pos}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Underscore:
+         child pos            : {Pos}
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Pattern :: Pattern  ->
+               T_Pattern 
+sem_Pattern (Alias _field _attr _pat _parts )  =
+    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
+sem_Pattern (Constr _name _pats )  =
+    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
+sem_Pattern (Irrefutable _pat )  =
+    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
+sem_Pattern (Product _pos _pats )  =
+    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
+sem_Pattern (Underscore _pos )  =
+    (sem_Pattern_Underscore _pos )
+-- semantic domain
+newtype T_Pattern  = T_Pattern ((Map Identifier Type) ->
+                                (Map AltAttr Vertex) ->
+                                Identifier ->
+                                Attributes ->
+                                Identifier ->
+                                Attributes ->
+                                ( Pattern ,(Seq Error),([AltAttr]),([Identifier]),([Identifier]),([(Identifier,Identifier,Bool,Patterns)])))
+data Inh_Pattern  = Inh_Pattern {allTypeSigs_Inh_Pattern :: !((Map Identifier Type)),altAttrs_Inh_Pattern :: !((Map AltAttr Vertex)),con_Inh_Pattern :: !(Identifier),inh_Inh_Pattern :: !(Attributes),nt_Inh_Pattern :: !(Identifier),syn_Inh_Pattern :: !(Attributes)}
+data Syn_Pattern  = Syn_Pattern {copy_Syn_Pattern :: !(Pattern ),errors_Syn_Pattern :: !((Seq Error)),gathAltAttrs_Syn_Pattern :: !(([AltAttr])),instVars_Syn_Pattern :: !(([Identifier])),locVars_Syn_Pattern :: !(([Identifier])),patternAttrs_Syn_Pattern :: !(([(Identifier,Identifier,Bool,Patterns)]))}
+wrap_Pattern :: T_Pattern  ->
+                Inh_Pattern  ->
+                Syn_Pattern 
+wrap_Pattern (T_Pattern sem ) (Inh_Pattern _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn )  =
+    (let ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs) = sem _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn 
+     in  (Syn_Pattern _lhsOcopy _lhsOerrors _lhsOgathAltAttrs _lhsOinstVars _lhsOlocVars _lhsOpatternAttrs ))
+sem_Pattern_Alias :: Identifier ->
+                     Identifier ->
+                     T_Pattern  ->
+                     T_Patterns  ->
+                     T_Pattern 
+sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
+    (T_Pattern (\ _lhsIallTypeSigs
+                  _lhsIaltAttrs
+                  _lhsIcon
+                  _lhsIinh
+                  _lhsInt
+                  _lhsIsyn ->
+                    (let _lhsOgathAltAttrs :: ([AltAttr])
+                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _lhsOlocVars :: ([Identifier])
+                         _lhsOinstVars :: ([Identifier])
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOcopy :: Pattern 
+                         _patOallTypeSigs :: (Map Identifier Type)
+                         _patOaltAttrs :: (Map AltAttr Vertex)
+                         _patOcon :: Identifier
+                         _patOinh :: Attributes
+                         _patOnt :: Identifier
+                         _patOsyn :: Attributes
+                         _partsOallTypeSigs :: (Map Identifier Type)
+                         _partsOaltAttrs :: (Map AltAttr Vertex)
+                         _partsOcon :: Identifier
+                         _partsOinh :: Attributes
+                         _partsOnt :: Identifier
+                         _partsOsyn :: Attributes
+                         _patIcopy :: Pattern 
+                         _patIerrors :: (Seq Error)
+                         _patIgathAltAttrs :: ([AltAttr])
+                         _patIinstVars :: ([Identifier])
+                         _patIlocVars :: ([Identifier])
+                         _patIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _partsIcopy :: Patterns 
+                         _partsIerrors :: (Seq Error)
+                         _partsIgathAltAttrs :: ([AltAttr])
+                         _partsIinstVars :: ([Identifier])
+                         _partsIlocVars :: ([Identifier])
+                         _partsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         -- "Order.ag"(line 184, column 12)
+                         _lhsOgathAltAttrs =
+                             ({-# LINE 184 "Order.ag" #-}
+                              [AltAttr field_ attr_ (field_ == _LOC || field_ == _INST)]
+                              {-# LINE 2501 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 252, column 12)
+                         _lhsOpatternAttrs =
+                             ({-# LINE 252 "Order.ag" #-}
+                              [(field_,attr_,(field_ == _LOC || field_ == _INST),_partsIcopy)]
+                              {-# LINE 2507 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 682, column 14)
+                         _lhsOlocVars =
+                             ({-# LINE 682 "Order.ag" #-}
+                              if field_ == _LOC
+                                 then [attr_]
+                                 else []
+                              {-# LINE 2515 "Order.hs" #-}
+                              )
+                         -- "Order.ag"(line 685, column 14)
+                         _lhsOinstVars =
+                             ({-# LINE 685 "Order.ag" #-}
+                              if field_ == _INST
+                                 then [attr_]
+                                 else []
+                              {-# LINE 2523 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 84, column 70)
+                         _lhsOerrors =
+                             ({-# LINE 84 "Order.ag" #-}
+                              _patIerrors Seq.>< _partsIerrors
+                              {-# LINE 2529 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Alias field_ attr_ _patIcopy _partsIcopy
+                              {-# LINE 2535 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 2541 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOallTypeSigs =
+                             ({-# LINE 535 "Order.ag" #-}
+                              _lhsIallTypeSigs
+                              {-# LINE 2547 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOaltAttrs =
+                             ({-# LINE 186 "Order.ag" #-}
+                              _lhsIaltAttrs
+                              {-# LINE 2553 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOcon =
+                             ({-# LINE 90 "Order.ag" #-}
+                              _lhsIcon
+                              {-# LINE 2559 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOinh =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIinh
+                              {-# LINE 2565 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOnt =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsInt
+                              {-# LINE 2571 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOsyn =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIsyn
+                              {-# LINE 2577 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOallTypeSigs =
+                             ({-# LINE 535 "Order.ag" #-}
+                              _lhsIallTypeSigs
+                              {-# LINE 2583 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOaltAttrs =
+                             ({-# LINE 186 "Order.ag" #-}
+                              _lhsIaltAttrs
+                              {-# LINE 2589 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOcon =
+                             ({-# LINE 90 "Order.ag" #-}
+                              _lhsIcon
+                              {-# LINE 2595 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOinh =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIinh
+                              {-# LINE 2601 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOnt =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsInt
+                              {-# LINE 2607 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _partsOsyn =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIsyn
+                              {-# LINE 2613 "Order.hs" #-}
+                              )
+                         ( _patIcopy,_patIerrors,_patIgathAltAttrs,_patIinstVars,_patIlocVars,_patIpatternAttrs) =
+                             pat_ _patOallTypeSigs _patOaltAttrs _patOcon _patOinh _patOnt _patOsyn 
+                         ( _partsIcopy,_partsIerrors,_partsIgathAltAttrs,_partsIinstVars,_partsIlocVars,_partsIpatternAttrs) =
+                             parts_ _partsOallTypeSigs _partsOaltAttrs _partsOcon _partsOinh _partsOnt _partsOsyn 
+                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+sem_Pattern_Constr :: ConstructorIdent ->
+                      T_Patterns  ->
+                      T_Pattern 
+sem_Pattern_Constr name_ (T_Patterns pats_ )  =
+    (T_Pattern (\ _lhsIallTypeSigs
+                  _lhsIaltAttrs
+                  _lhsIcon
+                  _lhsIinh
+                  _lhsInt
+                  _lhsIsyn ->
+                    (let _lhsOerrors :: (Seq Error)
+                         _lhsOgathAltAttrs :: ([AltAttr])
+                         _lhsOinstVars :: ([Identifier])
+                         _lhsOlocVars :: ([Identifier])
+                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _lhsOcopy :: Pattern 
+                         _patsOallTypeSigs :: (Map Identifier Type)
+                         _patsOaltAttrs :: (Map AltAttr Vertex)
+                         _patsOcon :: Identifier
+                         _patsOinh :: Attributes
+                         _patsOnt :: Identifier
+                         _patsOsyn :: Attributes
+                         _patsIcopy :: Patterns 
+                         _patsIerrors :: (Seq Error)
+                         _patsIgathAltAttrs :: ([AltAttr])
+                         _patsIinstVars :: ([Identifier])
+                         _patsIlocVars :: ([Identifier])
+                         _patsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         -- use rule "Order.ag"(line 84, column 70)
+                         _lhsOerrors =
+                             ({-# LINE 84 "Order.ag" #-}
+                              _patsIerrors
+                              {-# LINE 2652 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 170, column 68)
+                         _lhsOgathAltAttrs =
+                             ({-# LINE 170 "Order.ag" #-}
+                              _patsIgathAltAttrs
+                              {-# LINE 2658 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 86)
+                         _lhsOinstVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patsIinstVars
+                              {-# LINE 2664 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 48)
+                         _lhsOlocVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patsIlocVars
+                              {-# LINE 2670 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 249, column 42)
+                         _lhsOpatternAttrs =
+                             ({-# LINE 249 "Order.ag" #-}
+                              _patsIpatternAttrs
+                              {-# LINE 2676 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Constr name_ _patsIcopy
+                              {-# LINE 2682 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 2688 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOallTypeSigs =
+                             ({-# LINE 535 "Order.ag" #-}
+                              _lhsIallTypeSigs
+                              {-# LINE 2694 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOaltAttrs =
+                             ({-# LINE 186 "Order.ag" #-}
+                              _lhsIaltAttrs
+                              {-# LINE 2700 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOcon =
+                             ({-# LINE 90 "Order.ag" #-}
+                              _lhsIcon
+                              {-# LINE 2706 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOinh =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIinh
+                              {-# LINE 2712 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOnt =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsInt
+                              {-# LINE 2718 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOsyn =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIsyn
+                              {-# LINE 2724 "Order.hs" #-}
+                              )
+                         ( _patsIcopy,_patsIerrors,_patsIgathAltAttrs,_patsIinstVars,_patsIlocVars,_patsIpatternAttrs) =
+                             pats_ _patsOallTypeSigs _patsOaltAttrs _patsOcon _patsOinh _patsOnt _patsOsyn 
+                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+sem_Pattern_Irrefutable :: T_Pattern  ->
+                           T_Pattern 
+sem_Pattern_Irrefutable (T_Pattern pat_ )  =
+    (T_Pattern (\ _lhsIallTypeSigs
+                  _lhsIaltAttrs
+                  _lhsIcon
+                  _lhsIinh
+                  _lhsInt
+                  _lhsIsyn ->
+                    (let _lhsOerrors :: (Seq Error)
+                         _lhsOgathAltAttrs :: ([AltAttr])
+                         _lhsOinstVars :: ([Identifier])
+                         _lhsOlocVars :: ([Identifier])
+                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _lhsOcopy :: Pattern 
+                         _patOallTypeSigs :: (Map Identifier Type)
+                         _patOaltAttrs :: (Map AltAttr Vertex)
+                         _patOcon :: Identifier
+                         _patOinh :: Attributes
+                         _patOnt :: Identifier
+                         _patOsyn :: Attributes
+                         _patIcopy :: Pattern 
+                         _patIerrors :: (Seq Error)
+                         _patIgathAltAttrs :: ([AltAttr])
+                         _patIinstVars :: ([Identifier])
+                         _patIlocVars :: ([Identifier])
+                         _patIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         -- use rule "Order.ag"(line 84, column 70)
+                         _lhsOerrors =
+                             ({-# LINE 84 "Order.ag" #-}
+                              _patIerrors
+                              {-# LINE 2760 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 170, column 68)
+                         _lhsOgathAltAttrs =
+                             ({-# LINE 170 "Order.ag" #-}
+                              _patIgathAltAttrs
+                              {-# LINE 2766 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 86)
+                         _lhsOinstVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patIinstVars
+                              {-# LINE 2772 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 48)
+                         _lhsOlocVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patIlocVars
+                              {-# LINE 2778 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 249, column 42)
+                         _lhsOpatternAttrs =
+                             ({-# LINE 249 "Order.ag" #-}
+                              _patIpatternAttrs
+                              {-# LINE 2784 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Irrefutable _patIcopy
+                              {-# LINE 2790 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 2796 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOallTypeSigs =
+                             ({-# LINE 535 "Order.ag" #-}
+                              _lhsIallTypeSigs
+                              {-# LINE 2802 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOaltAttrs =
+                             ({-# LINE 186 "Order.ag" #-}
+                              _lhsIaltAttrs
+                              {-# LINE 2808 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOcon =
+                             ({-# LINE 90 "Order.ag" #-}
+                              _lhsIcon
+                              {-# LINE 2814 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOinh =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIinh
+                              {-# LINE 2820 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOnt =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsInt
+                              {-# LINE 2826 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patOsyn =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIsyn
+                              {-# LINE 2832 "Order.hs" #-}
+                              )
+                         ( _patIcopy,_patIerrors,_patIgathAltAttrs,_patIinstVars,_patIlocVars,_patIpatternAttrs) =
+                             pat_ _patOallTypeSigs _patOaltAttrs _patOcon _patOinh _patOnt _patOsyn 
+                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+sem_Pattern_Product :: Pos ->
+                       T_Patterns  ->
+                       T_Pattern 
+sem_Pattern_Product pos_ (T_Patterns pats_ )  =
+    (T_Pattern (\ _lhsIallTypeSigs
+                  _lhsIaltAttrs
+                  _lhsIcon
+                  _lhsIinh
+                  _lhsInt
+                  _lhsIsyn ->
+                    (let _lhsOerrors :: (Seq Error)
+                         _lhsOgathAltAttrs :: ([AltAttr])
+                         _lhsOinstVars :: ([Identifier])
+                         _lhsOlocVars :: ([Identifier])
+                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _lhsOcopy :: Pattern 
+                         _patsOallTypeSigs :: (Map Identifier Type)
+                         _patsOaltAttrs :: (Map AltAttr Vertex)
+                         _patsOcon :: Identifier
+                         _patsOinh :: Attributes
+                         _patsOnt :: Identifier
+                         _patsOsyn :: Attributes
+                         _patsIcopy :: Patterns 
+                         _patsIerrors :: (Seq Error)
+                         _patsIgathAltAttrs :: ([AltAttr])
+                         _patsIinstVars :: ([Identifier])
+                         _patsIlocVars :: ([Identifier])
+                         _patsIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         -- use rule "Order.ag"(line 84, column 70)
+                         _lhsOerrors =
+                             ({-# LINE 84 "Order.ag" #-}
+                              _patsIerrors
+                              {-# LINE 2869 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 170, column 68)
+                         _lhsOgathAltAttrs =
+                             ({-# LINE 170 "Order.ag" #-}
+                              _patsIgathAltAttrs
+                              {-# LINE 2875 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 86)
+                         _lhsOinstVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patsIinstVars
+                              {-# LINE 2881 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 48)
+                         _lhsOlocVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              _patsIlocVars
+                              {-# LINE 2887 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 249, column 42)
+                         _lhsOpatternAttrs =
+                             ({-# LINE 249 "Order.ag" #-}
+                              _patsIpatternAttrs
+                              {-# LINE 2893 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Product pos_ _patsIcopy
+                              {-# LINE 2899 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 2905 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOallTypeSigs =
+                             ({-# LINE 535 "Order.ag" #-}
+                              _lhsIallTypeSigs
+                              {-# LINE 2911 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOaltAttrs =
+                             ({-# LINE 186 "Order.ag" #-}
+                              _lhsIaltAttrs
+                              {-# LINE 2917 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOcon =
+                             ({-# LINE 90 "Order.ag" #-}
+                              _lhsIcon
+                              {-# LINE 2923 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOinh =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIinh
+                              {-# LINE 2929 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOnt =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsInt
+                              {-# LINE 2935 "Order.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _patsOsyn =
+                             ({-# LINE 89 "Order.ag" #-}
+                              _lhsIsyn
+                              {-# LINE 2941 "Order.hs" #-}
+                              )
+                         ( _patsIcopy,_patsIerrors,_patsIgathAltAttrs,_patsIinstVars,_patsIlocVars,_patsIpatternAttrs) =
+                             pats_ _patsOallTypeSigs _patsOaltAttrs _patsOcon _patsOinh _patsOnt _patsOsyn 
+                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+sem_Pattern_Underscore :: Pos ->
+                          T_Pattern 
+sem_Pattern_Underscore pos_  =
+    (T_Pattern (\ _lhsIallTypeSigs
+                  _lhsIaltAttrs
+                  _lhsIcon
+                  _lhsIinh
+                  _lhsInt
+                  _lhsIsyn ->
+                    (let _lhsOerrors :: (Seq Error)
+                         _lhsOgathAltAttrs :: ([AltAttr])
+                         _lhsOinstVars :: ([Identifier])
+                         _lhsOlocVars :: ([Identifier])
+                         _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                         _lhsOcopy :: Pattern 
+                         -- use rule "Order.ag"(line 84, column 70)
+                         _lhsOerrors =
+                             ({-# LINE 84 "Order.ag" #-}
+                              Seq.empty
+                              {-# LINE 2965 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 170, column 68)
+                         _lhsOgathAltAttrs =
+                             ({-# LINE 170 "Order.ag" #-}
+                              []
+                              {-# LINE 2971 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 86)
+                         _lhsOinstVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              []
+                              {-# LINE 2977 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 679, column 48)
+                         _lhsOlocVars =
+                             ({-# LINE 679 "Order.ag" #-}
+                              []
+                              {-# LINE 2983 "Order.hs" #-}
+                              )
+                         -- use rule "Order.ag"(line 249, column 42)
+                         _lhsOpatternAttrs =
+                             ({-# LINE 249 "Order.ag" #-}
+                              []
+                              {-# LINE 2989 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _copy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              Underscore pos_
+                              {-# LINE 2995 "Order.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOcopy =
+                             ({-# LINE 23 "./Patterns.ag" #-}
+                              _copy
+                              {-# LINE 3001 "Order.hs" #-}
+                              )
+                     in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+-- Patterns ----------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allTypeSigs          : Map Identifier Type
+         altAttrs             : Map AltAttr Vertex
+         con                  : Identifier
+         inh                  : Attributes
+         nt                   : Identifier
+         syn                  : Attributes
+      synthesized attributes:
+         copy                 : SELF 
+         errors               : Seq Error
+         gathAltAttrs         : [AltAttr]
+         instVars             : [Identifier]
+         locVars              : [Identifier]
+         patternAttrs         : [(Identifier,Identifier,Bool,Patterns)]
+   alternatives:
+      alternative Cons:
+         child hd             : Pattern 
+         child tl             : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Nil:
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Patterns :: Patterns  ->
+                T_Patterns 
+sem_Patterns list  =
+    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
+-- semantic domain
+newtype T_Patterns  = T_Patterns ((Map Identifier Type) ->
+                                  (Map AltAttr Vertex) ->
+                                  Identifier ->
+                                  Attributes ->
+                                  Identifier ->
+                                  Attributes ->
+                                  ( Patterns ,(Seq Error),([AltAttr]),([Identifier]),([Identifier]),([(Identifier,Identifier,Bool,Patterns)])))
+data Inh_Patterns  = Inh_Patterns {allTypeSigs_Inh_Patterns :: !((Map Identifier Type)),altAttrs_Inh_Patterns :: !((Map AltAttr Vertex)),con_Inh_Patterns :: !(Identifier),inh_Inh_Patterns :: !(Attributes),nt_Inh_Patterns :: !(Identifier),syn_Inh_Patterns :: !(Attributes)}
+data Syn_Patterns  = Syn_Patterns {copy_Syn_Patterns :: !(Patterns ),errors_Syn_Patterns :: !((Seq Error)),gathAltAttrs_Syn_Patterns :: !(([AltAttr])),instVars_Syn_Patterns :: !(([Identifier])),locVars_Syn_Patterns :: !(([Identifier])),patternAttrs_Syn_Patterns :: !(([(Identifier,Identifier,Bool,Patterns)]))}
+wrap_Patterns :: T_Patterns  ->
+                 Inh_Patterns  ->
+                 Syn_Patterns 
+wrap_Patterns (T_Patterns sem ) (Inh_Patterns _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn )  =
+    (let ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs) = sem _lhsIallTypeSigs _lhsIaltAttrs _lhsIcon _lhsIinh _lhsInt _lhsIsyn 
+     in  (Syn_Patterns _lhsOcopy _lhsOerrors _lhsOgathAltAttrs _lhsOinstVars _lhsOlocVars _lhsOpatternAttrs ))
+sem_Patterns_Cons :: T_Pattern  ->
+                     T_Patterns  ->
+                     T_Patterns 
+sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
+    (T_Patterns (\ _lhsIallTypeSigs
+                   _lhsIaltAttrs
+                   _lhsIcon
+                   _lhsIinh
+                   _lhsInt
+                   _lhsIsyn ->
+                     (let _lhsOerrors :: (Seq Error)
+                          _lhsOgathAltAttrs :: ([AltAttr])
+                          _lhsOinstVars :: ([Identifier])
+                          _lhsOlocVars :: ([Identifier])
+                          _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                          _lhsOcopy :: Patterns 
+                          _hdOallTypeSigs :: (Map Identifier Type)
+                          _hdOaltAttrs :: (Map AltAttr Vertex)
+                          _hdOcon :: Identifier
+                          _hdOinh :: Attributes
+                          _hdOnt :: Identifier
+                          _hdOsyn :: Attributes
+                          _tlOallTypeSigs :: (Map Identifier Type)
+                          _tlOaltAttrs :: (Map AltAttr Vertex)
+                          _tlOcon :: Identifier
+                          _tlOinh :: Attributes
+                          _tlOnt :: Identifier
+                          _tlOsyn :: Attributes
+                          _hdIcopy :: Pattern 
+                          _hdIerrors :: (Seq Error)
+                          _hdIgathAltAttrs :: ([AltAttr])
+                          _hdIinstVars :: ([Identifier])
+                          _hdIlocVars :: ([Identifier])
+                          _hdIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                          _tlIcopy :: Patterns 
+                          _tlIerrors :: (Seq Error)
+                          _tlIgathAltAttrs :: ([AltAttr])
+                          _tlIinstVars :: ([Identifier])
+                          _tlIlocVars :: ([Identifier])
+                          _tlIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                          -- use rule "Order.ag"(line 84, column 70)
+                          _lhsOerrors =
+                              ({-# LINE 84 "Order.ag" #-}
+                               _hdIerrors Seq.>< _tlIerrors
+                               {-# LINE 3096 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 170, column 68)
+                          _lhsOgathAltAttrs =
+                              ({-# LINE 170 "Order.ag" #-}
+                               _hdIgathAltAttrs ++ _tlIgathAltAttrs
+                               {-# LINE 3102 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 679, column 86)
+                          _lhsOinstVars =
+                              ({-# LINE 679 "Order.ag" #-}
+                               _hdIinstVars ++ _tlIinstVars
+                               {-# LINE 3108 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 679, column 48)
+                          _lhsOlocVars =
+                              ({-# LINE 679 "Order.ag" #-}
+                               _hdIlocVars ++ _tlIlocVars
+                               {-# LINE 3114 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 249, column 42)
+                          _lhsOpatternAttrs =
+                              ({-# LINE 249 "Order.ag" #-}
+                               _hdIpatternAttrs ++ _tlIpatternAttrs
+                               {-# LINE 3120 "Order.hs" #-}
+                               )
+                          -- self rule
+                          _copy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               (:) _hdIcopy _tlIcopy
+                               {-# LINE 3126 "Order.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOcopy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               _copy
+                               {-# LINE 3132 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOallTypeSigs =
+                              ({-# LINE 535 "Order.ag" #-}
+                               _lhsIallTypeSigs
+                               {-# LINE 3138 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOaltAttrs =
+                              ({-# LINE 186 "Order.ag" #-}
+                               _lhsIaltAttrs
+                               {-# LINE 3144 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOcon =
+                              ({-# LINE 90 "Order.ag" #-}
+                               _lhsIcon
+                               {-# LINE 3150 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOinh =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIinh
+                               {-# LINE 3156 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOnt =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsInt
+                               {-# LINE 3162 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOsyn =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIsyn
+                               {-# LINE 3168 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOallTypeSigs =
+                              ({-# LINE 535 "Order.ag" #-}
+                               _lhsIallTypeSigs
+                               {-# LINE 3174 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOaltAttrs =
+                              ({-# LINE 186 "Order.ag" #-}
+                               _lhsIaltAttrs
+                               {-# LINE 3180 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOcon =
+                              ({-# LINE 90 "Order.ag" #-}
+                               _lhsIcon
+                               {-# LINE 3186 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOinh =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIinh
+                               {-# LINE 3192 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOnt =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsInt
+                               {-# LINE 3198 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _tlOsyn =
+                              ({-# LINE 89 "Order.ag" #-}
+                               _lhsIsyn
+                               {-# LINE 3204 "Order.hs" #-}
+                               )
+                          ( _hdIcopy,_hdIerrors,_hdIgathAltAttrs,_hdIinstVars,_hdIlocVars,_hdIpatternAttrs) =
+                              hd_ _hdOallTypeSigs _hdOaltAttrs _hdOcon _hdOinh _hdOnt _hdOsyn 
+                          ( _tlIcopy,_tlIerrors,_tlIgathAltAttrs,_tlIinstVars,_tlIlocVars,_tlIpatternAttrs) =
+                              tl_ _tlOallTypeSigs _tlOaltAttrs _tlOcon _tlOinh _tlOnt _tlOsyn 
+                      in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+sem_Patterns_Nil :: T_Patterns 
+sem_Patterns_Nil  =
+    (T_Patterns (\ _lhsIallTypeSigs
+                   _lhsIaltAttrs
+                   _lhsIcon
+                   _lhsIinh
+                   _lhsInt
+                   _lhsIsyn ->
+                     (let _lhsOerrors :: (Seq Error)
+                          _lhsOgathAltAttrs :: ([AltAttr])
+                          _lhsOinstVars :: ([Identifier])
+                          _lhsOlocVars :: ([Identifier])
+                          _lhsOpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                          _lhsOcopy :: Patterns 
+                          -- use rule "Order.ag"(line 84, column 70)
+                          _lhsOerrors =
+                              ({-# LINE 84 "Order.ag" #-}
+                               Seq.empty
+                               {-# LINE 3229 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 170, column 68)
+                          _lhsOgathAltAttrs =
+                              ({-# LINE 170 "Order.ag" #-}
+                               []
+                               {-# LINE 3235 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 679, column 86)
+                          _lhsOinstVars =
+                              ({-# LINE 679 "Order.ag" #-}
+                               []
+                               {-# LINE 3241 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 679, column 48)
+                          _lhsOlocVars =
+                              ({-# LINE 679 "Order.ag" #-}
+                               []
+                               {-# LINE 3247 "Order.hs" #-}
+                               )
+                          -- use rule "Order.ag"(line 249, column 42)
+                          _lhsOpatternAttrs =
+                              ({-# LINE 249 "Order.ag" #-}
+                               []
+                               {-# LINE 3253 "Order.hs" #-}
+                               )
+                          -- self rule
+                          _copy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               []
+                               {-# LINE 3259 "Order.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOcopy =
+                              ({-# LINE 23 "./Patterns.ag" #-}
+                               _copy
+                               {-# LINE 3265 "Order.hs" #-}
+                               )
+                      in  ( _lhsOcopy,_lhsOerrors,_lhsOgathAltAttrs,_lhsOinstVars,_lhsOlocVars,_lhsOpatternAttrs))) )
+-- Production --------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allnts               : [Identifier]
+         aroundMap            : Map ConstructorIdent (Map Identifier [Expression])
+         cVisitsMap           : CVisitsMap
+         inh                  : Attributes
+         manualAttrDepMap     : AttrOrderMap
+         mergeMap             : Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))
+         nt                   : Identifier
+         o_case               : Bool
+         o_cata               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_unbox              : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+         syn                  : Attributes
+      chained attribute:
+         vcount               : Int
+      synthesized attributes:
+         additionalDep        : Seq Edge
+         aroundDep            : Seq Edge
+         cProduction          : CProduction
+         cons                 : [ConstructorIdent]
+         directDep            : Seq Edge
+         errors               : Seq Error
+         instDep              : Seq Edge
+         mergeDep             : Seq Edge
+         nAutoRules           : Int
+         nExplicitRules       : Int
+         rules                : Seq (Vertex,CRule)
+   alternatives:
+      alternative Production:
+         child con            : {ConstructorIdent}
+         child children       : Children 
+         child rules          : Rules 
+         child typeSigs       : TypeSigs 
+         visit 0:
+            local gathAltAttrs : _
+            local altAttrs    : _
+            local inhRules    : _
+            local gathRules   : _
+            local manualDeps  : _
+            local mergeMap    : _
+            local mergeDep1   : _
+            local mergeDep2   : _
+            local aroundMap   : _
+            local aroundDep1  : _
+            local aroundDep2  : _
+            local cVisits     : _
+            local allfields   : _
+            local attrs       : _
+            local inhnames    : _
+            local synnames    : _
+-}
+-- cata
+sem_Production :: Production  ->
+                  T_Production 
+sem_Production (Production _con _children _rules _typeSigs )  =
+    (sem_Production_Production _con (sem_Children _children ) (sem_Rules _rules ) (sem_TypeSigs _typeSigs ) )
+-- semantic domain
+newtype T_Production  = T_Production (([Identifier]) ->
+                                      (Map ConstructorIdent (Map Identifier [Expression])) ->
+                                      CVisitsMap ->
+                                      Attributes ->
+                                      AttrOrderMap ->
+                                      (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
+                                      Identifier ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      Bool ->
+                                      String ->
+                                      Attributes ->
+                                      Int ->
+                                      ( (Seq Edge),(Seq Edge),CProduction,([ConstructorIdent]),(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,(Seq (Vertex,CRule)),Int))
+data Inh_Production  = Inh_Production {allnts_Inh_Production :: !(([Identifier])),aroundMap_Inh_Production :: !((Map ConstructorIdent (Map Identifier [Expression]))),cVisitsMap_Inh_Production :: !(CVisitsMap),inh_Inh_Production :: !(Attributes),manualAttrDepMap_Inh_Production :: !(AttrOrderMap),mergeMap_Inh_Production :: !((Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),nt_Inh_Production :: !(Identifier),o_case_Inh_Production :: !(Bool),o_cata_Inh_Production :: !(Bool),o_dovisit_Inh_Production :: !(Bool),o_newtypes_Inh_Production :: !(Bool),o_rename_Inh_Production :: !(Bool),o_sem_Inh_Production :: !(Bool),o_sig_Inh_Production :: !(Bool),o_unbox_Inh_Production :: !(Bool),o_wantvisit_Inh_Production :: !(Bool),prefix_Inh_Production :: !(String),syn_Inh_Production :: !(Attributes),vcount_Inh_Production :: !(Int)}
+data Syn_Production  = Syn_Production {additionalDep_Syn_Production :: !((Seq Edge)),aroundDep_Syn_Production :: !((Seq Edge)),cProduction_Syn_Production :: !(CProduction),cons_Syn_Production :: !(([ConstructorIdent])),directDep_Syn_Production :: !((Seq Edge)),errors_Syn_Production :: !((Seq Error)),instDep_Syn_Production :: !((Seq Edge)),mergeDep_Syn_Production :: !((Seq Edge)),nAutoRules_Syn_Production :: !(Int),nExplicitRules_Syn_Production :: !(Int),rules_Syn_Production :: !((Seq (Vertex,CRule))),vcount_Syn_Production :: !(Int)}
+wrap_Production :: T_Production  ->
+                   Inh_Production  ->
+                   Syn_Production 
+wrap_Production (T_Production sem ) (Inh_Production _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount )  =
+    (let ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProduction,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount) = sem _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount 
+     in  (Syn_Production _lhsOadditionalDep _lhsOaroundDep _lhsOcProduction _lhsOcons _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOrules _lhsOvcount ))
+sem_Production_Production :: ConstructorIdent ->
+                             T_Children  ->
+                             T_Rules  ->
+                             T_TypeSigs  ->
+                             T_Production 
+sem_Production_Production con_ (T_Children children_ ) (T_Rules rules_ ) (T_TypeSigs typeSigs_ )  =
+    (T_Production (\ _lhsIallnts
+                     _lhsIaroundMap
+                     _lhsIcVisitsMap
+                     _lhsIinh
+                     _lhsImanualAttrDepMap
+                     _lhsImergeMap
+                     _lhsInt
+                     _lhsIo_case
+                     _lhsIo_cata
+                     _lhsIo_dovisit
+                     _lhsIo_newtypes
+                     _lhsIo_rename
+                     _lhsIo_sem
+                     _lhsIo_sig
+                     _lhsIo_unbox
+                     _lhsIo_wantvisit
+                     _lhsIprefix
+                     _lhsIsyn
+                     _lhsIvcount ->
+                       (let _childrenOcon :: Identifier
+                            _rulesOcon :: Identifier
+                            _rulesOchildNts :: (Map Identifier NontermIdent)
+                            _rulesOchildInhs :: (Map Identifier Attributes)
+                            _lhsOrules :: (Seq (Vertex,CRule))
+                            _lhsOvcount :: Int
+                            _lhsOadditionalDep :: (Seq Edge)
+                            _rulesOsynsOfChildren :: (Map Identifier Attributes)
+                            _rulesOinhsOfChildren :: (Map Identifier Attributes)
+                            _lhsOmergeDep :: (Seq Edge)
+                            _lhsOaroundDep :: (Seq Edge)
+                            _lhsOcons :: ([ConstructorIdent])
+                            _typeSigsOtypeSigs :: (Map Identifier Type)
+                            _rulesOallTypeSigs :: (Map Identifier Type)
+                            _lhsOcProduction :: CProduction
+                            _lhsOdirectDep :: (Seq Edge)
+                            _lhsOerrors :: (Seq Error)
+                            _lhsOinstDep :: (Seq Edge)
+                            _lhsOnAutoRules :: Int
+                            _lhsOnExplicitRules :: Int
+                            _childrenOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                            _childrenOallnts :: ([Identifier])
+                            _childrenOattrs :: ([(Identifier,Identifier)])
+                            _childrenOinh :: Attributes
+                            _childrenOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                            _childrenOnt :: Identifier
+                            _childrenOo_unbox :: Bool
+                            _childrenOsyn :: Attributes
+                            _rulesOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                            _rulesOallnts :: ([Identifier])
+                            _rulesOaltAttrs :: (Map AltAttr Vertex)
+                            _rulesOattrs :: ([(Identifier,Identifier)])
+                            _rulesOinh :: Attributes
+                            _rulesOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                            _rulesOnt :: Identifier
+                            _rulesOo_case :: Bool
+                            _rulesOo_cata :: Bool
+                            _rulesOo_dovisit :: Bool
+                            _rulesOo_newtypes :: Bool
+                            _rulesOo_rename :: Bool
+                            _rulesOo_sem :: Bool
+                            _rulesOo_sig :: Bool
+                            _rulesOo_wantvisit :: Bool
+                            _rulesOprefix :: String
+                            _rulesOsyn :: Attributes
+                            _childrenIattributes :: ([(Identifier,Attributes,Attributes)])
+                            _childrenIcollectChildrenInhs :: (Map Identifier Attributes )
+                            _childrenIcollectChildrenSyns :: (Map Identifier Attributes )
+                            _childrenIerrors :: (Seq Error)
+                            _childrenIfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                            _childrenIgathAltAttrs :: ([AltAttr])
+                            _childrenIgathRules :: (Seq CRule)
+                            _childrenIinhs :: (Seq (Identifier,Attributes))
+                            _childrenInts :: (Seq (Identifier,NontermIdent))
+                            _childrenIsinglevisits :: ([CRule])
+                            _childrenIterminals :: ([Identifier])
+                            _rulesIdirectDep :: (Seq Edge)
+                            _rulesIerrors :: (Seq Error)
+                            _rulesIgathAltAttrs :: ([AltAttr])
+                            _rulesIgathRules :: (Seq CRule)
+                            _rulesIinstDep :: (Seq Edge)
+                            _rulesIinstVars :: ([Identifier])
+                            _rulesIlocVars :: ([Identifier])
+                            _rulesInAutoRules :: Int
+                            _rulesInExplicitRules :: Int
+                            _typeSigsItypeSigs :: (Map Identifier Type)
+                            -- "Order.ag"(line 93, column 16)
+                            _childrenOcon =
+                                ({-# LINE 93 "Order.ag" #-}
+                                 con_
+                                 {-# LINE 3457 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 95, column 16)
+                            _rulesOcon =
+                                ({-# LINE 95 "Order.ag" #-}
+                                 con_
+                                 {-# LINE 3463 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 172, column 18)
+                            _gathAltAttrs =
+                                ({-# LINE 172 "Order.ag" #-}
+                                 [ AltAttr _LHS inh True | inh <- Map.keys _lhsIinh ]
+                                  ++ _childrenIgathAltAttrs
+                                  ++ _rulesIgathAltAttrs
+                                 {-# LINE 3471 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 188, column 17)
+                            _altAttrs =
+                                ({-# LINE 188 "Order.ag" #-}
+                                 Map.fromList (zip _gathAltAttrs [_lhsIvcount..])
+                                 {-# LINE 3477 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 201, column 18)
+                            _rulesOchildNts =
+                                ({-# LINE 201 "Order.ag" #-}
+                                 Map.fromList (toList _childrenInts)
+                                 {-# LINE 3483 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 202, column 19)
+                            _rulesOchildInhs =
+                                ({-# LINE 202 "Order.ag" #-}
+                                 Map.fromList (toList _childrenIinhs)
+                                 {-# LINE 3489 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 208, column 18)
+                            _inhRules =
+                                ({-# LINE 208 "Order.ag" #-}
+                                 [ cRuleLhsInh inh _lhsInt con_ tp | (inh,tp) <- Map.assocs _lhsIinh ]
+                                 {-# LINE 3495 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 209, column 19)
+                            _gathRules =
+                                ({-# LINE 209 "Order.ag" #-}
+                                 _inhRules ++ toList (_childrenIgathRules Seq.>< _rulesIgathRules)
+                                 {-# LINE 3501 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 263, column 18)
+                            _lhsOrules =
+                                ({-# LINE 263 "Order.ag" #-}
+                                 Seq.fromList (zip [_lhsIvcount..] _gathRules)
+                                 {-# LINE 3507 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 264, column 19)
+                            _lhsOvcount =
+                                ({-# LINE 264 "Order.ag" #-}
+                                 _lhsIvcount + length _gathRules
+                                 {-# LINE 3513 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 291, column 7)
+                            _manualDeps =
+                                ({-# LINE 291 "Order.ag" #-}
+                                 Set.toList $ Map.findWithDefault Set.empty con_ $ Map.findWithDefault Map.empty _lhsInt _lhsImanualAttrDepMap
+                                 {-# LINE 3519 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 294, column 7)
+                            _lhsOadditionalDep =
+                                ({-# LINE 294 "Order.ag" #-}
+                                 Seq.fromList [ (vertex True occA, vertex False occB)
+                                              | Dependency occA occB <- _manualDeps
+                                              , let vertex inout (OccAttr child nm)
+                                                      | child == _LOC = findWithErr2 (AltAttr _LOC nm True) _altAttrs
+                                                      | otherwise     = findWithErr2 (AltAttr child nm inout) _altAttrs
+                                                    vertex _ (OccRule nm)
+                                                      = findWithErr2 (AltAttr _LOC (Ident ("_rule_" ++ show nm) (getPos nm)) True) _altAttrs
+                                              ]
+                                 {-# LINE 3532 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 341, column 17)
+                            _rulesOsynsOfChildren =
+                                ({-# LINE 341 "Order.ag" #-}
+                                 _childrenIcollectChildrenSyns
+                                 {-# LINE 3538 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 342, column 17)
+                            _rulesOinhsOfChildren =
+                                ({-# LINE 342 "Order.ag" #-}
+                                 _childrenIcollectChildrenInhs
+                                 {-# LINE 3544 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 360, column 32)
+                            _mergeMap =
+                                ({-# LINE 360 "Order.ag" #-}
+                                 Map.findWithDefault Map.empty con_ _lhsImergeMap
+                                 {-# LINE 3550 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 371, column 7)
+                            _lhsOmergeDep =
+                                ({-# LINE 371 "Order.ag" #-}
+                                 _mergeDep1     Seq.>< _mergeDep2
+                                 {-# LINE 3556 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 372, column 7)
+                            _mergeDep1 =
+                                ({-# LINE 372 "Order.ag" #-}
+                                 Seq.fromList $
+                                    [ (childVert, synVert)
+                                    | childNm <- Map.keys _mergeMap
+                                    , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
+                                    , let childNm' = Ident (show childNm ++ "_merge") (getPos childNm)
+                                          childAttr = AltAttr _LOC childNm' True
+                                          synAttr  = AltAttr childNm synNm True
+                                          childVert = findWithErr2 childAttr _altAttrs
+                                          synVert  = findWithErr2 synAttr _altAttrs
+                                    ]
+                                 {-# LINE 3571 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 383, column 7)
+                            _mergeDep2 =
+                                ({-# LINE 383 "Order.ag" #-}
+                                 Seq.fromList $
+                                    [ (mergedVert, sourceVert)
+                                    | (childNm, (_,cs)) <- Map.assocs _mergeMap
+                                    , c <- cs
+                                    , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
+                                    , let sourceAttr = AltAttr childNm synNm True
+                                          mergedAttr = AltAttr c synNm True
+                                          sourceVert = findWithErr2 sourceAttr _altAttrs
+                                          mergedVert = findWithErr2 mergedAttr _altAttrs
+                                    ]
+                                 {-# LINE 3586 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 413, column 32)
+                            _aroundMap =
+                                ({-# LINE 413 "Order.ag" #-}
+                                 Map.findWithDefault Map.empty con_ _lhsIaroundMap
+                                 {-# LINE 3592 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 420, column 6)
+                            _aroundDep1 =
+                                ({-# LINE 420 "Order.ag" #-}
+                                 Seq.fromList $
+                                   [ (childVert, synVert)
+                                   | childNm <- Map.keys _aroundMap
+                                   , synNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenSyns)
+                                   , let childNm' = Ident (show childNm ++ "_around") (getPos childNm)
+                                         childAttr = AltAttr _LOC childNm' True
+                                         synAttr  = AltAttr childNm synNm True
+                                         childVert = findWithErr2 childAttr _altAttrs
+                                         synVert  = findWithErr2 synAttr _altAttrs
+                                   ]
+                                 {-# LINE 3607 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 431, column 6)
+                            _aroundDep2 =
+                                ({-# LINE 431 "Order.ag" #-}
+                                 Seq.fromList $
+                                   [ (childVert, inhVert)
+                                   | childNm <- Map.keys _aroundMap
+                                   , inhNm <- Map.keys (findWithErr2 childNm _childrenIcollectChildrenInhs)
+                                   , let childNm'  = Ident (show childNm ++ "_around") (getPos childNm)
+                                         childAttr = AltAttr _LOC childNm' True
+                                         inhAttr   = AltAttr childNm inhNm False
+                                         childVert = findWithErr2 childAttr _altAttrs
+                                         inhVert   = findWithErr2 inhAttr _altAttrs
+                                   ]
+                                 {-# LINE 3622 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 442, column 6)
+                            _lhsOaroundDep =
+                                ({-# LINE 442 "Order.ag" #-}
+                                 _aroundDep1     Seq.>< _aroundDep2
+                                 {-# LINE 3628 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 524, column 18)
+                            _lhsOcons =
+                                ({-# LINE 524 "Order.ag" #-}
+                                 [con_]
+                                 {-# LINE 3634 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 531, column 16)
+                            _typeSigsOtypeSigs =
+                                ({-# LINE 531 "Order.ag" #-}
+                                 Map.empty
+                                 {-# LINE 3640 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 537, column 17)
+                            _rulesOallTypeSigs =
+                                ({-# LINE 537 "Order.ag" #-}
+                                 _typeSigsItypeSigs
+                                 {-# LINE 3646 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 605, column 17)
+                            _cVisits =
+                                ({-# LINE 605 "Order.ag" #-}
+                                 if  _lhsIo_dovisit
+                                      then let prodsVisitsMap = findWithErr1 "Production.cVisits.nt" _lhsInt _lhsIcVisitsMap
+                                               visits = findWithErr1 "Production.cVisits.con" con_ prodsVisitsMap
+                                            in visits
+                                      else  let  vss = nubBy eqCRuleDefines _gathRules ++ _childrenIsinglevisits
+                                            in  [CVisit _lhsIinh _lhsIsyn vss [] False]
+                                 {-# LINE 3657 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 631, column 18)
+                            _lhsOcProduction =
+                                ({-# LINE 631 "Order.ag" #-}
+                                 CProduction con_ _cVisits _childrenIfields _childrenIterminals
+                                 {-# LINE 3663 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 659, column 16)
+                            _allfields =
+                                ({-# LINE 659 "Order.ag" #-}
+                                 _childrenIfields
+                                 {-# LINE 3669 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 659, column 16)
+                            _attrs =
+                                ({-# LINE 660 "Order.ag" #-}
+                                 map ((,) _LOC)  _rulesIlocVars ++
+                                 map ((,) _INST) _rulesIinstVars ++
+                                 map ((,) _LHS)  _inhnames ++
+                                 concat [map ((,) nm) (Map.keys as) | (nm,_,as) <- _childrenIattributes]
+                                 {-# LINE 3678 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 659, column 16)
+                            _inhnames =
+                                ({-# LINE 664 "Order.ag" #-}
+                                 Map.keys _lhsIinh
+                                 {-# LINE 3684 "Order.hs" #-}
+                                 )
+                            -- "Order.ag"(line 659, column 16)
+                            _synnames =
+                                ({-# LINE 665 "Order.ag" #-}
+                                 Map.keys _lhsIsyn
+                                 {-# LINE 3690 "Order.hs" #-}
+                                 )
+                            -- use rule "Order.ag"(line 269, column 33)
+                            _lhsOdirectDep =
+                                ({-# LINE 269 "Order.ag" #-}
+                                 _rulesIdirectDep
+                                 {-# LINE 3696 "Order.hs" #-}
+                                 )
+                            -- use rule "Order.ag"(line 84, column 70)
+                            _lhsOerrors =
+                                ({-# LINE 84 "Order.ag" #-}
+                                 _childrenIerrors Seq.>< _rulesIerrors
+                                 {-# LINE 3702 "Order.hs" #-}
+                                 )
+                            -- use rule "Order.ag"(line 312, column 31)
+                            _lhsOinstDep =
+                                ({-# LINE 312 "Order.ag" #-}
+                                 _rulesIinstDep
+                                 {-# LINE 3708 "Order.hs" #-}
+                                 )
+                            -- use rule "Order.ag"(line 61, column 105)
+                            _lhsOnAutoRules =
+                                ({-# LINE 61 "Order.ag" #-}
+                                 _rulesInAutoRules
+                                 {-# LINE 3714 "Order.hs" #-}
+                                 )
+                            -- use rule "Order.ag"(line 61, column 105)
+                            _lhsOnExplicitRules =
+                                ({-# LINE 61 "Order.ag" #-}
+                                 _rulesInExplicitRules
+                                 {-# LINE 3720 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _childrenOallfields =
+                                ({-# LINE 656 "Order.ag" #-}
+                                 _allfields
+                                 {-# LINE 3726 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _childrenOallnts =
+                                ({-# LINE 649 "Order.ag" #-}
+                                 _lhsIallnts
+                                 {-# LINE 3732 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _childrenOattrs =
+                                ({-# LINE 656 "Order.ag" #-}
+                                 _attrs
+                                 {-# LINE 3738 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _childrenOinh =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsIinh
+                                 {-# LINE 3744 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _childrenOmergeMap =
+                                ({-# LINE 362 "Order.ag" #-}
+                                 _mergeMap
+                                 {-# LINE 3750 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _childrenOnt =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsInt
+                                 {-# LINE 3756 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _childrenOo_unbox =
+                                ({-# LINE 119 "Order.ag" #-}
+                                 _lhsIo_unbox
+                                 {-# LINE 3762 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _childrenOsyn =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsIsyn
+                                 {-# LINE 3768 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _rulesOallfields =
+                                ({-# LINE 656 "Order.ag" #-}
+                                 _allfields
+                                 {-# LINE 3774 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOallnts =
+                                ({-# LINE 649 "Order.ag" #-}
+                                 _lhsIallnts
+                                 {-# LINE 3780 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _rulesOaltAttrs =
+                                ({-# LINE 186 "Order.ag" #-}
+                                 _altAttrs
+                                 {-# LINE 3786 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _rulesOattrs =
+                                ({-# LINE 656 "Order.ag" #-}
+                                 _attrs
+                                 {-# LINE 3792 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOinh =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsIinh
+                                 {-# LINE 3798 "Order.hs" #-}
+                                 )
+                            -- copy rule (from local)
+                            _rulesOmergeMap =
+                                ({-# LINE 362 "Order.ag" #-}
+                                 _mergeMap
+                                 {-# LINE 3804 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOnt =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsInt
+                                 {-# LINE 3810 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_case =
+                                ({-# LINE 117 "Order.ag" #-}
+                                 _lhsIo_case
+                                 {-# LINE 3816 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_cata =
+                                ({-# LINE 111 "Order.ag" #-}
+                                 _lhsIo_cata
+                                 {-# LINE 3822 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_dovisit =
+                                ({-# LINE 116 "Order.ag" #-}
+                                 _lhsIo_dovisit
+                                 {-# LINE 3828 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_newtypes =
+                                ({-# LINE 110 "Order.ag" #-}
+                                 _lhsIo_newtypes
+                                 {-# LINE 3834 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_rename =
+                                ({-# LINE 114 "Order.ag" #-}
+                                 _lhsIo_rename
+                                 {-# LINE 3840 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_sem =
+                                ({-# LINE 113 "Order.ag" #-}
+                                 _lhsIo_sem
+                                 {-# LINE 3846 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_sig =
+                                ({-# LINE 112 "Order.ag" #-}
+                                 _lhsIo_sig
+                                 {-# LINE 3852 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOo_wantvisit =
+                                ({-# LINE 115 "Order.ag" #-}
+                                 _lhsIo_wantvisit
+                                 {-# LINE 3858 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOprefix =
+                                ({-# LINE 118 "Order.ag" #-}
+                                 _lhsIprefix
+                                 {-# LINE 3864 "Order.hs" #-}
+                                 )
+                            -- copy rule (down)
+                            _rulesOsyn =
+                                ({-# LINE 89 "Order.ag" #-}
+                                 _lhsIsyn
+                                 {-# LINE 3870 "Order.hs" #-}
+                                 )
+                            ( _childrenIattributes,_childrenIcollectChildrenInhs,_childrenIcollectChildrenSyns,_childrenIerrors,_childrenIfields,_childrenIgathAltAttrs,_childrenIgathRules,_childrenIinhs,_childrenInts,_childrenIsinglevisits,_childrenIterminals) =
+                                children_ _childrenOallfields _childrenOallnts _childrenOattrs _childrenOcon _childrenOinh _childrenOmergeMap _childrenOnt _childrenOo_unbox _childrenOsyn 
+                            ( _rulesIdirectDep,_rulesIerrors,_rulesIgathAltAttrs,_rulesIgathRules,_rulesIinstDep,_rulesIinstVars,_rulesIlocVars,_rulesInAutoRules,_rulesInExplicitRules) =
+                                rules_ _rulesOallTypeSigs _rulesOallfields _rulesOallnts _rulesOaltAttrs _rulesOattrs _rulesOchildInhs _rulesOchildNts _rulesOcon _rulesOinh _rulesOinhsOfChildren _rulesOmergeMap _rulesOnt _rulesOo_case _rulesOo_cata _rulesOo_dovisit _rulesOo_newtypes _rulesOo_rename _rulesOo_sem _rulesOo_sig _rulesOo_wantvisit _rulesOprefix _rulesOsyn _rulesOsynsOfChildren 
+                            ( _typeSigsItypeSigs) =
+                                typeSigs_ _typeSigsOtypeSigs 
+                        in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProduction,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
+-- Productions -------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allnts               : [Identifier]
+         aroundMap            : Map ConstructorIdent (Map Identifier [Expression])
+         cVisitsMap           : CVisitsMap
+         inh                  : Attributes
+         manualAttrDepMap     : AttrOrderMap
+         mergeMap             : Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))
+         nt                   : Identifier
+         o_case               : Bool
+         o_cata               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_unbox              : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+         syn                  : Attributes
+      chained attribute:
+         vcount               : Int
+      synthesized attributes:
+         additionalDep        : Seq Edge
+         aroundDep            : Seq Edge
+         cProductions         : CProductions
+         cons                 : [ConstructorIdent]
+         directDep            : Seq Edge
+         errors               : Seq Error
+         instDep              : Seq Edge
+         mergeDep             : Seq Edge
+         nAutoRules           : Int
+         nExplicitRules       : Int
+         rules                : Seq (Vertex,CRule)
+   alternatives:
+      alternative Cons:
+         child hd             : Production 
+         child tl             : Productions 
+      alternative Nil:
+-}
+-- cata
+sem_Productions :: Productions  ->
+                   T_Productions 
+sem_Productions list  =
+    (Prelude.foldr sem_Productions_Cons sem_Productions_Nil (Prelude.map sem_Production list) )
+-- semantic domain
+newtype T_Productions  = T_Productions (([Identifier]) ->
+                                        (Map ConstructorIdent (Map Identifier [Expression])) ->
+                                        CVisitsMap ->
+                                        Attributes ->
+                                        AttrOrderMap ->
+                                        (Map ConstructorIdent (Map Identifier (Identifier,[Identifier]))) ->
+                                        Identifier ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        Bool ->
+                                        String ->
+                                        Attributes ->
+                                        Int ->
+                                        ( (Seq Edge),(Seq Edge),CProductions,([ConstructorIdent]),(Seq Edge),(Seq Error),(Seq Edge),(Seq Edge),Int,Int,(Seq (Vertex,CRule)),Int))
+data Inh_Productions  = Inh_Productions {allnts_Inh_Productions :: !(([Identifier])),aroundMap_Inh_Productions :: !((Map ConstructorIdent (Map Identifier [Expression]))),cVisitsMap_Inh_Productions :: !(CVisitsMap),inh_Inh_Productions :: !(Attributes),manualAttrDepMap_Inh_Productions :: !(AttrOrderMap),mergeMap_Inh_Productions :: !((Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))),nt_Inh_Productions :: !(Identifier),o_case_Inh_Productions :: !(Bool),o_cata_Inh_Productions :: !(Bool),o_dovisit_Inh_Productions :: !(Bool),o_newtypes_Inh_Productions :: !(Bool),o_rename_Inh_Productions :: !(Bool),o_sem_Inh_Productions :: !(Bool),o_sig_Inh_Productions :: !(Bool),o_unbox_Inh_Productions :: !(Bool),o_wantvisit_Inh_Productions :: !(Bool),prefix_Inh_Productions :: !(String),syn_Inh_Productions :: !(Attributes),vcount_Inh_Productions :: !(Int)}
+data Syn_Productions  = Syn_Productions {additionalDep_Syn_Productions :: !((Seq Edge)),aroundDep_Syn_Productions :: !((Seq Edge)),cProductions_Syn_Productions :: !(CProductions),cons_Syn_Productions :: !(([ConstructorIdent])),directDep_Syn_Productions :: !((Seq Edge)),errors_Syn_Productions :: !((Seq Error)),instDep_Syn_Productions :: !((Seq Edge)),mergeDep_Syn_Productions :: !((Seq Edge)),nAutoRules_Syn_Productions :: !(Int),nExplicitRules_Syn_Productions :: !(Int),rules_Syn_Productions :: !((Seq (Vertex,CRule))),vcount_Syn_Productions :: !(Int)}
+wrap_Productions :: T_Productions  ->
+                    Inh_Productions  ->
+                    Syn_Productions 
+wrap_Productions (T_Productions sem ) (Inh_Productions _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount )  =
+    (let ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount) = sem _lhsIallnts _lhsIaroundMap _lhsIcVisitsMap _lhsIinh _lhsImanualAttrDepMap _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_unbox _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIvcount 
+     in  (Syn_Productions _lhsOadditionalDep _lhsOaroundDep _lhsOcProductions _lhsOcons _lhsOdirectDep _lhsOerrors _lhsOinstDep _lhsOmergeDep _lhsOnAutoRules _lhsOnExplicitRules _lhsOrules _lhsOvcount ))
+sem_Productions_Cons :: T_Production  ->
+                        T_Productions  ->
+                        T_Productions 
+sem_Productions_Cons (T_Production hd_ ) (T_Productions tl_ )  =
+    (T_Productions (\ _lhsIallnts
+                      _lhsIaroundMap
+                      _lhsIcVisitsMap
+                      _lhsIinh
+                      _lhsImanualAttrDepMap
+                      _lhsImergeMap
+                      _lhsInt
+                      _lhsIo_case
+                      _lhsIo_cata
+                      _lhsIo_dovisit
+                      _lhsIo_newtypes
+                      _lhsIo_rename
+                      _lhsIo_sem
+                      _lhsIo_sig
+                      _lhsIo_unbox
+                      _lhsIo_wantvisit
+                      _lhsIprefix
+                      _lhsIsyn
+                      _lhsIvcount ->
+                        (let _lhsOcProductions :: CProductions
+                             _lhsOadditionalDep :: (Seq Edge)
+                             _lhsOaroundDep :: (Seq Edge)
+                             _lhsOcons :: ([ConstructorIdent])
+                             _lhsOdirectDep :: (Seq Edge)
+                             _lhsOerrors :: (Seq Error)
+                             _lhsOinstDep :: (Seq Edge)
+                             _lhsOmergeDep :: (Seq Edge)
+                             _lhsOnAutoRules :: Int
+                             _lhsOnExplicitRules :: Int
+                             _lhsOrules :: (Seq (Vertex,CRule))
+                             _lhsOvcount :: Int
+                             _hdOallnts :: ([Identifier])
+                             _hdOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
+                             _hdOcVisitsMap :: CVisitsMap
+                             _hdOinh :: Attributes
+                             _hdOmanualAttrDepMap :: AttrOrderMap
+                             _hdOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
+                             _hdOnt :: Identifier
+                             _hdOo_case :: Bool
+                             _hdOo_cata :: Bool
+                             _hdOo_dovisit :: Bool
+                             _hdOo_newtypes :: Bool
+                             _hdOo_rename :: Bool
+                             _hdOo_sem :: Bool
+                             _hdOo_sig :: Bool
+                             _hdOo_unbox :: Bool
+                             _hdOo_wantvisit :: Bool
+                             _hdOprefix :: String
+                             _hdOsyn :: Attributes
+                             _hdOvcount :: Int
+                             _tlOallnts :: ([Identifier])
+                             _tlOaroundMap :: (Map ConstructorIdent (Map Identifier [Expression]))
+                             _tlOcVisitsMap :: CVisitsMap
+                             _tlOinh :: Attributes
+                             _tlOmanualAttrDepMap :: AttrOrderMap
+                             _tlOmergeMap :: (Map ConstructorIdent (Map Identifier (Identifier,[Identifier])))
+                             _tlOnt :: Identifier
+                             _tlOo_case :: Bool
+                             _tlOo_cata :: Bool
+                             _tlOo_dovisit :: Bool
+                             _tlOo_newtypes :: Bool
+                             _tlOo_rename :: Bool
+                             _tlOo_sem :: Bool
+                             _tlOo_sig :: Bool
+                             _tlOo_unbox :: Bool
+                             _tlOo_wantvisit :: Bool
+                             _tlOprefix :: String
+                             _tlOsyn :: Attributes
+                             _tlOvcount :: Int
+                             _hdIadditionalDep :: (Seq Edge)
+                             _hdIaroundDep :: (Seq Edge)
+                             _hdIcProduction :: CProduction
+                             _hdIcons :: ([ConstructorIdent])
+                             _hdIdirectDep :: (Seq Edge)
+                             _hdIerrors :: (Seq Error)
+                             _hdIinstDep :: (Seq Edge)
+                             _hdImergeDep :: (Seq Edge)
+                             _hdInAutoRules :: Int
+                             _hdInExplicitRules :: Int
+                             _hdIrules :: (Seq (Vertex,CRule))
+                             _hdIvcount :: Int
+                             _tlIadditionalDep :: (Seq Edge)
+                             _tlIaroundDep :: (Seq Edge)
+                             _tlIcProductions :: CProductions
+                             _tlIcons :: ([ConstructorIdent])
+                             _tlIdirectDep :: (Seq Edge)
+                             _tlIerrors :: (Seq Error)
+                             _tlIinstDep :: (Seq Edge)
+                             _tlImergeDep :: (Seq Edge)
+                             _tlInAutoRules :: Int
+                             _tlInExplicitRules :: Int
+                             _tlIrules :: (Seq (Vertex,CRule))
+                             _tlIvcount :: Int
+                             -- "Order.ag"(line 628, column 12)
+                             _lhsOcProductions =
+                                 ({-# LINE 628 "Order.ag" #-}
+                                  _hdIcProduction : _tlIcProductions
+                                  {-# LINE 4056 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 283, column 60)
+                             _lhsOadditionalDep =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  _hdIadditionalDep Seq.>< _tlIadditionalDep
+                                  {-# LINE 4062 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 404, column 24)
+                             _lhsOaroundDep =
+                                 ({-# LINE 404 "Order.ag" #-}
+                                  _hdIaroundDep Seq.>< _tlIaroundDep
+                                  {-# LINE 4068 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 522, column 40)
+                             _lhsOcons =
+                                 ({-# LINE 522 "Order.ag" #-}
+                                  _hdIcons ++ _tlIcons
+                                  {-# LINE 4074 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 269, column 33)
+                             _lhsOdirectDep =
+                                 ({-# LINE 269 "Order.ag" #-}
+                                  _hdIdirectDep Seq.>< _tlIdirectDep
+                                  {-# LINE 4080 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 84, column 70)
+                             _lhsOerrors =
+                                 ({-# LINE 84 "Order.ag" #-}
+                                  _hdIerrors Seq.>< _tlIerrors
+                                  {-# LINE 4086 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 312, column 31)
+                             _lhsOinstDep =
+                                 ({-# LINE 312 "Order.ag" #-}
+                                  _hdIinstDep Seq.>< _tlIinstDep
+                                  {-# LINE 4092 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 367, column 18)
+                             _lhsOmergeDep =
+                                 ({-# LINE 367 "Order.ag" #-}
+                                  _hdImergeDep Seq.>< _tlImergeDep
+                                  {-# LINE 4098 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnAutoRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  _hdInAutoRules + _tlInAutoRules
+                                  {-# LINE 4104 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnExplicitRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  _hdInExplicitRules + _tlInExplicitRules
+                                  {-# LINE 4110 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 259, column 18)
+                             _lhsOrules =
+                                 ({-# LINE 259 "Order.ag" #-}
+                                  _hdIrules Seq.>< _tlIrules
+                                  {-# LINE 4116 "Order.hs" #-}
+                                  )
+                             -- copy rule (up)
+                             _lhsOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _tlIvcount
+                                  {-# LINE 4122 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOallnts =
+                                 ({-# LINE 649 "Order.ag" #-}
+                                  _lhsIallnts
+                                  {-# LINE 4128 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOaroundMap =
+                                 ({-# LINE 410 "Order.ag" #-}
+                                  _lhsIaroundMap
+                                  {-# LINE 4134 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOcVisitsMap =
+                                 ({-# LINE 603 "Order.ag" #-}
+                                  _lhsIcVisitsMap
+                                  {-# LINE 4140 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOinh =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsIinh
+                                  {-# LINE 4146 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOmanualAttrDepMap =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  _lhsImanualAttrDepMap
+                                  {-# LINE 4152 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOmergeMap =
+                                 ({-# LINE 357 "Order.ag" #-}
+                                  _lhsImergeMap
+                                  {-# LINE 4158 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOnt =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsInt
+                                  {-# LINE 4164 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_case =
+                                 ({-# LINE 117 "Order.ag" #-}
+                                  _lhsIo_case
+                                  {-# LINE 4170 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_cata =
+                                 ({-# LINE 111 "Order.ag" #-}
+                                  _lhsIo_cata
+                                  {-# LINE 4176 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_dovisit =
+                                 ({-# LINE 116 "Order.ag" #-}
+                                  _lhsIo_dovisit
+                                  {-# LINE 4182 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_newtypes =
+                                 ({-# LINE 110 "Order.ag" #-}
+                                  _lhsIo_newtypes
+                                  {-# LINE 4188 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_rename =
+                                 ({-# LINE 114 "Order.ag" #-}
+                                  _lhsIo_rename
+                                  {-# LINE 4194 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_sem =
+                                 ({-# LINE 113 "Order.ag" #-}
+                                  _lhsIo_sem
+                                  {-# LINE 4200 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_sig =
+                                 ({-# LINE 112 "Order.ag" #-}
+                                  _lhsIo_sig
+                                  {-# LINE 4206 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_unbox =
+                                 ({-# LINE 119 "Order.ag" #-}
+                                  _lhsIo_unbox
+                                  {-# LINE 4212 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOo_wantvisit =
+                                 ({-# LINE 115 "Order.ag" #-}
+                                  _lhsIo_wantvisit
+                                  {-# LINE 4218 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOprefix =
+                                 ({-# LINE 118 "Order.ag" #-}
+                                  _lhsIprefix
+                                  {-# LINE 4224 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOsyn =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsIsyn
+                                  {-# LINE 4230 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _hdOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _lhsIvcount
+                                  {-# LINE 4236 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOallnts =
+                                 ({-# LINE 649 "Order.ag" #-}
+                                  _lhsIallnts
+                                  {-# LINE 4242 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOaroundMap =
+                                 ({-# LINE 410 "Order.ag" #-}
+                                  _lhsIaroundMap
+                                  {-# LINE 4248 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOcVisitsMap =
+                                 ({-# LINE 603 "Order.ag" #-}
+                                  _lhsIcVisitsMap
+                                  {-# LINE 4254 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOinh =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsIinh
+                                  {-# LINE 4260 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOmanualAttrDepMap =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  _lhsImanualAttrDepMap
+                                  {-# LINE 4266 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOmergeMap =
+                                 ({-# LINE 357 "Order.ag" #-}
+                                  _lhsImergeMap
+                                  {-# LINE 4272 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOnt =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsInt
+                                  {-# LINE 4278 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_case =
+                                 ({-# LINE 117 "Order.ag" #-}
+                                  _lhsIo_case
+                                  {-# LINE 4284 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_cata =
+                                 ({-# LINE 111 "Order.ag" #-}
+                                  _lhsIo_cata
+                                  {-# LINE 4290 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_dovisit =
+                                 ({-# LINE 116 "Order.ag" #-}
+                                  _lhsIo_dovisit
+                                  {-# LINE 4296 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_newtypes =
+                                 ({-# LINE 110 "Order.ag" #-}
+                                  _lhsIo_newtypes
+                                  {-# LINE 4302 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_rename =
+                                 ({-# LINE 114 "Order.ag" #-}
+                                  _lhsIo_rename
+                                  {-# LINE 4308 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_sem =
+                                 ({-# LINE 113 "Order.ag" #-}
+                                  _lhsIo_sem
+                                  {-# LINE 4314 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_sig =
+                                 ({-# LINE 112 "Order.ag" #-}
+                                  _lhsIo_sig
+                                  {-# LINE 4320 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_unbox =
+                                 ({-# LINE 119 "Order.ag" #-}
+                                  _lhsIo_unbox
+                                  {-# LINE 4326 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOo_wantvisit =
+                                 ({-# LINE 115 "Order.ag" #-}
+                                  _lhsIo_wantvisit
+                                  {-# LINE 4332 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOprefix =
+                                 ({-# LINE 118 "Order.ag" #-}
+                                  _lhsIprefix
+                                  {-# LINE 4338 "Order.hs" #-}
+                                  )
+                             -- copy rule (down)
+                             _tlOsyn =
+                                 ({-# LINE 89 "Order.ag" #-}
+                                  _lhsIsyn
+                                  {-# LINE 4344 "Order.hs" #-}
+                                  )
+                             -- copy rule (chain)
+                             _tlOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _hdIvcount
+                                  {-# LINE 4350 "Order.hs" #-}
+                                  )
+                             ( _hdIadditionalDep,_hdIaroundDep,_hdIcProduction,_hdIcons,_hdIdirectDep,_hdIerrors,_hdIinstDep,_hdImergeDep,_hdInAutoRules,_hdInExplicitRules,_hdIrules,_hdIvcount) =
+                                 hd_ _hdOallnts _hdOaroundMap _hdOcVisitsMap _hdOinh _hdOmanualAttrDepMap _hdOmergeMap _hdOnt _hdOo_case _hdOo_cata _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_unbox _hdOo_wantvisit _hdOprefix _hdOsyn _hdOvcount 
+                             ( _tlIadditionalDep,_tlIaroundDep,_tlIcProductions,_tlIcons,_tlIdirectDep,_tlIerrors,_tlIinstDep,_tlImergeDep,_tlInAutoRules,_tlInExplicitRules,_tlIrules,_tlIvcount) =
+                                 tl_ _tlOallnts _tlOaroundMap _tlOcVisitsMap _tlOinh _tlOmanualAttrDepMap _tlOmergeMap _tlOnt _tlOo_case _tlOo_cata _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_unbox _tlOo_wantvisit _tlOprefix _tlOsyn _tlOvcount 
+                         in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
+sem_Productions_Nil :: T_Productions 
+sem_Productions_Nil  =
+    (T_Productions (\ _lhsIallnts
+                      _lhsIaroundMap
+                      _lhsIcVisitsMap
+                      _lhsIinh
+                      _lhsImanualAttrDepMap
+                      _lhsImergeMap
+                      _lhsInt
+                      _lhsIo_case
+                      _lhsIo_cata
+                      _lhsIo_dovisit
+                      _lhsIo_newtypes
+                      _lhsIo_rename
+                      _lhsIo_sem
+                      _lhsIo_sig
+                      _lhsIo_unbox
+                      _lhsIo_wantvisit
+                      _lhsIprefix
+                      _lhsIsyn
+                      _lhsIvcount ->
+                        (let _lhsOcProductions :: CProductions
+                             _lhsOadditionalDep :: (Seq Edge)
+                             _lhsOaroundDep :: (Seq Edge)
+                             _lhsOcons :: ([ConstructorIdent])
+                             _lhsOdirectDep :: (Seq Edge)
+                             _lhsOerrors :: (Seq Error)
+                             _lhsOinstDep :: (Seq Edge)
+                             _lhsOmergeDep :: (Seq Edge)
+                             _lhsOnAutoRules :: Int
+                             _lhsOnExplicitRules :: Int
+                             _lhsOrules :: (Seq (Vertex,CRule))
+                             _lhsOvcount :: Int
+                             -- "Order.ag"(line 629, column 12)
+                             _lhsOcProductions =
+                                 ({-# LINE 629 "Order.ag" #-}
+                                  []
+                                  {-# LINE 4394 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 283, column 60)
+                             _lhsOadditionalDep =
+                                 ({-# LINE 283 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4400 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 404, column 24)
+                             _lhsOaroundDep =
+                                 ({-# LINE 404 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4406 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 522, column 40)
+                             _lhsOcons =
+                                 ({-# LINE 522 "Order.ag" #-}
+                                  []
+                                  {-# LINE 4412 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 269, column 33)
+                             _lhsOdirectDep =
+                                 ({-# LINE 269 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4418 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 84, column 70)
+                             _lhsOerrors =
+                                 ({-# LINE 84 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4424 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 312, column 31)
+                             _lhsOinstDep =
+                                 ({-# LINE 312 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4430 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 367, column 18)
+                             _lhsOmergeDep =
+                                 ({-# LINE 367 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4436 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnAutoRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  0
+                                  {-# LINE 4442 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 61, column 105)
+                             _lhsOnExplicitRules =
+                                 ({-# LINE 61 "Order.ag" #-}
+                                  0
+                                  {-# LINE 4448 "Order.hs" #-}
+                                  )
+                             -- use rule "Order.ag"(line 259, column 18)
+                             _lhsOrules =
+                                 ({-# LINE 259 "Order.ag" #-}
+                                  Seq.empty
+                                  {-# LINE 4454 "Order.hs" #-}
+                                  )
+                             -- copy rule (chain)
+                             _lhsOvcount =
+                                 ({-# LINE 258 "Order.ag" #-}
+                                  _lhsIvcount
+                                  {-# LINE 4460 "Order.hs" #-}
+                                  )
+                         in  ( _lhsOadditionalDep,_lhsOaroundDep,_lhsOcProductions,_lhsOcons,_lhsOdirectDep,_lhsOerrors,_lhsOinstDep,_lhsOmergeDep,_lhsOnAutoRules,_lhsOnExplicitRules,_lhsOrules,_lhsOvcount))) )
+-- Rule --------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allTypeSigs          : Map Identifier Type
+         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
+         allnts               : [Identifier]
+         altAttrs             : Map AltAttr Vertex
+         attrs                : [(Identifier,Identifier)]
+         childInhs            : Map Identifier Attributes
+         childNts             : Map Identifier NontermIdent
+         con                  : Identifier
+         inh                  : Attributes
+         inhsOfChildren       : Map Identifier Attributes
+         mergeMap             : Map Identifier (Identifier,[Identifier])
+         nt                   : Identifier
+         o_case               : Bool
+         o_cata               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+         syn                  : Attributes
+         synsOfChildren       : Map Identifier Attributes
+      synthesized attributes:
+         directDep            : Seq Edge
+         errors               : Seq Error
+         gathAltAttrs         : [AltAttr]
+         gathRules            : Seq CRule
+         instDep              : Seq Edge
+         instVars             : [Identifier]
+         locVars              : [Identifier]
+         nAutoRules           : Int
+         nExplicitRules       : Int
+   alternatives:
+      alternative Rule:
+         child mbName         : {Maybe Identifier}
+         child pattern        : Pattern 
+         child rhs            : Expression 
+         child owrt           : {Bool}
+         child origin         : {String}
+         child explicit       : {Bool}
+         visit 0:
+            local defines     : _
+            local gathRules   : _
+            local instDep1    : _
+            local instDep2    : _
+-}
+-- cata
+sem_Rule :: Rule  ->
+            T_Rule 
+sem_Rule (Rule _mbName _pattern _rhs _owrt _origin _explicit )  =
+    (sem_Rule_Rule _mbName (sem_Pattern _pattern ) (sem_Expression _rhs ) _owrt _origin _explicit )
+-- semantic domain
+newtype T_Rule  = T_Rule ((Map Identifier Type) ->
+                          ([(Identifier,Type,Maybe (Maybe Type))]) ->
+                          ([Identifier]) ->
+                          (Map AltAttr Vertex) ->
+                          ([(Identifier,Identifier)]) ->
+                          (Map Identifier Attributes) ->
+                          (Map Identifier NontermIdent) ->
+                          Identifier ->
+                          Attributes ->
+                          (Map Identifier Attributes) ->
+                          (Map Identifier (Identifier,[Identifier])) ->
+                          Identifier ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          Bool ->
+                          String ->
+                          Attributes ->
+                          (Map Identifier Attributes) ->
+                          ( (Seq Edge),(Seq Error),([AltAttr]),(Seq CRule),(Seq Edge),([Identifier]),([Identifier]),Int,Int))
+data Inh_Rule  = Inh_Rule {allTypeSigs_Inh_Rule :: !((Map Identifier Type)),allfields_Inh_Rule :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Rule :: !(([Identifier])),altAttrs_Inh_Rule :: !((Map AltAttr Vertex)),attrs_Inh_Rule :: !(([(Identifier,Identifier)])),childInhs_Inh_Rule :: !((Map Identifier Attributes)),childNts_Inh_Rule :: !((Map Identifier NontermIdent)),con_Inh_Rule :: !(Identifier),inh_Inh_Rule :: !(Attributes),inhsOfChildren_Inh_Rule :: !((Map Identifier Attributes)),mergeMap_Inh_Rule :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Rule :: !(Identifier),o_case_Inh_Rule :: !(Bool),o_cata_Inh_Rule :: !(Bool),o_dovisit_Inh_Rule :: !(Bool),o_newtypes_Inh_Rule :: !(Bool),o_rename_Inh_Rule :: !(Bool),o_sem_Inh_Rule :: !(Bool),o_sig_Inh_Rule :: !(Bool),o_wantvisit_Inh_Rule :: !(Bool),prefix_Inh_Rule :: !(String),syn_Inh_Rule :: !(Attributes),synsOfChildren_Inh_Rule :: !((Map Identifier Attributes))}
+data Syn_Rule  = Syn_Rule {directDep_Syn_Rule :: !((Seq Edge)),errors_Syn_Rule :: !((Seq Error)),gathAltAttrs_Syn_Rule :: !(([AltAttr])),gathRules_Syn_Rule :: !((Seq CRule)),instDep_Syn_Rule :: !((Seq Edge)),instVars_Syn_Rule :: !(([Identifier])),locVars_Syn_Rule :: !(([Identifier])),nAutoRules_Syn_Rule :: !(Int),nExplicitRules_Syn_Rule :: !(Int)}
+wrap_Rule :: T_Rule  ->
+             Inh_Rule  ->
+             Syn_Rule 
+wrap_Rule (T_Rule sem ) (Inh_Rule _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren )  =
+    (let ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules) = sem _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren 
+     in  (Syn_Rule _lhsOdirectDep _lhsOerrors _lhsOgathAltAttrs _lhsOgathRules _lhsOinstDep _lhsOinstVars _lhsOlocVars _lhsOnAutoRules _lhsOnExplicitRules ))
+sem_Rule_Rule :: (Maybe Identifier) ->
+                 T_Pattern  ->
+                 T_Expression  ->
+                 Bool ->
+                 String ->
+                 Bool ->
+                 T_Rule 
+sem_Rule_Rule mbName_ (T_Pattern pattern_ ) (T_Expression rhs_ ) owrt_ origin_ explicit_  =
+    (T_Rule (\ _lhsIallTypeSigs
+               _lhsIallfields
+               _lhsIallnts
+               _lhsIaltAttrs
+               _lhsIattrs
+               _lhsIchildInhs
+               _lhsIchildNts
+               _lhsIcon
+               _lhsIinh
+               _lhsIinhsOfChildren
+               _lhsImergeMap
+               _lhsInt
+               _lhsIo_case
+               _lhsIo_cata
+               _lhsIo_dovisit
+               _lhsIo_newtypes
+               _lhsIo_rename
+               _lhsIo_sem
+               _lhsIo_sig
+               _lhsIo_wantvisit
+               _lhsIprefix
+               _lhsIsyn
+               _lhsIsynsOfChildren ->
+                 (let _lhsOnExplicitRules :: Int
+                      _lhsOnAutoRules :: Int
+                      _lhsOdirectDep :: (Seq Edge)
+                      _lhsOinstDep :: (Seq Edge)
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOgathAltAttrs :: ([AltAttr])
+                      _lhsOgathRules :: (Seq CRule)
+                      _lhsOinstVars :: ([Identifier])
+                      _lhsOlocVars :: ([Identifier])
+                      _patternOallTypeSigs :: (Map Identifier Type)
+                      _patternOaltAttrs :: (Map AltAttr Vertex)
+                      _patternOcon :: Identifier
+                      _patternOinh :: Attributes
+                      _patternOnt :: Identifier
+                      _patternOsyn :: Attributes
+                      _rhsOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                      _rhsOallnts :: ([Identifier])
+                      _rhsOattrs :: ([(Identifier,Identifier)])
+                      _rhsOcon :: Identifier
+                      _rhsOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                      _rhsOnt :: Identifier
+                      _patternIcopy :: Pattern 
+                      _patternIerrors :: (Seq Error)
+                      _patternIgathAltAttrs :: ([AltAttr])
+                      _patternIinstVars :: ([Identifier])
+                      _patternIlocVars :: ([Identifier])
+                      _patternIpatternAttrs :: ([(Identifier,Identifier,Bool,Patterns)])
+                      _rhsIallRhsVars :: (Set (Identifier,Identifier))
+                      _rhsIcopy :: Expression 
+                      _rhsIerrors :: (Seq Error)
+                      _rhsItextLines :: ([String])
+                      _rhsIusedAttrs :: ([(Identifier,Identifier)])
+                      _rhsIusedFields :: ([Identifier])
+                      _rhsIusedLocals :: ([Identifier])
+                      -- "Order.ag"(line 64, column 11)
+                      _lhsOnExplicitRules =
+                          ({-# LINE 64 "Order.ag" #-}
+                           if explicit_
+                           then 1
+                           else 0
+                           {-# LINE 4623 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 67, column 11)
+                      _lhsOnAutoRules =
+                          ({-# LINE 67 "Order.ag" #-}
+                           if startsWith "use rule" origin_ || startsWith "copy rule" origin_
+                           then 1
+                           else 0
+                           {-# LINE 4631 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 217, column 12)
+                      _defines =
+                          ({-# LINE 217 "Order.ag" #-}
+                           let  tp field attr parts | field == _LOC || field == _INST
+                                                                    = case parts of
+                                                                        [] -> Map.lookup attr _lhsIallTypeSigs
+                                                                        _  -> (sequence (map typ parts)) >>= (haskellTupel . map (substSelf _lhsInt))
+                                                    | field == _LHS = Map.lookup attr _lhsIsyn
+                                                    | otherwise     = Map.lookup attr (findWithErr1 "Rule.defines.tp" field _lhsIchildInhs)
+                                typ :: Pattern -> Maybe Type
+                                typ (Alias field attr _ parts) = tp field attr parts
+                                typ (Underscore _)             = Nothing
+                                typ _                          = Nothing
+                           in Map.fromList  [ (findWithErr1 "Rule.defines" aa _lhsIaltAttrs, (field,attr,(tp field attr parts)))
+                                            | (field,attr,isLocalOrInst,parts) <- _patternIpatternAttrs
+                                            , let aa = AltAttr field attr isLocalOrInst
+                                            ]
+                           {-# LINE 4650 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 233, column 12)
+                      _gathRules =
+                          ({-# LINE 233 "Order.ag" #-}
+                           let childnt field = Map.lookup field _lhsIchildNts
+                           in Seq.fromList [ CRule attr False True _lhsInt _lhsIcon field (childnt field) tp _patternIcopy _rhsItextLines _defines owrt_ origin_ _rhsIallRhsVars explicit_ mbName_
+                                           | (field,attr,tp) <- Map.elems _defines
+                                           ]
+                           {-# LINE 4659 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 271, column 12)
+                      _lhsOdirectDep =
+                          ({-# LINE 271 "Order.ag" #-}
+                           let  defined = Map.keys _defines
+                                used =  [ Map.lookup (AltAttr field attr True) _lhsIaltAttrs | (field,attr) <- _rhsIusedAttrs]
+                                        ++ [ Map.lookup (AltAttr _LOC attr True) _lhsIaltAttrs | attr <- _rhsIusedLocals ++ _rhsIusedFields ]
+                           in Seq.fromList [ (x,y) | Just x <- used, y <- defined ]
+                           {-# LINE 4668 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 315, column 6)
+                      _instDep1 =
+                          ({-# LINE 315 "Order.ag" #-}
+                           Seq.fromList $
+                             [ (instVert, synVert)
+                             | (field,instNm,_) <- Map.elems _defines
+                             , field == _INST
+                             , synNm <- Map.keys (findWithErr2 instNm _lhsIsynsOfChildren)
+                             , let instAttr = AltAttr _INST instNm True
+                                   synAttr  = AltAttr instNm synNm True
+                                   instVert = findWithErr2 instAttr _lhsIaltAttrs
+                                   synVert  = findWithErr2 synAttr _lhsIaltAttrs
+                             ]
+                           {-# LINE 4683 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 326, column 6)
+                      _instDep2 =
+                          ({-# LINE 326 "Order.ag" #-}
+                           Seq.fromList $
+                             [ (instVert, inhVert)
+                             | (field,instNm,_) <- Map.elems _defines
+                             , field == _INST
+                             , inhNm <- Map.keys (findWithErr2 instNm _lhsIinhsOfChildren)
+                             , let instAttr = AltAttr _INST instNm True
+                                   inhAttr  = AltAttr instNm inhNm False
+                                   instVert = findWithErr2 instAttr _lhsIaltAttrs
+                                   inhVert  = findWithErr2 inhAttr _lhsIaltAttrs
+                             ]
+                           {-# LINE 4698 "Order.hs" #-}
+                           )
+                      -- "Order.ag"(line 337, column 6)
+                      _lhsOinstDep =
+                          ({-# LINE 337 "Order.ag" #-}
+                           _instDep1     Seq.>< _instDep2
+                           {-# LINE 4704 "Order.hs" #-}
+                           )
+                      -- use rule "Order.ag"(line 84, column 70)
+                      _lhsOerrors =
+                          ({-# LINE 84 "Order.ag" #-}
+                           _patternIerrors Seq.>< _rhsIerrors
+                           {-# LINE 4710 "Order.hs" #-}
+                           )
+                      -- use rule "Order.ag"(line 170, column 68)
+                      _lhsOgathAltAttrs =
+                          ({-# LINE 170 "Order.ag" #-}
+                           _patternIgathAltAttrs
+                           {-# LINE 4716 "Order.hs" #-}
+                           )
+                      -- use rule "Order.ag"(line 206, column 23)
+                      _lhsOgathRules =
+                          ({-# LINE 206 "Order.ag" #-}
+                           _gathRules
+                           {-# LINE 4722 "Order.hs" #-}
+                           )
+                      -- use rule "Order.ag"(line 679, column 86)
+                      _lhsOinstVars =
+                          ({-# LINE 679 "Order.ag" #-}
+                           _patternIinstVars
+                           {-# LINE 4728 "Order.hs" #-}
+                           )
+                      -- use rule "Order.ag"(line 679, column 48)
+                      _lhsOlocVars =
+                          ({-# LINE 679 "Order.ag" #-}
+                           _patternIlocVars
+                           {-# LINE 4734 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOallTypeSigs =
+                          ({-# LINE 535 "Order.ag" #-}
+                           _lhsIallTypeSigs
+                           {-# LINE 4740 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOaltAttrs =
+                          ({-# LINE 186 "Order.ag" #-}
+                           _lhsIaltAttrs
+                           {-# LINE 4746 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOcon =
+                          ({-# LINE 90 "Order.ag" #-}
+                           _lhsIcon
+                           {-# LINE 4752 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOinh =
+                          ({-# LINE 89 "Order.ag" #-}
+                           _lhsIinh
+                           {-# LINE 4758 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOnt =
+                          ({-# LINE 89 "Order.ag" #-}
+                           _lhsInt
+                           {-# LINE 4764 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _patternOsyn =
+                          ({-# LINE 89 "Order.ag" #-}
+                           _lhsIsyn
+                           {-# LINE 4770 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOallfields =
+                          ({-# LINE 448 "Order.ag" #-}
+                           _lhsIallfields
+                           {-# LINE 4776 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOallnts =
+                          ({-# LINE 449 "Order.ag" #-}
+                           _lhsIallnts
+                           {-# LINE 4782 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOattrs =
+                          ({-# LINE 450 "Order.ag" #-}
+                           _lhsIattrs
+                           {-# LINE 4788 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOcon =
+                          ({-# LINE 447 "Order.ag" #-}
+                           _lhsIcon
+                           {-# LINE 4794 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOmergeMap =
+                          ({-# LINE 362 "Order.ag" #-}
+                           _lhsImergeMap
+                           {-# LINE 4800 "Order.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _rhsOnt =
+                          ({-# LINE 447 "Order.ag" #-}
+                           _lhsInt
+                           {-# LINE 4806 "Order.hs" #-}
+                           )
+                      ( _patternIcopy,_patternIerrors,_patternIgathAltAttrs,_patternIinstVars,_patternIlocVars,_patternIpatternAttrs) =
+                          pattern_ _patternOallTypeSigs _patternOaltAttrs _patternOcon _patternOinh _patternOnt _patternOsyn 
+                      ( _rhsIallRhsVars,_rhsIcopy,_rhsIerrors,_rhsItextLines,_rhsIusedAttrs,_rhsIusedFields,_rhsIusedLocals) =
+                          rhs_ _rhsOallfields _rhsOallnts _rhsOattrs _rhsOcon _rhsOmergeMap _rhsOnt 
+                  in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
+-- Rules -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allTypeSigs          : Map Identifier Type
+         allfields            : [(Identifier,Type,Maybe (Maybe Type))]
+         allnts               : [Identifier]
+         altAttrs             : Map AltAttr Vertex
+         attrs                : [(Identifier,Identifier)]
+         childInhs            : Map Identifier Attributes
+         childNts             : Map Identifier NontermIdent
+         con                  : Identifier
+         inh                  : Attributes
+         inhsOfChildren       : Map Identifier Attributes
+         mergeMap             : Map Identifier (Identifier,[Identifier])
+         nt                   : Identifier
+         o_case               : Bool
+         o_cata               : Bool
+         o_dovisit            : Bool
+         o_newtypes           : Bool
+         o_rename             : Bool
+         o_sem                : Bool
+         o_sig                : Bool
+         o_wantvisit          : Bool
+         prefix               : String
+         syn                  : Attributes
+         synsOfChildren       : Map Identifier Attributes
+      synthesized attributes:
+         directDep            : Seq Edge
+         errors               : Seq Error
+         gathAltAttrs         : [AltAttr]
+         gathRules            : Seq CRule
+         instDep              : Seq Edge
+         instVars             : [Identifier]
+         locVars              : [Identifier]
+         nAutoRules           : Int
+         nExplicitRules       : Int
+   alternatives:
+      alternative Cons:
+         child hd             : Rule 
+         child tl             : Rules 
+      alternative Nil:
+-}
+-- cata
+sem_Rules :: Rules  ->
+             T_Rules 
+sem_Rules list  =
+    (Prelude.foldr sem_Rules_Cons sem_Rules_Nil (Prelude.map sem_Rule list) )
+-- semantic domain
+newtype T_Rules  = T_Rules ((Map Identifier Type) ->
+                            ([(Identifier,Type,Maybe (Maybe Type))]) ->
+                            ([Identifier]) ->
+                            (Map AltAttr Vertex) ->
+                            ([(Identifier,Identifier)]) ->
+                            (Map Identifier Attributes) ->
+                            (Map Identifier NontermIdent) ->
+                            Identifier ->
+                            Attributes ->
+                            (Map Identifier Attributes) ->
+                            (Map Identifier (Identifier,[Identifier])) ->
+                            Identifier ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            Bool ->
+                            String ->
+                            Attributes ->
+                            (Map Identifier Attributes) ->
+                            ( (Seq Edge),(Seq Error),([AltAttr]),(Seq CRule),(Seq Edge),([Identifier]),([Identifier]),Int,Int))
+data Inh_Rules  = Inh_Rules {allTypeSigs_Inh_Rules :: !((Map Identifier Type)),allfields_Inh_Rules :: !(([(Identifier,Type,Maybe (Maybe Type))])),allnts_Inh_Rules :: !(([Identifier])),altAttrs_Inh_Rules :: !((Map AltAttr Vertex)),attrs_Inh_Rules :: !(([(Identifier,Identifier)])),childInhs_Inh_Rules :: !((Map Identifier Attributes)),childNts_Inh_Rules :: !((Map Identifier NontermIdent)),con_Inh_Rules :: !(Identifier),inh_Inh_Rules :: !(Attributes),inhsOfChildren_Inh_Rules :: !((Map Identifier Attributes)),mergeMap_Inh_Rules :: !((Map Identifier (Identifier,[Identifier]))),nt_Inh_Rules :: !(Identifier),o_case_Inh_Rules :: !(Bool),o_cata_Inh_Rules :: !(Bool),o_dovisit_Inh_Rules :: !(Bool),o_newtypes_Inh_Rules :: !(Bool),o_rename_Inh_Rules :: !(Bool),o_sem_Inh_Rules :: !(Bool),o_sig_Inh_Rules :: !(Bool),o_wantvisit_Inh_Rules :: !(Bool),prefix_Inh_Rules :: !(String),syn_Inh_Rules :: !(Attributes),synsOfChildren_Inh_Rules :: !((Map Identifier Attributes))}
+data Syn_Rules  = Syn_Rules {directDep_Syn_Rules :: !((Seq Edge)),errors_Syn_Rules :: !((Seq Error)),gathAltAttrs_Syn_Rules :: !(([AltAttr])),gathRules_Syn_Rules :: !((Seq CRule)),instDep_Syn_Rules :: !((Seq Edge)),instVars_Syn_Rules :: !(([Identifier])),locVars_Syn_Rules :: !(([Identifier])),nAutoRules_Syn_Rules :: !(Int),nExplicitRules_Syn_Rules :: !(Int)}
+wrap_Rules :: T_Rules  ->
+              Inh_Rules  ->
+              Syn_Rules 
+wrap_Rules (T_Rules sem ) (Inh_Rules _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren )  =
+    (let ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules) = sem _lhsIallTypeSigs _lhsIallfields _lhsIallnts _lhsIaltAttrs _lhsIattrs _lhsIchildInhs _lhsIchildNts _lhsIcon _lhsIinh _lhsIinhsOfChildren _lhsImergeMap _lhsInt _lhsIo_case _lhsIo_cata _lhsIo_dovisit _lhsIo_newtypes _lhsIo_rename _lhsIo_sem _lhsIo_sig _lhsIo_wantvisit _lhsIprefix _lhsIsyn _lhsIsynsOfChildren 
+     in  (Syn_Rules _lhsOdirectDep _lhsOerrors _lhsOgathAltAttrs _lhsOgathRules _lhsOinstDep _lhsOinstVars _lhsOlocVars _lhsOnAutoRules _lhsOnExplicitRules ))
+sem_Rules_Cons :: T_Rule  ->
+                  T_Rules  ->
+                  T_Rules 
+sem_Rules_Cons (T_Rule hd_ ) (T_Rules tl_ )  =
+    (T_Rules (\ _lhsIallTypeSigs
+                _lhsIallfields
+                _lhsIallnts
+                _lhsIaltAttrs
+                _lhsIattrs
+                _lhsIchildInhs
+                _lhsIchildNts
+                _lhsIcon
+                _lhsIinh
+                _lhsIinhsOfChildren
+                _lhsImergeMap
+                _lhsInt
+                _lhsIo_case
+                _lhsIo_cata
+                _lhsIo_dovisit
+                _lhsIo_newtypes
+                _lhsIo_rename
+                _lhsIo_sem
+                _lhsIo_sig
+                _lhsIo_wantvisit
+                _lhsIprefix
+                _lhsIsyn
+                _lhsIsynsOfChildren ->
+                  (let _lhsOdirectDep :: (Seq Edge)
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOgathAltAttrs :: ([AltAttr])
+                       _lhsOgathRules :: (Seq CRule)
+                       _lhsOinstDep :: (Seq Edge)
+                       _lhsOinstVars :: ([Identifier])
+                       _lhsOlocVars :: ([Identifier])
+                       _lhsOnAutoRules :: Int
+                       _lhsOnExplicitRules :: Int
+                       _hdOallTypeSigs :: (Map Identifier Type)
+                       _hdOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                       _hdOallnts :: ([Identifier])
+                       _hdOaltAttrs :: (Map AltAttr Vertex)
+                       _hdOattrs :: ([(Identifier,Identifier)])
+                       _hdOchildInhs :: (Map Identifier Attributes)
+                       _hdOchildNts :: (Map Identifier NontermIdent)
+                       _hdOcon :: Identifier
+                       _hdOinh :: Attributes
+                       _hdOinhsOfChildren :: (Map Identifier Attributes)
+                       _hdOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                       _hdOnt :: Identifier
+                       _hdOo_case :: Bool
+                       _hdOo_cata :: Bool
+                       _hdOo_dovisit :: Bool
+                       _hdOo_newtypes :: Bool
+                       _hdOo_rename :: Bool
+                       _hdOo_sem :: Bool
+                       _hdOo_sig :: Bool
+                       _hdOo_wantvisit :: Bool
+                       _hdOprefix :: String
+                       _hdOsyn :: Attributes
+                       _hdOsynsOfChildren :: (Map Identifier Attributes)
+                       _tlOallTypeSigs :: (Map Identifier Type)
+                       _tlOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
+                       _tlOallnts :: ([Identifier])
+                       _tlOaltAttrs :: (Map AltAttr Vertex)
+                       _tlOattrs :: ([(Identifier,Identifier)])
+                       _tlOchildInhs :: (Map Identifier Attributes)
+                       _tlOchildNts :: (Map Identifier NontermIdent)
+                       _tlOcon :: Identifier
+                       _tlOinh :: Attributes
+                       _tlOinhsOfChildren :: (Map Identifier Attributes)
+                       _tlOmergeMap :: (Map Identifier (Identifier,[Identifier]))
+                       _tlOnt :: Identifier
+                       _tlOo_case :: Bool
+                       _tlOo_cata :: Bool
+                       _tlOo_dovisit :: Bool
+                       _tlOo_newtypes :: Bool
+                       _tlOo_rename :: Bool
+                       _tlOo_sem :: Bool
+                       _tlOo_sig :: Bool
+                       _tlOo_wantvisit :: Bool
+                       _tlOprefix :: String
+                       _tlOsyn :: Attributes
+                       _tlOsynsOfChildren :: (Map Identifier Attributes)
+                       _hdIdirectDep :: (Seq Edge)
+                       _hdIerrors :: (Seq Error)
+                       _hdIgathAltAttrs :: ([AltAttr])
+                       _hdIgathRules :: (Seq CRule)
+                       _hdIinstDep :: (Seq Edge)
+                       _hdIinstVars :: ([Identifier])
+                       _hdIlocVars :: ([Identifier])
+                       _hdInAutoRules :: Int
+                       _hdInExplicitRules :: Int
+                       _tlIdirectDep :: (Seq Edge)
+                       _tlIerrors :: (Seq Error)
+                       _tlIgathAltAttrs :: ([AltAttr])
+                       _tlIgathRules :: (Seq CRule)
+                       _tlIinstDep :: (Seq Edge)
+                       _tlIinstVars :: ([Identifier])
+                       _tlIlocVars :: ([Identifier])
+                       _tlInAutoRules :: Int
+                       _tlInExplicitRules :: Int
+                       -- use rule "Order.ag"(line 269, column 33)
+                       _lhsOdirectDep =
+                           ({-# LINE 269 "Order.ag" #-}
+                            _hdIdirectDep Seq.>< _tlIdirectDep
+                            {-# LINE 4998 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 84, column 70)
+                       _lhsOerrors =
+                           ({-# LINE 84 "Order.ag" #-}
+                            _hdIerrors Seq.>< _tlIerrors
+                            {-# LINE 5004 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 170, column 68)
+                       _lhsOgathAltAttrs =
+                           ({-# LINE 170 "Order.ag" #-}
+                            _hdIgathAltAttrs ++ _tlIgathAltAttrs
+                            {-# LINE 5010 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 206, column 23)
+                       _lhsOgathRules =
+                           ({-# LINE 206 "Order.ag" #-}
+                            _hdIgathRules Seq.>< _tlIgathRules
+                            {-# LINE 5016 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 312, column 31)
+                       _lhsOinstDep =
+                           ({-# LINE 312 "Order.ag" #-}
+                            _hdIinstDep Seq.>< _tlIinstDep
+                            {-# LINE 5022 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 679, column 86)
+                       _lhsOinstVars =
+                           ({-# LINE 679 "Order.ag" #-}
+                            _hdIinstVars ++ _tlIinstVars
+                            {-# LINE 5028 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 679, column 48)
+                       _lhsOlocVars =
+                           ({-# LINE 679 "Order.ag" #-}
+                            _hdIlocVars ++ _tlIlocVars
+                            {-# LINE 5034 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 61, column 105)
+                       _lhsOnAutoRules =
+                           ({-# LINE 61 "Order.ag" #-}
+                            _hdInAutoRules + _tlInAutoRules
+                            {-# LINE 5040 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 61, column 105)
+                       _lhsOnExplicitRules =
+                           ({-# LINE 61 "Order.ag" #-}
+                            _hdInExplicitRules + _tlInExplicitRules
+                            {-# LINE 5046 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallTypeSigs =
+                           ({-# LINE 535 "Order.ag" #-}
+                            _lhsIallTypeSigs
+                            {-# LINE 5052 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallfields =
+                           ({-# LINE 656 "Order.ag" #-}
+                            _lhsIallfields
+                            {-# LINE 5058 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallnts =
+                           ({-# LINE 649 "Order.ag" #-}
+                            _lhsIallnts
+                            {-# LINE 5064 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOaltAttrs =
+                           ({-# LINE 186 "Order.ag" #-}
+                            _lhsIaltAttrs
+                            {-# LINE 5070 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOattrs =
+                           ({-# LINE 656 "Order.ag" #-}
+                            _lhsIattrs
+                            {-# LINE 5076 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOchildInhs =
+                           ({-# LINE 199 "Order.ag" #-}
+                            _lhsIchildInhs
+                            {-# LINE 5082 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOchildNts =
+                           ({-# LINE 198 "Order.ag" #-}
+                            _lhsIchildNts
+                            {-# LINE 5088 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOcon =
+                           ({-# LINE 90 "Order.ag" #-}
+                            _lhsIcon
+                            {-# LINE 5094 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOinh =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsIinh
+                            {-# LINE 5100 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOinhsOfChildren =
+                           ({-# LINE 339 "Order.ag" #-}
+                            _lhsIinhsOfChildren
+                            {-# LINE 5106 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOmergeMap =
+                           ({-# LINE 362 "Order.ag" #-}
+                            _lhsImergeMap
+                            {-# LINE 5112 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOnt =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsInt
+                            {-# LINE 5118 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_case =
+                           ({-# LINE 117 "Order.ag" #-}
+                            _lhsIo_case
+                            {-# LINE 5124 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_cata =
+                           ({-# LINE 111 "Order.ag" #-}
+                            _lhsIo_cata
+                            {-# LINE 5130 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_dovisit =
+                           ({-# LINE 116 "Order.ag" #-}
+                            _lhsIo_dovisit
+                            {-# LINE 5136 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_newtypes =
+                           ({-# LINE 110 "Order.ag" #-}
+                            _lhsIo_newtypes
+                            {-# LINE 5142 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_rename =
+                           ({-# LINE 114 "Order.ag" #-}
+                            _lhsIo_rename
+                            {-# LINE 5148 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_sem =
+                           ({-# LINE 113 "Order.ag" #-}
+                            _lhsIo_sem
+                            {-# LINE 5154 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_sig =
+                           ({-# LINE 112 "Order.ag" #-}
+                            _lhsIo_sig
+                            {-# LINE 5160 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOo_wantvisit =
+                           ({-# LINE 115 "Order.ag" #-}
+                            _lhsIo_wantvisit
+                            {-# LINE 5166 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOprefix =
+                           ({-# LINE 118 "Order.ag" #-}
+                            _lhsIprefix
+                            {-# LINE 5172 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOsyn =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsIsyn
+                            {-# LINE 5178 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOsynsOfChildren =
+                           ({-# LINE 339 "Order.ag" #-}
+                            _lhsIsynsOfChildren
+                            {-# LINE 5184 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallTypeSigs =
+                           ({-# LINE 535 "Order.ag" #-}
+                            _lhsIallTypeSigs
+                            {-# LINE 5190 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallfields =
+                           ({-# LINE 656 "Order.ag" #-}
+                            _lhsIallfields
+                            {-# LINE 5196 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallnts =
+                           ({-# LINE 649 "Order.ag" #-}
+                            _lhsIallnts
+                            {-# LINE 5202 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOaltAttrs =
+                           ({-# LINE 186 "Order.ag" #-}
+                            _lhsIaltAttrs
+                            {-# LINE 5208 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOattrs =
+                           ({-# LINE 656 "Order.ag" #-}
+                            _lhsIattrs
+                            {-# LINE 5214 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOchildInhs =
+                           ({-# LINE 199 "Order.ag" #-}
+                            _lhsIchildInhs
+                            {-# LINE 5220 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOchildNts =
+                           ({-# LINE 198 "Order.ag" #-}
+                            _lhsIchildNts
+                            {-# LINE 5226 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOcon =
+                           ({-# LINE 90 "Order.ag" #-}
+                            _lhsIcon
+                            {-# LINE 5232 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOinh =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsIinh
+                            {-# LINE 5238 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOinhsOfChildren =
+                           ({-# LINE 339 "Order.ag" #-}
+                            _lhsIinhsOfChildren
+                            {-# LINE 5244 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOmergeMap =
+                           ({-# LINE 362 "Order.ag" #-}
+                            _lhsImergeMap
+                            {-# LINE 5250 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOnt =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsInt
+                            {-# LINE 5256 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_case =
+                           ({-# LINE 117 "Order.ag" #-}
+                            _lhsIo_case
+                            {-# LINE 5262 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_cata =
+                           ({-# LINE 111 "Order.ag" #-}
+                            _lhsIo_cata
+                            {-# LINE 5268 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_dovisit =
+                           ({-# LINE 116 "Order.ag" #-}
+                            _lhsIo_dovisit
+                            {-# LINE 5274 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_newtypes =
+                           ({-# LINE 110 "Order.ag" #-}
+                            _lhsIo_newtypes
+                            {-# LINE 5280 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_rename =
+                           ({-# LINE 114 "Order.ag" #-}
+                            _lhsIo_rename
+                            {-# LINE 5286 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_sem =
+                           ({-# LINE 113 "Order.ag" #-}
+                            _lhsIo_sem
+                            {-# LINE 5292 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_sig =
+                           ({-# LINE 112 "Order.ag" #-}
+                            _lhsIo_sig
+                            {-# LINE 5298 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOo_wantvisit =
+                           ({-# LINE 115 "Order.ag" #-}
+                            _lhsIo_wantvisit
+                            {-# LINE 5304 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOprefix =
+                           ({-# LINE 118 "Order.ag" #-}
+                            _lhsIprefix
+                            {-# LINE 5310 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOsyn =
+                           ({-# LINE 89 "Order.ag" #-}
+                            _lhsIsyn
+                            {-# LINE 5316 "Order.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOsynsOfChildren =
+                           ({-# LINE 339 "Order.ag" #-}
+                            _lhsIsynsOfChildren
+                            {-# LINE 5322 "Order.hs" #-}
+                            )
+                       ( _hdIdirectDep,_hdIerrors,_hdIgathAltAttrs,_hdIgathRules,_hdIinstDep,_hdIinstVars,_hdIlocVars,_hdInAutoRules,_hdInExplicitRules) =
+                           hd_ _hdOallTypeSigs _hdOallfields _hdOallnts _hdOaltAttrs _hdOattrs _hdOchildInhs _hdOchildNts _hdOcon _hdOinh _hdOinhsOfChildren _hdOmergeMap _hdOnt _hdOo_case _hdOo_cata _hdOo_dovisit _hdOo_newtypes _hdOo_rename _hdOo_sem _hdOo_sig _hdOo_wantvisit _hdOprefix _hdOsyn _hdOsynsOfChildren 
+                       ( _tlIdirectDep,_tlIerrors,_tlIgathAltAttrs,_tlIgathRules,_tlIinstDep,_tlIinstVars,_tlIlocVars,_tlInAutoRules,_tlInExplicitRules) =
+                           tl_ _tlOallTypeSigs _tlOallfields _tlOallnts _tlOaltAttrs _tlOattrs _tlOchildInhs _tlOchildNts _tlOcon _tlOinh _tlOinhsOfChildren _tlOmergeMap _tlOnt _tlOo_case _tlOo_cata _tlOo_dovisit _tlOo_newtypes _tlOo_rename _tlOo_sem _tlOo_sig _tlOo_wantvisit _tlOprefix _tlOsyn _tlOsynsOfChildren 
+                   in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
+sem_Rules_Nil :: T_Rules 
+sem_Rules_Nil  =
+    (T_Rules (\ _lhsIallTypeSigs
+                _lhsIallfields
+                _lhsIallnts
+                _lhsIaltAttrs
+                _lhsIattrs
+                _lhsIchildInhs
+                _lhsIchildNts
+                _lhsIcon
+                _lhsIinh
+                _lhsIinhsOfChildren
+                _lhsImergeMap
+                _lhsInt
+                _lhsIo_case
+                _lhsIo_cata
+                _lhsIo_dovisit
+                _lhsIo_newtypes
+                _lhsIo_rename
+                _lhsIo_sem
+                _lhsIo_sig
+                _lhsIo_wantvisit
+                _lhsIprefix
+                _lhsIsyn
+                _lhsIsynsOfChildren ->
+                  (let _lhsOdirectDep :: (Seq Edge)
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOgathAltAttrs :: ([AltAttr])
+                       _lhsOgathRules :: (Seq CRule)
+                       _lhsOinstDep :: (Seq Edge)
+                       _lhsOinstVars :: ([Identifier])
+                       _lhsOlocVars :: ([Identifier])
+                       _lhsOnAutoRules :: Int
+                       _lhsOnExplicitRules :: Int
+                       -- use rule "Order.ag"(line 269, column 33)
+                       _lhsOdirectDep =
+                           ({-# LINE 269 "Order.ag" #-}
+                            Seq.empty
+                            {-# LINE 5367 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 84, column 70)
+                       _lhsOerrors =
+                           ({-# LINE 84 "Order.ag" #-}
+                            Seq.empty
+                            {-# LINE 5373 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 170, column 68)
+                       _lhsOgathAltAttrs =
+                           ({-# LINE 170 "Order.ag" #-}
+                            []
+                            {-# LINE 5379 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 206, column 23)
+                       _lhsOgathRules =
+                           ({-# LINE 206 "Order.ag" #-}
+                            Seq.empty
+                            {-# LINE 5385 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 312, column 31)
+                       _lhsOinstDep =
+                           ({-# LINE 312 "Order.ag" #-}
+                            Seq.empty
+                            {-# LINE 5391 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 679, column 86)
+                       _lhsOinstVars =
+                           ({-# LINE 679 "Order.ag" #-}
+                            []
+                            {-# LINE 5397 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 679, column 48)
+                       _lhsOlocVars =
+                           ({-# LINE 679 "Order.ag" #-}
+                            []
+                            {-# LINE 5403 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 61, column 105)
+                       _lhsOnAutoRules =
+                           ({-# LINE 61 "Order.ag" #-}
+                            0
+                            {-# LINE 5409 "Order.hs" #-}
+                            )
+                       -- use rule "Order.ag"(line 61, column 105)
+                       _lhsOnExplicitRules =
+                           ({-# LINE 61 "Order.ag" #-}
+                            0
+                            {-# LINE 5415 "Order.hs" #-}
+                            )
+                   in  ( _lhsOdirectDep,_lhsOerrors,_lhsOgathAltAttrs,_lhsOgathRules,_lhsOinstDep,_lhsOinstVars,_lhsOlocVars,_lhsOnAutoRules,_lhsOnExplicitRules))) )
+-- TypeSig -----------------------------------------------------
+{-
+   visit 0:
+      chained attribute:
+         typeSigs             : Map Identifier Type
+   alternatives:
+      alternative TypeSig:
+         child name           : {Identifier}
+         child tp             : {Type}
+-}
+-- cata
+sem_TypeSig :: TypeSig  ->
+               T_TypeSig 
+sem_TypeSig (TypeSig _name _tp )  =
+    (sem_TypeSig_TypeSig _name _tp )
+-- semantic domain
+newtype T_TypeSig  = T_TypeSig ((Map Identifier Type) ->
+                                ( (Map Identifier Type)))
+data Inh_TypeSig  = Inh_TypeSig {typeSigs_Inh_TypeSig :: !((Map Identifier Type))}
+data Syn_TypeSig  = Syn_TypeSig {typeSigs_Syn_TypeSig :: !((Map Identifier Type))}
+wrap_TypeSig :: T_TypeSig  ->
+                Inh_TypeSig  ->
+                Syn_TypeSig 
+wrap_TypeSig (T_TypeSig sem ) (Inh_TypeSig _lhsItypeSigs )  =
+    (let ( _lhsOtypeSigs) = sem _lhsItypeSigs 
+     in  (Syn_TypeSig _lhsOtypeSigs ))
+sem_TypeSig_TypeSig :: Identifier ->
+                       Type ->
+                       T_TypeSig 
+sem_TypeSig_TypeSig name_ tp_  =
+    (T_TypeSig (\ _lhsItypeSigs ->
+                    (let _lhsOtypeSigs :: (Map Identifier Type)
+                         -- "Order.ag"(line 533, column 13)
+                         _lhsOtypeSigs =
+                             ({-# LINE 533 "Order.ag" #-}
+                              Map.insert name_ tp_ _lhsItypeSigs
+                              {-# LINE 5454 "Order.hs" #-}
+                              )
+                     in  ( _lhsOtypeSigs))) )
+-- TypeSigs ----------------------------------------------------
+{-
+   visit 0:
+      chained attribute:
+         typeSigs             : Map Identifier Type
+   alternatives:
+      alternative Cons:
+         child hd             : TypeSig 
+         child tl             : TypeSigs 
+      alternative Nil:
+-}
+-- cata
+sem_TypeSigs :: TypeSigs  ->
+                T_TypeSigs 
+sem_TypeSigs list  =
+    (Prelude.foldr sem_TypeSigs_Cons sem_TypeSigs_Nil (Prelude.map sem_TypeSig list) )
+-- semantic domain
+newtype T_TypeSigs  = T_TypeSigs ((Map Identifier Type) ->
+                                  ( (Map Identifier Type)))
+data Inh_TypeSigs  = Inh_TypeSigs {typeSigs_Inh_TypeSigs :: !((Map Identifier Type))}
+data Syn_TypeSigs  = Syn_TypeSigs {typeSigs_Syn_TypeSigs :: !((Map Identifier Type))}
+wrap_TypeSigs :: T_TypeSigs  ->
+                 Inh_TypeSigs  ->
+                 Syn_TypeSigs 
+wrap_TypeSigs (T_TypeSigs sem ) (Inh_TypeSigs _lhsItypeSigs )  =
+    (let ( _lhsOtypeSigs) = sem _lhsItypeSigs 
+     in  (Syn_TypeSigs _lhsOtypeSigs ))
+sem_TypeSigs_Cons :: T_TypeSig  ->
+                     T_TypeSigs  ->
+                     T_TypeSigs 
+sem_TypeSigs_Cons (T_TypeSig hd_ ) (T_TypeSigs tl_ )  =
+    (T_TypeSigs (\ _lhsItypeSigs ->
+                     (let _lhsOtypeSigs :: (Map Identifier Type)
+                          _hdOtypeSigs :: (Map Identifier Type)
+                          _tlOtypeSigs :: (Map Identifier Type)
+                          _hdItypeSigs :: (Map Identifier Type)
+                          _tlItypeSigs :: (Map Identifier Type)
+                          -- copy rule (up)
+                          _lhsOtypeSigs =
+                              ({-# LINE 529 "Order.ag" #-}
+                               _tlItypeSigs
+                               {-# LINE 5498 "Order.hs" #-}
+                               )
+                          -- copy rule (down)
+                          _hdOtypeSigs =
+                              ({-# LINE 529 "Order.ag" #-}
+                               _lhsItypeSigs
+                               {-# LINE 5504 "Order.hs" #-}
+                               )
+                          -- copy rule (chain)
+                          _tlOtypeSigs =
+                              ({-# LINE 529 "Order.ag" #-}
+                               _hdItypeSigs
+                               {-# LINE 5510 "Order.hs" #-}
+                               )
+                          ( _hdItypeSigs) =
+                              hd_ _hdOtypeSigs 
+                          ( _tlItypeSigs) =
+                              tl_ _tlOtypeSigs 
+                      in  ( _lhsOtypeSigs))) )
+sem_TypeSigs_Nil :: T_TypeSigs 
+sem_TypeSigs_Nil  =
+    (T_TypeSigs (\ _lhsItypeSigs ->
+                     (let _lhsOtypeSigs :: (Map Identifier Type)
+                          -- copy rule (chain)
+                          _lhsOtypeSigs =
+                              ({-# LINE 529 "Order.ag" #-}
+                               _lhsItypeSigs
+                               {-# LINE 5525 "Order.hs" #-}
                                )
                       in  ( _lhsOtypeSigs))) )
diff --git a/src-derived/Patterns.hs b/src-derived/Patterns.hs
--- a/src-derived/Patterns.hs
+++ b/src-derived/Patterns.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (Patterns.ag)
+-- UUAGC 0.9.38.6 (Patterns.ag)
 module Patterns where
 {-# LINE 2 "Patterns.ag" #-}
 
diff --git a/src-derived/PrintCode.hs b/src-derived/PrintCode.hs
--- a/src-derived/PrintCode.hs
+++ b/src-derived/PrintCode.hs
@@ -1,6 +1,6 @@
 {-# OPTIONS_GHC -XBangPatterns #-}
 
--- UUAGC 0.9.38.1 (PrintCode.ag)
+-- UUAGC 0.9.38.6 (PrintCode.ag)
 module PrintCode where
 {-# LINE 10 "PrintCode.ag" #-}
 
@@ -3920,7 +3920,7 @@
                   (case (value_ _valueOnested ) of
                    { ( !_valueIpp,!_valueIprec) ->
                        (case (({-# LINE 293 "PrintCode.ag" #-}
-                               text "IntMap" >#< pp_parens _valueIpp
+                               text "Data.IntMap.IntMap" >#< pp_parens _valueIpp
                                {-# LINE 3925 "PrintCode.hs" #-}
                                )) of
                         { !_lhsOpp ->
@@ -3950,7 +3950,7 @@
                         (case (key_ _keyOnested ) of
                          { ( !_keyIpp,!_keyIprec) ->
                              (case (({-# LINE 291 "PrintCode.ag" #-}
-                                     text "Map" >#< pp_parens _keyIpp >#< pp_parens _valueIpp
+                                     text "Data.Map.Map" >#< pp_parens _keyIpp >#< pp_parens _valueIpp
                                      {-# LINE 3955 "PrintCode.hs" #-}
                                      )) of
                               { !_lhsOpp ->
diff --git a/src-derived/PrintErrorMessages.hs b/src-derived/PrintErrorMessages.hs
--- a/src-derived/PrintErrorMessages.hs
+++ b/src-derived/PrintErrorMessages.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (PrintErrorMessages.ag)
+-- UUAGC 0.9.38.6 (PrintErrorMessages.ag)
 module PrintErrorMessages where
 {-# LINE 4 "PrintErrorMessages.ag" #-}
 
diff --git a/src-derived/PrintOcamlCode.hs b/src-derived/PrintOcamlCode.hs
--- a/src-derived/PrintOcamlCode.hs
+++ b/src-derived/PrintOcamlCode.hs
@@ -1,6 +1,6 @@
 {-# OPTIONS_GHC -XBangPatterns #-}
 
--- UUAGC 0.9.38.1 (PrintOcamlCode.ag)
+-- UUAGC 0.9.38.6 (PrintOcamlCode.ag)
 module PrintOcamlCode where
 {-# LINE 10 "PrintOcamlCode.ag" #-}
 
diff --git a/src-derived/PrintVisitCode.hs b/src-derived/PrintVisitCode.hs
--- a/src-derived/PrintVisitCode.hs
+++ b/src-derived/PrintVisitCode.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (PrintVisitCode.ag)
+-- UUAGC 0.9.38.6 (PrintVisitCode.ag)
 module PrintVisitCode where
 {-# LINE 10 "PrintVisitCode.ag" #-}
 
diff --git a/src-derived/SemHsTokens.hs b/src-derived/SemHsTokens.hs
--- a/src-derived/SemHsTokens.hs
+++ b/src-derived/SemHsTokens.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (SemHsTokens.ag)
+-- UUAGC 0.9.38.6 (SemHsTokens.ag)
 module SemHsTokens where
 {-# LINE 4 "SemHsTokens.ag" #-}
 
@@ -36,6 +36,7 @@
          nt                   : Identifier
       synthesized attributes:
          errors               : Seq Error
+         output               : SELF 
          tok                  : (Pos,String)
          usedAttrs            : [(Identifier,Identifier)]
          usedFields           : Seq Identifier
@@ -48,27 +49,39 @@
          child rdesc          : {Maybe String}
          visit 0:
             local addTrace    : _
+            local output      : _
       alternative AGLocal:
          child var            : {Identifier}
          child pos            : {Pos}
          child rdesc          : {Maybe String}
          visit 0:
+            local tkAsLocal   : _
+            local tkAsField   : _
             local _tup1       : _
             local errors      : _
+            local output      : _
             local tok         : _
             local usedLocals  : _
       alternative CharToken:
          child value          : {String}
          child pos            : {Pos}
+         visit 0:
+            local output      : _
       alternative Err:
          child mesg           : {String}
          child pos            : {Pos}
+         visit 0:
+            local output      : _
       alternative HsToken:
          child value          : {String}
          child pos            : {Pos}
+         visit 0:
+            local output      : _
       alternative StrToken:
          child value          : {String}
          child pos            : {Pos}
+         visit 0:
+            local output      : _
 -}
 -- cata
 sem_HsToken :: HsToken  ->
@@ -92,15 +105,15 @@
                                 Identifier ->
                                 ([Identifier]) ->
                                 Identifier ->
-                                ( (Seq Error),((Pos,String)),([(Identifier,Identifier)]),(Seq Identifier),([Identifier])))
+                                ( (Seq Error),HsToken ,((Pos,String)),([(Identifier,Identifier)]),(Seq Identifier),([Identifier])))
 data Inh_HsToken  = Inh_HsToken {allfields_Inh_HsToken :: ([(Identifier,Type,Maybe (Maybe Type))]),allnts_Inh_HsToken :: ([Identifier]),attrs_Inh_HsToken :: ([(Identifier,Identifier)]),con_Inh_HsToken :: Identifier,fieldnames_Inh_HsToken :: ([Identifier]),nt_Inh_HsToken :: Identifier}
-data Syn_HsToken  = Syn_HsToken {errors_Syn_HsToken :: (Seq Error),tok_Syn_HsToken :: ((Pos,String)),usedAttrs_Syn_HsToken :: ([(Identifier,Identifier)]),usedFields_Syn_HsToken :: (Seq Identifier),usedLocals_Syn_HsToken :: ([Identifier])}
+data Syn_HsToken  = Syn_HsToken {errors_Syn_HsToken :: (Seq Error),output_Syn_HsToken :: HsToken ,tok_Syn_HsToken :: ((Pos,String)),usedAttrs_Syn_HsToken :: ([(Identifier,Identifier)]),usedFields_Syn_HsToken :: (Seq Identifier),usedLocals_Syn_HsToken :: ([Identifier])}
 wrap_HsToken :: T_HsToken  ->
                 Inh_HsToken  ->
                 Syn_HsToken 
 wrap_HsToken (T_HsToken sem ) (Inh_HsToken _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt )  =
-    (let ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt 
-     in  (Syn_HsToken _lhsOerrors _lhsOtok _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
+    (let ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt 
+     in  (Syn_HsToken _lhsOerrors _lhsOoutput _lhsOtok _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
 sem_HsToken_AGField :: Identifier ->
                        Identifier ->
                        Pos ->
@@ -118,49 +131,62 @@
                          _lhsOtok :: ((Pos,String))
                          _lhsOusedFields :: (Seq Identifier)
                          _lhsOusedLocals :: ([Identifier])
-                         -- "SemHsTokens.ag"(line 74, column 15)
+                         _lhsOoutput :: HsToken 
+                         -- "SemHsTokens.ag"(line 76, column 15)
                          _lhsOerrors =
-                             ({-# LINE 74 "SemHsTokens.ag" #-}
+                             ({-# LINE 76 "SemHsTokens.ag" #-}
                               if (field_,attr_) `elem` _lhsIattrs
                                     then Seq.empty
                                     else if not(field_ `elem` (_LHS : _LOC: _lhsIfieldnames))
                                             then Seq.singleton (UndefChild _lhsInt _lhsIcon field_)
                                             else Seq.singleton (UndefAttr _lhsInt _lhsIcon field_ attr_ False)
-                              {-# LINE 130 "SemHsTokens.hs" #-}
+                              {-# LINE 144 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 88, column 13)
+                         -- "SemHsTokens.ag"(line 90, column 13)
                          _lhsOusedAttrs =
-                             ({-# LINE 88 "SemHsTokens.ag" #-}
+                             ({-# LINE 90 "SemHsTokens.ag" #-}
                               [(field_,attr_)]
-                              {-# LINE 136 "SemHsTokens.hs" #-}
+                              {-# LINE 150 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 115, column 8)
+                         -- "SemHsTokens.ag"(line 117, column 8)
                          _addTrace =
-                             ({-# LINE 115 "SemHsTokens.ag" #-}
+                             ({-# LINE 117 "SemHsTokens.ag" #-}
                               case rdesc_ of
                                 Just d  -> \x -> "(trace " ++ show (d ++ " -> " ++ show field_ ++ "." ++ show attr_) ++ " (" ++ x ++ "))"
                                 Nothing -> id
-                              {-# LINE 144 "SemHsTokens.hs" #-}
+                              {-# LINE 158 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 118, column 8)
+                         -- "SemHsTokens.ag"(line 120, column 8)
                          _lhsOtok =
-                             ({-# LINE 118 "SemHsTokens.ag" #-}
+                             ({-# LINE 120 "SemHsTokens.ag" #-}
                               (pos_, _addTrace     $ attrname True field_ attr_)
-                              {-# LINE 150 "SemHsTokens.hs" #-}
+                              {-# LINE 164 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 93, column 40)
+                         -- use rule "SemHsTokens.ag"(line 95, column 40)
                          _lhsOusedFields =
-                             ({-# LINE 93 "SemHsTokens.ag" #-}
+                             ({-# LINE 95 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 156 "SemHsTokens.hs" #-}
+                              {-# LINE 170 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 162 "SemHsTokens.hs" #-}
+                              {-# LINE 176 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                         -- self rule
+                         _output =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              AGField field_ attr_ pos_ rdesc_
+                              {-# LINE 182 "SemHsTokens.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 188 "SemHsTokens.hs" #-}
+                              )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsToken_AGLocal :: Identifier ->
                        Pos ->
                        (Maybe String) ->
@@ -176,70 +202,95 @@
                          _lhsOerrors :: (Seq Error)
                          _lhsOusedAttrs :: ([(Identifier,Identifier)])
                          _lhsOusedLocals :: ([Identifier])
+                         _lhsOoutput :: HsToken 
                          _lhsOtok :: ((Pos,String))
-                         -- "SemHsTokens.ag"(line 64, column 19)
-                         __tup1 =
+                         -- "SemHsTokens.ag"(line 64, column 15)
+                         _tkAsLocal =
                              ({-# LINE 64 "SemHsTokens.ag" #-}
+                              AGLocal var_ pos_ rdesc_
+                              {-# LINE 212 "SemHsTokens.hs" #-}
+                              )
+                         -- "SemHsTokens.ag"(line 65, column 15)
+                         _tkAsField =
+                             ({-# LINE 65 "SemHsTokens.ag" #-}
+                              AGField _LOC var_ pos_ rdesc_
+                              {-# LINE 218 "SemHsTokens.hs" #-}
+                              )
+                         -- "SemHsTokens.ag"(line 66, column 19)
+                         __tup1 =
+                             ({-# LINE 66 "SemHsTokens.ag" #-}
                               if var_ `elem` _lhsIfieldnames
                               then if  isNTname _lhsIallnts (lookup var_ (map (\(n,t,_) -> (n,t)) _lhsIallfields))
-                                   then (Seq.singleton(ChildAsLocal _lhsInt _lhsIcon var_), (pos_,fieldname var_), []    )
-                                   else (Seq.empty, (pos_,fieldname var_), []    )
+                                   then (Seq.singleton(ChildAsLocal _lhsInt _lhsIcon var_), _tkAsLocal    ,(pos_,fieldname var_), []    )
+                                   else (Seq.empty, _tkAsLocal    , (pos_,fieldname var_), []    )
                               else if (_LOC,var_) `elem` _lhsIattrs
-                              then (Seq.empty                                   , (pos_,locname   var_), [var_])
-                              else (Seq.singleton(UndefLocal _lhsInt _lhsIcon var_), (pos_,locname   var_), []    )
-                              {-# LINE 191 "SemHsTokens.hs" #-}
+                              then (Seq.empty                                      , _tkAsField    , (pos_,locname   var_), [var_])
+                              else (Seq.singleton(UndefLocal _lhsInt _lhsIcon var_), _tkAsField    , (pos_,locname   var_), []    )
+                              {-# LINE 230 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 64, column 19)
-                         (_errors,_,_) =
-                             ({-# LINE 64 "SemHsTokens.ag" #-}
+                         -- "SemHsTokens.ag"(line 66, column 19)
+                         (_errors,_,_,_) =
+                             ({-# LINE 66 "SemHsTokens.ag" #-}
                               __tup1
-                              {-# LINE 197 "SemHsTokens.hs" #-}
+                              {-# LINE 236 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 64, column 19)
-                         (_,_tok,_) =
-                             ({-# LINE 64 "SemHsTokens.ag" #-}
+                         -- "SemHsTokens.ag"(line 66, column 19)
+                         (_,_output,_,_) =
+                             ({-# LINE 66 "SemHsTokens.ag" #-}
                               __tup1
-                              {-# LINE 203 "SemHsTokens.hs" #-}
+                              {-# LINE 242 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 64, column 19)
-                         (_,_,_usedLocals) =
-                             ({-# LINE 64 "SemHsTokens.ag" #-}
+                         -- "SemHsTokens.ag"(line 66, column 19)
+                         (_,_,_tok,_) =
+                             ({-# LINE 66 "SemHsTokens.ag" #-}
                               __tup1
-                              {-# LINE 209 "SemHsTokens.hs" #-}
+                              {-# LINE 248 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 96, column 13)
+                         -- "SemHsTokens.ag"(line 66, column 19)
+                         (_,_,_,_usedLocals) =
+                             ({-# LINE 66 "SemHsTokens.ag" #-}
+                              __tup1
+                              {-# LINE 254 "SemHsTokens.hs" #-}
+                              )
+                         -- "SemHsTokens.ag"(line 98, column 13)
                          _lhsOusedFields =
-                             ({-# LINE 96 "SemHsTokens.ag" #-}
+                             ({-# LINE 98 "SemHsTokens.ag" #-}
                               if var_ `elem` _lhsIfieldnames
                                then Seq.singleton var_
                                else Seq.empty
-                              {-# LINE 217 "SemHsTokens.hs" #-}
+                              {-# LINE 262 "SemHsTokens.hs" #-}
                               )
                          -- use rule "SemHsTokens.ag"(line 43, column 37)
                          _lhsOerrors =
                              ({-# LINE 43 "SemHsTokens.ag" #-}
                               _errors
-                              {-# LINE 223 "SemHsTokens.hs" #-}
+                              {-# LINE 268 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 85, column 40)
+                         -- use rule "SemHsTokens.ag"(line 87, column 40)
                          _lhsOusedAttrs =
-                             ({-# LINE 85 "SemHsTokens.ag" #-}
+                             ({-# LINE 87 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 229 "SemHsTokens.hs" #-}
+                              {-# LINE 274 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               _usedLocals
-                              {-# LINE 235 "SemHsTokens.hs" #-}
+                              {-# LINE 280 "SemHsTokens.hs" #-}
                               )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 286 "SemHsTokens.hs" #-}
+                              )
                          -- copy rule (from local)
                          _lhsOtok =
-                             ({-# LINE 113 "SemHsTokens.ag" #-}
+                             ({-# LINE 115 "SemHsTokens.ag" #-}
                               _tok
-                              {-# LINE 241 "SemHsTokens.hs" #-}
+                              {-# LINE 292 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsToken_CharToken :: String ->
                          Pos ->
                          T_HsToken 
@@ -255,40 +306,53 @@
                          _lhsOusedAttrs :: ([(Identifier,Identifier)])
                          _lhsOusedFields :: (Seq Identifier)
                          _lhsOusedLocals :: ([Identifier])
-                         -- "SemHsTokens.ag"(line 122, column 16)
+                         _lhsOoutput :: HsToken 
+                         -- "SemHsTokens.ag"(line 124, column 16)
                          _lhsOtok =
-                             ({-# LINE 122 "SemHsTokens.ag" #-}
+                             ({-# LINE 124 "SemHsTokens.ag" #-}
                               (pos_, if null value_
                                         then ""
                                         else showCharShort (head value_)
                               )
-                              {-# LINE 266 "SemHsTokens.hs" #-}
+                              {-# LINE 318 "SemHsTokens.hs" #-}
                               )
                          -- use rule "SemHsTokens.ag"(line 43, column 37)
                          _lhsOerrors =
                              ({-# LINE 43 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 272 "SemHsTokens.hs" #-}
+                              {-# LINE 324 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 85, column 40)
+                         -- use rule "SemHsTokens.ag"(line 87, column 40)
                          _lhsOusedAttrs =
-                             ({-# LINE 85 "SemHsTokens.ag" #-}
+                             ({-# LINE 87 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 278 "SemHsTokens.hs" #-}
+                              {-# LINE 330 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 93, column 40)
+                         -- use rule "SemHsTokens.ag"(line 95, column 40)
                          _lhsOusedFields =
-                             ({-# LINE 93 "SemHsTokens.ag" #-}
+                             ({-# LINE 95 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 284 "SemHsTokens.hs" #-}
+                              {-# LINE 336 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 290 "SemHsTokens.hs" #-}
+                              {-# LINE 342 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                         -- self rule
+                         _output =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              CharToken value_ pos_
+                              {-# LINE 348 "SemHsTokens.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 354 "SemHsTokens.hs" #-}
+                              )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsToken_Err :: String ->
                    Pos ->
                    T_HsToken 
@@ -304,38 +368,51 @@
                          _lhsOusedAttrs :: ([(Identifier,Identifier)])
                          _lhsOusedFields :: (Seq Identifier)
                          _lhsOusedLocals :: ([Identifier])
+                         _lhsOoutput :: HsToken 
                          -- "SemHsTokens.ag"(line 50, column 9)
                          _lhsOerrors =
                              ({-# LINE 50 "SemHsTokens.ag" #-}
                               let m = text mesg_
                               in Seq.singleton (CustomError False pos_ m)
-                              {-# LINE 313 "SemHsTokens.hs" #-}
+                              {-# LINE 378 "SemHsTokens.hs" #-}
                               )
-                         -- "SemHsTokens.ag"(line 128, column 16)
+                         -- "SemHsTokens.ag"(line 130, column 16)
                          _lhsOtok =
-                             ({-# LINE 128 "SemHsTokens.ag" #-}
+                             ({-# LINE 130 "SemHsTokens.ag" #-}
                               (pos_, "")
-                              {-# LINE 319 "SemHsTokens.hs" #-}
+                              {-# LINE 384 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 85, column 40)
+                         -- use rule "SemHsTokens.ag"(line 87, column 40)
                          _lhsOusedAttrs =
-                             ({-# LINE 85 "SemHsTokens.ag" #-}
+                             ({-# LINE 87 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 325 "SemHsTokens.hs" #-}
+                              {-# LINE 390 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 93, column 40)
+                         -- use rule "SemHsTokens.ag"(line 95, column 40)
                          _lhsOusedFields =
-                             ({-# LINE 93 "SemHsTokens.ag" #-}
+                             ({-# LINE 95 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 331 "SemHsTokens.hs" #-}
+                              {-# LINE 396 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 337 "SemHsTokens.hs" #-}
+                              {-# LINE 402 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                         -- self rule
+                         _output =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              Err mesg_ pos_
+                              {-# LINE 408 "SemHsTokens.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 414 "SemHsTokens.hs" #-}
+                              )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsToken_HsToken :: String ->
                        Pos ->
                        T_HsToken 
@@ -351,37 +428,50 @@
                          _lhsOusedAttrs :: ([(Identifier,Identifier)])
                          _lhsOusedFields :: (Seq Identifier)
                          _lhsOusedLocals :: ([Identifier])
-                         -- "SemHsTokens.ag"(line 120, column 14)
+                         _lhsOoutput :: HsToken 
+                         -- "SemHsTokens.ag"(line 122, column 14)
                          _lhsOtok =
-                             ({-# LINE 120 "SemHsTokens.ag" #-}
+                             ({-# LINE 122 "SemHsTokens.ag" #-}
                               (pos_, value_)
-                              {-# LINE 359 "SemHsTokens.hs" #-}
+                              {-# LINE 437 "SemHsTokens.hs" #-}
                               )
                          -- use rule "SemHsTokens.ag"(line 43, column 37)
                          _lhsOerrors =
                              ({-# LINE 43 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 365 "SemHsTokens.hs" #-}
+                              {-# LINE 443 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 85, column 40)
+                         -- use rule "SemHsTokens.ag"(line 87, column 40)
                          _lhsOusedAttrs =
-                             ({-# LINE 85 "SemHsTokens.ag" #-}
+                             ({-# LINE 87 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 371 "SemHsTokens.hs" #-}
+                              {-# LINE 449 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 93, column 40)
+                         -- use rule "SemHsTokens.ag"(line 95, column 40)
                          _lhsOusedFields =
-                             ({-# LINE 93 "SemHsTokens.ag" #-}
+                             ({-# LINE 95 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 377 "SemHsTokens.hs" #-}
+                              {-# LINE 455 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 383 "SemHsTokens.hs" #-}
+                              {-# LINE 461 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                         -- self rule
+                         _output =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              HsToken value_ pos_
+                              {-# LINE 467 "SemHsTokens.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 473 "SemHsTokens.hs" #-}
+                              )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsToken_StrToken :: String ->
                         Pos ->
                         T_HsToken 
@@ -397,37 +487,50 @@
                          _lhsOusedAttrs :: ([(Identifier,Identifier)])
                          _lhsOusedFields :: (Seq Identifier)
                          _lhsOusedLocals :: ([Identifier])
-                         -- "SemHsTokens.ag"(line 127, column 16)
+                         _lhsOoutput :: HsToken 
+                         -- "SemHsTokens.ag"(line 129, column 16)
                          _lhsOtok =
-                             ({-# LINE 127 "SemHsTokens.ag" #-}
+                             ({-# LINE 129 "SemHsTokens.ag" #-}
                               (pos_, showStrShort value_)
-                              {-# LINE 405 "SemHsTokens.hs" #-}
+                              {-# LINE 496 "SemHsTokens.hs" #-}
                               )
                          -- use rule "SemHsTokens.ag"(line 43, column 37)
                          _lhsOerrors =
                              ({-# LINE 43 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 411 "SemHsTokens.hs" #-}
+                              {-# LINE 502 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 85, column 40)
+                         -- use rule "SemHsTokens.ag"(line 87, column 40)
                          _lhsOusedAttrs =
-                             ({-# LINE 85 "SemHsTokens.ag" #-}
+                             ({-# LINE 87 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 417 "SemHsTokens.hs" #-}
+                              {-# LINE 508 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 93, column 40)
+                         -- use rule "SemHsTokens.ag"(line 95, column 40)
                          _lhsOusedFields =
-                             ({-# LINE 93 "SemHsTokens.ag" #-}
+                             ({-# LINE 95 "SemHsTokens.ag" #-}
                               Seq.empty
-                              {-# LINE 423 "SemHsTokens.hs" #-}
+                              {-# LINE 514 "SemHsTokens.hs" #-}
                               )
-                         -- use rule "SemHsTokens.ag"(line 84, column 40)
+                         -- use rule "SemHsTokens.ag"(line 86, column 40)
                          _lhsOusedLocals =
-                             ({-# LINE 84 "SemHsTokens.ag" #-}
+                             ({-# LINE 86 "SemHsTokens.ag" #-}
                               []
-                              {-# LINE 429 "SemHsTokens.hs" #-}
+                              {-# LINE 520 "SemHsTokens.hs" #-}
                               )
-                     in  ( _lhsOerrors,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                         -- self rule
+                         _output =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              StrToken value_ pos_
+                              {-# LINE 526 "SemHsTokens.hs" #-}
+                              )
+                         -- self rule
+                         _lhsOoutput =
+                             ({-# LINE 137 "SemHsTokens.ag" #-}
+                              _output
+                              {-# LINE 532 "SemHsTokens.hs" #-}
+                              )
+                     in  ( _lhsOerrors,_lhsOoutput,_lhsOtok,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 -- HsTokens ----------------------------------------------------
 {-
    visit 0:
@@ -440,6 +543,7 @@
          nt                   : Identifier
       synthesized attributes:
          errors               : Seq Error
+         output               : SELF 
          tks                  : [(Pos,String)]
          usedAttrs            : [(Identifier,Identifier)]
          usedFields           : Seq Identifier
@@ -448,7 +552,11 @@
       alternative Cons:
          child hd             : HsToken 
          child tl             : HsTokens 
+         visit 0:
+            local output      : _
       alternative Nil:
+         visit 0:
+            local output      : _
 -}
 -- cata
 sem_HsTokens :: HsTokens  ->
@@ -462,15 +570,15 @@
                                   Identifier ->
                                   ([Identifier]) ->
                                   Identifier ->
-                                  ( (Seq Error),([(Pos,String)]),([(Identifier,Identifier)]),(Seq Identifier),([Identifier])))
+                                  ( (Seq Error),HsTokens ,([(Pos,String)]),([(Identifier,Identifier)]),(Seq Identifier),([Identifier])))
 data Inh_HsTokens  = Inh_HsTokens {allfields_Inh_HsTokens :: ([(Identifier,Type,Maybe (Maybe Type))]),allnts_Inh_HsTokens :: ([Identifier]),attrs_Inh_HsTokens :: ([(Identifier,Identifier)]),con_Inh_HsTokens :: Identifier,fieldnames_Inh_HsTokens :: ([Identifier]),nt_Inh_HsTokens :: Identifier}
-data Syn_HsTokens  = Syn_HsTokens {errors_Syn_HsTokens :: (Seq Error),tks_Syn_HsTokens :: ([(Pos,String)]),usedAttrs_Syn_HsTokens :: ([(Identifier,Identifier)]),usedFields_Syn_HsTokens :: (Seq Identifier),usedLocals_Syn_HsTokens :: ([Identifier])}
+data Syn_HsTokens  = Syn_HsTokens {errors_Syn_HsTokens :: (Seq Error),output_Syn_HsTokens :: HsTokens ,tks_Syn_HsTokens :: ([(Pos,String)]),usedAttrs_Syn_HsTokens :: ([(Identifier,Identifier)]),usedFields_Syn_HsTokens :: (Seq Identifier),usedLocals_Syn_HsTokens :: ([Identifier])}
 wrap_HsTokens :: T_HsTokens  ->
                  Inh_HsTokens  ->
                  Syn_HsTokens 
 wrap_HsTokens (T_HsTokens sem ) (Inh_HsTokens _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt )  =
-    (let ( _lhsOerrors,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt 
-     in  (Syn_HsTokens _lhsOerrors _lhsOtks _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
+    (let ( _lhsOerrors,_lhsOoutput,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsIfieldnames _lhsInt 
+     in  (Syn_HsTokens _lhsOerrors _lhsOoutput _lhsOtks _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
 sem_HsTokens_Cons :: T_HsToken  ->
                      T_HsTokens  ->
                      T_HsTokens 
@@ -486,6 +594,7 @@
                           _lhsOusedAttrs :: ([(Identifier,Identifier)])
                           _lhsOusedFields :: (Seq Identifier)
                           _lhsOusedLocals :: ([Identifier])
+                          _lhsOoutput :: HsTokens 
                           _hdOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
                           _hdOallnts :: ([Identifier])
                           _hdOattrs :: ([(Identifier,Identifier)])
@@ -499,122 +608,136 @@
                           _tlOfieldnames :: ([Identifier])
                           _tlOnt :: Identifier
                           _hdIerrors :: (Seq Error)
+                          _hdIoutput :: HsToken 
                           _hdItok :: ((Pos,String))
                           _hdIusedAttrs :: ([(Identifier,Identifier)])
                           _hdIusedFields :: (Seq Identifier)
                           _hdIusedLocals :: ([Identifier])
                           _tlIerrors :: (Seq Error)
+                          _tlIoutput :: HsTokens 
                           _tlItks :: ([(Pos,String)])
                           _tlIusedAttrs :: ([(Identifier,Identifier)])
                           _tlIusedFields :: (Seq Identifier)
                           _tlIusedLocals :: ([Identifier])
-                          -- "SemHsTokens.ag"(line 110, column 10)
+                          -- "SemHsTokens.ag"(line 112, column 10)
                           _lhsOtks =
-                              ({-# LINE 110 "SemHsTokens.ag" #-}
+                              ({-# LINE 112 "SemHsTokens.ag" #-}
                                _hdItok : _tlItks
-                               {-# LINE 516 "SemHsTokens.hs" #-}
+                               {-# LINE 627 "SemHsTokens.hs" #-}
                                )
                           -- use rule "SemHsTokens.ag"(line 43, column 37)
                           _lhsOerrors =
                               ({-# LINE 43 "SemHsTokens.ag" #-}
                                _hdIerrors Seq.>< _tlIerrors
-                               {-# LINE 522 "SemHsTokens.hs" #-}
+                               {-# LINE 633 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 85, column 40)
+                          -- use rule "SemHsTokens.ag"(line 87, column 40)
                           _lhsOusedAttrs =
-                              ({-# LINE 85 "SemHsTokens.ag" #-}
+                              ({-# LINE 87 "SemHsTokens.ag" #-}
                                _hdIusedAttrs ++ _tlIusedAttrs
-                               {-# LINE 528 "SemHsTokens.hs" #-}
+                               {-# LINE 639 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 93, column 40)
+                          -- use rule "SemHsTokens.ag"(line 95, column 40)
                           _lhsOusedFields =
-                              ({-# LINE 93 "SemHsTokens.ag" #-}
+                              ({-# LINE 95 "SemHsTokens.ag" #-}
                                _hdIusedFields Seq.>< _tlIusedFields
-                               {-# LINE 534 "SemHsTokens.hs" #-}
+                               {-# LINE 645 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 84, column 40)
+                          -- use rule "SemHsTokens.ag"(line 86, column 40)
                           _lhsOusedLocals =
-                              ({-# LINE 84 "SemHsTokens.ag" #-}
+                              ({-# LINE 86 "SemHsTokens.ag" #-}
                                _hdIusedLocals ++ _tlIusedLocals
-                               {-# LINE 540 "SemHsTokens.hs" #-}
+                               {-# LINE 651 "SemHsTokens.hs" #-}
                                )
+                          -- self rule
+                          _output =
+                              ({-# LINE 137 "SemHsTokens.ag" #-}
+                               (:) _hdIoutput _tlIoutput
+                               {-# LINE 657 "SemHsTokens.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOoutput =
+                              ({-# LINE 137 "SemHsTokens.ag" #-}
+                               _output
+                               {-# LINE 663 "SemHsTokens.hs" #-}
+                               )
                           -- copy rule (down)
                           _hdOallfields =
                               ({-# LINE 30 "SemHsTokens.ag" #-}
                                _lhsIallfields
-                               {-# LINE 546 "SemHsTokens.hs" #-}
+                               {-# LINE 669 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _hdOallnts =
                               ({-# LINE 31 "SemHsTokens.ag" #-}
                                _lhsIallnts
-                               {-# LINE 552 "SemHsTokens.hs" #-}
+                               {-# LINE 675 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _hdOattrs =
                               ({-# LINE 32 "SemHsTokens.ag" #-}
                                _lhsIattrs
-                               {-# LINE 558 "SemHsTokens.hs" #-}
+                               {-# LINE 681 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _hdOcon =
                               ({-# LINE 29 "SemHsTokens.ag" #-}
                                _lhsIcon
-                               {-# LINE 564 "SemHsTokens.hs" #-}
+                               {-# LINE 687 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _hdOfieldnames =
                               ({-# LINE 36 "SemHsTokens.ag" #-}
                                _lhsIfieldnames
-                               {-# LINE 570 "SemHsTokens.hs" #-}
+                               {-# LINE 693 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _hdOnt =
                               ({-# LINE 29 "SemHsTokens.ag" #-}
                                _lhsInt
-                               {-# LINE 576 "SemHsTokens.hs" #-}
+                               {-# LINE 699 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOallfields =
                               ({-# LINE 30 "SemHsTokens.ag" #-}
                                _lhsIallfields
-                               {-# LINE 582 "SemHsTokens.hs" #-}
+                               {-# LINE 705 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOallnts =
                               ({-# LINE 31 "SemHsTokens.ag" #-}
                                _lhsIallnts
-                               {-# LINE 588 "SemHsTokens.hs" #-}
+                               {-# LINE 711 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOattrs =
                               ({-# LINE 32 "SemHsTokens.ag" #-}
                                _lhsIattrs
-                               {-# LINE 594 "SemHsTokens.hs" #-}
+                               {-# LINE 717 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOcon =
                               ({-# LINE 29 "SemHsTokens.ag" #-}
                                _lhsIcon
-                               {-# LINE 600 "SemHsTokens.hs" #-}
+                               {-# LINE 723 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOfieldnames =
                               ({-# LINE 36 "SemHsTokens.ag" #-}
                                _lhsIfieldnames
-                               {-# LINE 606 "SemHsTokens.hs" #-}
+                               {-# LINE 729 "SemHsTokens.hs" #-}
                                )
                           -- copy rule (down)
                           _tlOnt =
                               ({-# LINE 29 "SemHsTokens.ag" #-}
                                _lhsInt
-                               {-# LINE 612 "SemHsTokens.hs" #-}
+                               {-# LINE 735 "SemHsTokens.hs" #-}
                                )
-                          ( _hdIerrors,_hdItok,_hdIusedAttrs,_hdIusedFields,_hdIusedLocals) =
+                          ( _hdIerrors,_hdIoutput,_hdItok,_hdIusedAttrs,_hdIusedFields,_hdIusedLocals) =
                               hd_ _hdOallfields _hdOallnts _hdOattrs _hdOcon _hdOfieldnames _hdOnt 
-                          ( _tlIerrors,_tlItks,_tlIusedAttrs,_tlIusedFields,_tlIusedLocals) =
+                          ( _tlIerrors,_tlIoutput,_tlItks,_tlIusedAttrs,_tlIusedFields,_tlIusedLocals) =
                               tl_ _tlOallfields _tlOallnts _tlOattrs _tlOcon _tlOfieldnames _tlOnt 
-                      in  ( _lhsOerrors,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                      in  ( _lhsOerrors,_lhsOoutput,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 sem_HsTokens_Nil :: T_HsTokens 
 sem_HsTokens_Nil  =
     (T_HsTokens (\ _lhsIallfields
@@ -628,37 +751,50 @@
                           _lhsOusedAttrs :: ([(Identifier,Identifier)])
                           _lhsOusedFields :: (Seq Identifier)
                           _lhsOusedLocals :: ([Identifier])
-                          -- "SemHsTokens.ag"(line 111, column 10)
+                          _lhsOoutput :: HsTokens 
+                          -- "SemHsTokens.ag"(line 113, column 10)
                           _lhsOtks =
-                              ({-# LINE 111 "SemHsTokens.ag" #-}
+                              ({-# LINE 113 "SemHsTokens.ag" #-}
                                []
-                               {-# LINE 636 "SemHsTokens.hs" #-}
+                               {-# LINE 760 "SemHsTokens.hs" #-}
                                )
                           -- use rule "SemHsTokens.ag"(line 43, column 37)
                           _lhsOerrors =
                               ({-# LINE 43 "SemHsTokens.ag" #-}
                                Seq.empty
-                               {-# LINE 642 "SemHsTokens.hs" #-}
+                               {-# LINE 766 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 85, column 40)
+                          -- use rule "SemHsTokens.ag"(line 87, column 40)
                           _lhsOusedAttrs =
-                              ({-# LINE 85 "SemHsTokens.ag" #-}
+                              ({-# LINE 87 "SemHsTokens.ag" #-}
                                []
-                               {-# LINE 648 "SemHsTokens.hs" #-}
+                               {-# LINE 772 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 93, column 40)
+                          -- use rule "SemHsTokens.ag"(line 95, column 40)
                           _lhsOusedFields =
-                              ({-# LINE 93 "SemHsTokens.ag" #-}
+                              ({-# LINE 95 "SemHsTokens.ag" #-}
                                Seq.empty
-                               {-# LINE 654 "SemHsTokens.hs" #-}
+                               {-# LINE 778 "SemHsTokens.hs" #-}
                                )
-                          -- use rule "SemHsTokens.ag"(line 84, column 40)
+                          -- use rule "SemHsTokens.ag"(line 86, column 40)
                           _lhsOusedLocals =
-                              ({-# LINE 84 "SemHsTokens.ag" #-}
+                              ({-# LINE 86 "SemHsTokens.ag" #-}
                                []
-                               {-# LINE 660 "SemHsTokens.hs" #-}
+                               {-# LINE 784 "SemHsTokens.hs" #-}
                                )
-                      in  ( _lhsOerrors,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                          -- self rule
+                          _output =
+                              ({-# LINE 137 "SemHsTokens.ag" #-}
+                               []
+                               {-# LINE 790 "SemHsTokens.hs" #-}
+                               )
+                          -- self rule
+                          _lhsOoutput =
+                              ({-# LINE 137 "SemHsTokens.ag" #-}
+                               _output
+                               {-# LINE 796 "SemHsTokens.hs" #-}
+                               )
+                      in  ( _lhsOerrors,_lhsOoutput,_lhsOtks,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
 -- HsTokensRoot ------------------------------------------------
 {-
    visit 0:
@@ -670,6 +806,7 @@
          nt                   : Identifier
       synthesized attributes:
          errors               : Seq Error
+         output               : [HsToken]
          textLines            : [String]
          usedAttrs            : [(Identifier,Identifier)]
          usedFields           : [Identifier]
@@ -689,15 +826,15 @@
                                           ([(Identifier,Identifier)]) ->
                                           Identifier ->
                                           Identifier ->
-                                          ( (Seq Error),([String]),([(Identifier,Identifier)]),([Identifier]),([Identifier])))
+                                          ( (Seq Error),([HsToken]),([String]),([(Identifier,Identifier)]),([Identifier]),([Identifier])))
 data Inh_HsTokensRoot  = Inh_HsTokensRoot {allfields_Inh_HsTokensRoot :: ([(Identifier,Type,Maybe (Maybe Type))]),allnts_Inh_HsTokensRoot :: ([Identifier]),attrs_Inh_HsTokensRoot :: ([(Identifier,Identifier)]),con_Inh_HsTokensRoot :: Identifier,nt_Inh_HsTokensRoot :: Identifier}
-data Syn_HsTokensRoot  = Syn_HsTokensRoot {errors_Syn_HsTokensRoot :: (Seq Error),textLines_Syn_HsTokensRoot :: ([String]),usedAttrs_Syn_HsTokensRoot :: ([(Identifier,Identifier)]),usedFields_Syn_HsTokensRoot :: ([Identifier]),usedLocals_Syn_HsTokensRoot :: ([Identifier])}
+data Syn_HsTokensRoot  = Syn_HsTokensRoot {errors_Syn_HsTokensRoot :: (Seq Error),output_Syn_HsTokensRoot :: ([HsToken]),textLines_Syn_HsTokensRoot :: ([String]),usedAttrs_Syn_HsTokensRoot :: ([(Identifier,Identifier)]),usedFields_Syn_HsTokensRoot :: ([Identifier]),usedLocals_Syn_HsTokensRoot :: ([Identifier])}
 wrap_HsTokensRoot :: T_HsTokensRoot  ->
                      Inh_HsTokensRoot  ->
                      Syn_HsTokensRoot 
 wrap_HsTokensRoot (T_HsTokensRoot sem ) (Inh_HsTokensRoot _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsInt )  =
-    (let ( _lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsInt 
-     in  (Syn_HsTokensRoot _lhsOerrors _lhsOtextLines _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
+    (let ( _lhsOerrors,_lhsOoutput,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals) = sem _lhsIallfields _lhsIallnts _lhsIattrs _lhsIcon _lhsInt 
+     in  (Syn_HsTokensRoot _lhsOerrors _lhsOoutput _lhsOtextLines _lhsOusedAttrs _lhsOusedFields _lhsOusedLocals ))
 sem_HsTokensRoot_HsTokensRoot :: T_HsTokens  ->
                                  T_HsTokensRoot 
 sem_HsTokensRoot_HsTokensRoot (T_HsTokens tokens_ )  =
@@ -710,6 +847,7 @@
                               _lhsOusedFields :: ([Identifier])
                               _lhsOtextLines :: ([String])
                               _lhsOerrors :: (Seq Error)
+                              _lhsOoutput :: ([HsToken])
                               _lhsOusedAttrs :: ([(Identifier,Identifier)])
                               _lhsOusedLocals :: ([Identifier])
                               _tokensOallfields :: ([(Identifier,Type,Maybe (Maybe Type))])
@@ -718,6 +856,7 @@
                               _tokensOcon :: Identifier
                               _tokensOnt :: Identifier
                               _tokensIerrors :: (Seq Error)
+                              _tokensIoutput :: HsTokens 
                               _tokensItks :: ([(Pos,String)])
                               _tokensIusedAttrs :: ([(Identifier,Identifier)])
                               _tokensIusedFields :: (Seq Identifier)
@@ -726,68 +865,74 @@
                               _tokensOfieldnames =
                                   ({-# LINE 38 "SemHsTokens.ag" #-}
                                    map (\(n,_,_) -> n) _lhsIallfields
-                                   {-# LINE 730 "SemHsTokens.hs" #-}
+                                   {-# LINE 869 "SemHsTokens.hs" #-}
                                    )
-                              -- "SemHsTokens.ag"(line 100, column 18)
+                              -- "SemHsTokens.ag"(line 102, column 18)
                               _lhsOusedFields =
-                                  ({-# LINE 100 "SemHsTokens.ag" #-}
+                                  ({-# LINE 102 "SemHsTokens.ag" #-}
                                    toList _tokensIusedFields
-                                   {-# LINE 736 "SemHsTokens.hs" #-}
+                                   {-# LINE 875 "SemHsTokens.hs" #-}
                                    )
-                              -- "SemHsTokens.ag"(line 107, column 18)
+                              -- "SemHsTokens.ag"(line 109, column 18)
                               _lhsOtextLines =
-                                  ({-# LINE 107 "SemHsTokens.ag" #-}
+                                  ({-# LINE 109 "SemHsTokens.ag" #-}
                                    showTokens _tokensItks
-                                   {-# LINE 742 "SemHsTokens.hs" #-}
+                                   {-# LINE 881 "SemHsTokens.hs" #-}
                                    )
                               -- use rule "SemHsTokens.ag"(line 18, column 18)
                               _lhsOerrors =
                                   ({-# LINE 18 "SemHsTokens.ag" #-}
                                    _tokensIerrors
-                                   {-# LINE 748 "SemHsTokens.hs" #-}
+                                   {-# LINE 887 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (up)
+                              _lhsOoutput =
+                                  ({-# LINE 136 "SemHsTokens.ag" #-}
+                                   _tokensIoutput
+                                   {-# LINE 893 "SemHsTokens.hs" #-}
+                                   )
+                              -- copy rule (up)
                               _lhsOusedAttrs =
                                   ({-# LINE 20 "SemHsTokens.ag" #-}
                                    _tokensIusedAttrs
-                                   {-# LINE 754 "SemHsTokens.hs" #-}
+                                   {-# LINE 899 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (up)
                               _lhsOusedLocals =
                                   ({-# LINE 19 "SemHsTokens.ag" #-}
                                    _tokensIusedLocals
-                                   {-# LINE 760 "SemHsTokens.hs" #-}
+                                   {-# LINE 905 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (down)
                               _tokensOallfields =
                                   ({-# LINE 30 "SemHsTokens.ag" #-}
                                    _lhsIallfields
-                                   {-# LINE 766 "SemHsTokens.hs" #-}
+                                   {-# LINE 911 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (down)
                               _tokensOallnts =
                                   ({-# LINE 31 "SemHsTokens.ag" #-}
                                    _lhsIallnts
-                                   {-# LINE 772 "SemHsTokens.hs" #-}
+                                   {-# LINE 917 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (down)
                               _tokensOattrs =
                                   ({-# LINE 32 "SemHsTokens.ag" #-}
                                    _lhsIattrs
-                                   {-# LINE 778 "SemHsTokens.hs" #-}
+                                   {-# LINE 923 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (down)
                               _tokensOcon =
                                   ({-# LINE 29 "SemHsTokens.ag" #-}
                                    _lhsIcon
-                                   {-# LINE 784 "SemHsTokens.hs" #-}
+                                   {-# LINE 929 "SemHsTokens.hs" #-}
                                    )
                               -- copy rule (down)
                               _tokensOnt =
                                   ({-# LINE 29 "SemHsTokens.ag" #-}
                                    _lhsInt
-                                   {-# LINE 790 "SemHsTokens.hs" #-}
+                                   {-# LINE 935 "SemHsTokens.hs" #-}
                                    )
-                              ( _tokensIerrors,_tokensItks,_tokensIusedAttrs,_tokensIusedFields,_tokensIusedLocals) =
+                              ( _tokensIerrors,_tokensIoutput,_tokensItks,_tokensIusedAttrs,_tokensIusedFields,_tokensIusedLocals) =
                                   tokens_ _tokensOallfields _tokensOallnts _tokensOattrs _tokensOcon _tokensOfieldnames _tokensOnt 
-                          in  ( _lhsOerrors,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
+                          in  ( _lhsOerrors,_lhsOoutput,_lhsOtextLines,_lhsOusedAttrs,_lhsOusedFields,_lhsOusedLocals))) )
diff --git a/src-derived/TfmToVisage.hs b/src-derived/TfmToVisage.hs
--- a/src-derived/TfmToVisage.hs
+++ b/src-derived/TfmToVisage.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (TfmToVisage.ag)
+-- UUAGC 0.9.38.6 (TfmToVisage.ag)
 module TfmToVisage where
 {-# LINE 8 "TfmToVisage.ag" #-}
 
diff --git a/src-derived/Transform.hs b/src-derived/Transform.hs
--- a/src-derived/Transform.hs
+++ b/src-derived/Transform.hs
@@ -1,7194 +1,7197 @@
 
 
--- UUAGC 0.9.38.2 (Transform.ag)
-module Transform where
-{-# LINE 8 "Transform.ag" #-}
-
-import Control.Monad(mplus,mzero)
-import List (partition, elem, nub,intersperse)
-import Data.Maybe
-import qualified Data.Map as Map
-import Data.Map (Map)
-import Data.Set as Set (Set, member, union, toList, fromList, empty, singleton, member, unions, size, fold, intersection, difference, insert)
-import qualified Data.Sequence as Seq
-import Data.Sequence(Seq, empty, (><),fromList)
-import Data.Foldable(toList)
-import UU.Scanner.Position(noPos)
-
-import ConcreteSyntax
-import AbstractSyntax
-import ErrorMessages
-import Patterns (Patterns(..),Pattern(..))
-import Expression (Expression(..))
-import HsToken
-
-import Options
-import CommonTypes
-import RhsCheck
-{-# LINE 29 "../src-derived/Transform.hs" #-}
-
-{-# LINE 2 "./ConcreteSyntax.ag" #-}
-
-import UU.Scanner.Position (Pos)
-import Patterns   (Pattern)
-import Expression (Expression)
-import CommonTypes
-{-# LINE 37 "../src-derived/Transform.hs" #-}
-
-{-# LINE 2 "./Patterns.ag" #-}
-
--- Patterns.ag imports
-import UU.Scanner.Position(Pos)
-import CommonTypes (ConstructorIdent,Identifier)
-{-# LINE 44 "../src-derived/Transform.hs" #-}
-{-# LINE 102 "Transform.ag" #-}
-type DefinedSets = Map Identifier (Set NontermIdent) 
-{-# LINE 47 "../src-derived/Transform.hs" #-}
-
-{-# LINE 122 "Transform.ag" #-}
-type FieldMap  = [(Identifier, Type)] 
-{-# LINE 51 "../src-derived/Transform.hs" #-}
-
-{-# LINE 123 "Transform.ag" #-}
-type DataTypes = Map.Map NontermIdent (Map.Map ConstructorIdent FieldMap) 
-{-# LINE 55 "../src-derived/Transform.hs" #-}
-
-{-# LINE 143 "Transform.ag" #-}
-type AttrName   = (Identifier,Identifier) 
-{-# LINE 59 "../src-derived/Transform.hs" #-}
-
-{-# LINE 144 "Transform.ag" #-}
-type RuleInfo   = (Maybe Identifier, [AttrName]->Pattern, Expression, [AttrName], Bool, String) 
-{-# LINE 63 "../src-derived/Transform.hs" #-}
-
-{-# LINE 145 "Transform.ag" #-}
-type SigInfo    = (Identifier,Type) 
-{-# LINE 67 "../src-derived/Transform.hs" #-}
-
-{-# LINE 146 "Transform.ag" #-}
-type UniqueInfo = (Identifier,Identifier) 
-{-# LINE 71 "../src-derived/Transform.hs" #-}
-
-{-# LINE 147 "Transform.ag" #-}
-type AugmentInfo = (Identifier,Expression)
-{-# LINE 75 "../src-derived/Transform.hs" #-}
-
-{-# LINE 148 "Transform.ag" #-}
-type AroundInfo  = (Identifier,Expression)
-{-# LINE 79 "../src-derived/Transform.hs" #-}
-
-{-# LINE 149 "Transform.ag" #-}
-type MergeInfo   = (Identifier, Identifier, [Identifier], Expression)
-{-# LINE 83 "../src-derived/Transform.hs" #-}
-
-{-# LINE 203 "Transform.ag" #-}
-
-
-checkDuplicate :: (Identifier -> Identifier -> Error)
-               -> Identifier -> val -> Map Identifier val -> (Map Identifier val,Seq Error)
-checkDuplicate dupError key val m
-  = case Map.lookupIndex key m of
-     Just ix -> let (key',_) = Map.elemAt ix m
-                in  (m,Seq.singleton (dupError key key'))
-     Nothing -> (Map.insert key val m,Seq.empty)
-
-checkDuplicates :: (Identifier -> Identifier -> Error)
-                -> [(Identifier, val)] -> Map Identifier val -> (Map Identifier val,Seq Error)
-checkDuplicates dupError new m = foldErrors check m new
- where  check = uncurry (checkDuplicate dupError)
-
-foldErrors f e xs = foldl g (e,Seq.empty) xs
-  where g ~(e,es) x = let (e',es') = f x e
-                      in (e', es >< es')
-
-
-checkForDuplicates :: (Identifier -> Identifier -> Error)  ->  [Identifier]  ->  [Error]
-checkForDuplicates err [] = []
-checkForDuplicates err (x:xs) = let (same,other) = List.partition (equalId x) xs
-                                in  map (err x) same ++ checkForDuplicates err other
-
-equalId :: Identifier -> Identifier -> Bool
-equalId x y = getName x == getName y
-
-{-# LINE 114 "../src-derived/Transform.hs" #-}
-
-{-# LINE 339 "Transform.ag" #-}
-
-type RulesAndErrors = ([Rule], Seq Error)
-type SigsAndErrors  = ([TypeSig], Seq Error)
-type InstsAndErrors = ([(Identifier, Type)], Seq Error)
-type UniquesAndErrors = (Map Identifier Identifier, Seq Error)
-type AugmentsAndErrors = (Map Identifier [Expression], Seq Error)
-type AroundsAndErrors = (Map Identifier [Expression], Seq Error)
-type MergesAndErrors  = (Map Identifier (Identifier, [Identifier], Expression), Seq Error)
-type AttrOverwrite  = Map AttrName Bool
-type AccumRuleCheck = (RulesAndErrors, AttrOverwrite)
-type AccumDefiCheck = (Seq Error, AttrOverwrite, [AttrName], [AttrName])
-
-checkRules :: Map NontermIdent (Attributes, Attributes) -> Map NontermIdent (Map ConstructorIdent FieldMap) ->
-              Map NontermIdent (Map ConstructorIdent [Identifier]) -> Map NontermIdent (Map ConstructorIdent [SigInfo]) ->
-              Map NontermIdent (Map ConstructorIdent [MergeInfo]) ->
-              NontermIdent -> ConstructorIdent -> [RuleInfo] -> RulesAndErrors
-checkRules attributes fields allinsts allsigs allmerges nt con rs
-  = let fieldmap :: FieldMap
-        fieldmap = (_LHS,NT nt undefined) : (_LOC,NT undefined undefined) : (_INST, NT undefined undefined) : (_FIRST, NT undefined undefined) : (_LAST, NT undefined undefined)
-                 : Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fields)
-                 ++ mapMaybe (\instNm -> lookup instNm sigs >>= \tp -> return (instNm, tp)) (Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allinsts))
-                 --   merged children are not allowed to have any inherited attrs defined: do not include
-
-        sigs = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allsigs)
-
-        hasAttrib f tp attr  = Map.member attr (f (Map.findWithDefault (Map.empty,Map.empty) tp attributes))
-
-        checkRule :: RuleInfo -> AccumRuleCheck -> AccumRuleCheck
-        checkRule (mbNm, pat,exp,as,owrt,str) ((r1,e1),m1)
-          = let (e2,m2,u2,b2) = foldr (checkDefi owrt) (e1,m1,[],[]) as
-            in  ( (Rule mbNm (pat u2) exp owrt str True : r1, e2), m2)
-
-        checkDefi :: Bool -> AttrName -> AccumDefiCheck -> AccumDefiCheck
-        checkDefi owrt fa@(field,attr) (e,m,u,bs)
-         = case lookup field fieldmap
-            of  Just (NT tp _) ->
-                  let tp' = maybe tp id (deforestedNt tp)
-                  in              if field == _LOC || field == _INST || field == _FIRST || field == _LAST
-                                     || hasAttrib (if getName field==getName _LHS then snd else fst) tp' attr
-                                  then case Map.lookupIndex fa m of
-                                           Just ix -> let ((_,attr2),b) = Map.elemAt ix m
-                                                       in  if b && not (fa `elem` bs)
-                                                           then (                                             e, Map.insert fa owrt m, fa:u, fa:bs)
-                                                           else (((Seq.<|)) (DupRule nt con field attr2 attr)   e,                    m, fa:u,    bs)
-                                           Nothing ->           (                                             e, Map.insert fa owrt m,    u, fa:bs)
-                                  else                          (((Seq.<|)) (SuperfluousRule nt con field attr) e,                    m, fa:u,    bs)
-                _              ->                               (((Seq.<|)) (UndefChild nt con field)           e,                    m, fa:u,    bs )
-
-    in  fst (foldr checkRule (([],Seq.empty),Map.empty) rs)
-
-checkRuleNames :: NontermIdent -> ConstructorIdent -> [RuleInfo] -> Seq Error
-checkRuleNames nt con
-  = fst . foldr checkRule (Seq.empty, Set.empty)
-  where
-    checkRule (Just nm,_,_,_,_,_) (errs, nms)
-      | nm `Set.member` nms = (DupRuleName nt con nm Seq.<| errs, nms)
-      | otherwise           = (errs, Set.insert nm nms)
-    checkRule (Nothing,_,_,_,_,_) inp = inp
-
-checkSigs :: NontermIdent -> ConstructorIdent -> [SigInfo] -> SigsAndErrors
-checkSigs nt con sis
-  = let checkSig (ide,typ) (sigs,errs)
-         = if   ide `elem` map (\(TypeSig n t)-> n) sigs
-           then (sigs, ((Seq.<|)) (DupSig nt con ide) errs)
-           -- else if not (ide `elem` locattrdefs)
-           -- then (sigs, ((Seq.<|)) (SupSig nt con ide) errs)
-           else (TypeSig ide typ:sigs, errs)
-    in  foldr checkSig ([],Seq.empty) sis
-
-checkInsts :: Set NontermIdent -> Map NontermIdent (Map ConstructorIdent [SigInfo]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [Identifier] -> InstsAndErrors
-checkInsts allNts sigMap fieldMap nt con
-  = foldr (\inst (insts, errs) ->
-              maybe (insts, Seq.singleton (MissingInstSig nt con inst) >< errs)
-                    (\info@(k, NT nm _) ->
-                      case findInst k insts of
-                        Just k' -> (insts, Seq.singleton (DupChild nt con k k') >< errs)
-                        Nothing -> case nm `Set.member` allNts of
-                                             True  -> (info : insts, errs)
-                                             False | take 2 (getName nm) == "T_" -> let nm' = Ident (drop 2 (getName nm)) (getPos nm)
-                                                                                    in case nm' `Set.member` allNts of
-                                                                                         True  -> (info : insts, errs)
-                                                                                         False -> (insts, Seq.singleton (UndefNont nm') >< errs)
-                                                   | otherwise                   -> (insts, Seq.singleton (UndefNont nm) >< errs)
-                    )
-                  $ findSig inst
-          ) ([], Seq.empty)
-  where
-    sigs = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt sigMap)
-
-    findSig name
-      = do tp@(NT _ _) <- lookup name sigs
-           return (name, tp)
-
-    findInst _ [] = Nothing
-    findInst k ((k', _): r)
-      | k == k'   = Just k'
-      | otherwise = findInst k r
-
-checkUniques :: Map NontermIdent (Attributes, Attributes) -> NontermIdent -> ConstructorIdent -> [UniqueInfo] -> UniquesAndErrors
-checkUniques allAttrs nt con uniques
-  = let checkUnique (ident,ref) (us,errs)
-          = if ident `Map.member` us
-            then (us, ((Seq.<|)) (DupUnique nt con ident) errs)
-            else if Map.member ref inhs && Map.member ref syns
-                 then (Map.insert ident ref us, errs)
-                 else (us, ((Seq.<|)) (MissingUnique nt ref) errs)
-
-        (inhs,syns) = Map.findWithDefault (Map.empty,Map.empty) nt allAttrs
-    in foldr checkUnique (Map.empty, Seq.empty) uniques
-
-checkAugments :: Map NontermIdent (Attributes, Attributes) -> NontermIdent -> ConstructorIdent -> [AugmentInfo] -> AugmentsAndErrors
-checkAugments allAttrs nt con augments
-  = let checkAugment (ident,expr) (as,errs)
-          = if ident `Map.member` as
-            then (Map.update (\vs -> Just (vs ++ [expr])) ident as, errs)
-            else if Map.member ident syns
-                 then (Map.insert ident [expr] as, errs)
-                 else (as, ((Seq.<|)) (MissingSyn nt ident) errs)
-
-        (inhs,syns) = Map.findWithDefault (Map.empty,Map.empty) nt allAttrs
-    in foldr checkAugment (Map.empty, Seq.empty) augments
-
-checkArounds :: Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [AroundInfo] -> AroundsAndErrors
-checkArounds fieldMap nt con arounds
-  = let checkAround (ident,expr) (as,errs)
-          = if ident `Map.member` as
-            then (Map.update (\vs -> Just (vs ++ [expr])) ident as, errs)
-            else case lookup ident fields of
-                   Just (NT _ _) -> (Map.insert ident [expr] as, errs)
-                   _             -> (as, ((Seq.<|)) (UndefChild nt con ident) errs)
-        fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fieldMap)
-    in foldr checkAround (Map.empty, Seq.empty) arounds
-
-checkMerges :: Set NontermIdent -> Map NontermIdent (Map ConstructorIdent [Identifier]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [MergeInfo] -> MergesAndErrors
-checkMerges allNts allInsts fieldMap nt con merges
-  = let checkMerge (target,nt,sources,expr) (m,errs)
-          = let fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fieldMap)
-                insts  = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allInsts)
-                allFields = insts ++ map fst fields   -- note: sources of merge may not contain a target (for simplicity)
-            in if target `Map.member` m   -- check for duplicate with self
-               then (m, DupChild nt con target (fst $ Map.elemAt (Map.findIndex target m) m) Seq.<| errs)
-               else if target `elem` allFields
-                     then (m, DupChild nt con target (head $ filter (== target) allFields) Seq.<| errs)
-                     else let missing = filter (\s -> not (s `elem` allFields)) sources
-                          in if null missing
-                             then if nt `Set.member` allNts   -- check if the nonterm is defined
-                                  then (Map.insert target (nt, sources, expr) m, errs) -- all ok..
-                                  else (m, UndefNont nt Seq.<| errs)
-                             else (m, (Seq.fromList $ map (UndefChild nt con) missing) Seq.>< errs)
-    in foldr checkMerge (Map.empty, Seq.empty) merges
-
-unionunionplusplus = Map.unionWith (Map.unionWith (++))
-{-# LINE 269 "../src-derived/Transform.hs" #-}
-
-{-# LINE 494 "Transform.ag" #-}
-
-mkUniqueRules :: Options -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> Map NontermIdent (Attributes,Attributes) -> NontermIdent -> ConstructorIdent -> Map Identifier Identifier -> [Rule]
-mkUniqueRules opts allFields allInsts allAttrDecls nt con usMap
-  = map apply groups
-  where
-    fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allFields)
-             ++ Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allInsts)
-             -- may have duplicates
-
-    groups = Map.assocs $ Map.foldrWithKey (\i r m -> Map.insertWith (++) r [i] m) Map.empty usMap
-    apply (ref,us) = mkRule ref (findOutField ref) us
-    findOutField ref = case [ chld | (chld,NT tp _) <- fields, tp `hasSyn` ref] of
-                         []    -> _LHS
-                         (x:_) -> x
-    hasSyn tp ref = Map.member ref $ snd $ Map.findWithDefault (Map.empty,Map.empty) tp allAttrDecls
-    mkRule ref outFld locAttrs
-      = let pat = Product noPos (attr outFld ref : [attr _LOC u | u <- locAttrs ])
-            rhs = Expression noPos $ wrap ref $ foldr gencase (finalout locAttrs) locAttrs
-                     -- [HsToken ("mkUniques" ++ show (length locAttrs) ++ " ") noPos, AGField _LHS ref noPos Nothing]
-        in Rule Nothing pat rhs False "-- generated by the unique rule mechanism." False
-    attr fld a = Alias fld a (Underscore noPos) []
-    gencase nm outp
-      = h ("case " ++ uniqueDispenser opts ++ " __cont of { (__cont, " ++ getName nm ++ ") -> ") ++ outp ++ h "}"
-    h s = [HsToken s noPos]
-    finalout us = h ("(__cont, " ++ concat (intersperse "," (map getName us)) ++ ")")
-    wrap ref inp = h "let __cont = " ++ [AGField _LHS ref noPos Nothing] ++ h " in seq __cont ( " ++ inp ++ h " )"
-{-# LINE 298 "../src-derived/Transform.hs" #-}
-
-{-# LINE 692 "Transform.ag" #-}
-
-flattenDatas :: DataTypes -> Map NontermIdent (Set NontermIdent)
-flattenDatas ds = Map.map flatten ds
-  where flatten cs =  Set.fromList [ nt | (_,NT nt _) <- concatMap snd (Map.toList cs)]
-
-reachableFrom :: Map NontermIdent (Set NontermIdent) -> Set NontermIdent -> Set NontermIdent
-reachableFrom table nts = reach nts
-  where reach nts = let nts' = Set.unions (nts : [ ns  | nt <- Set.toList nts
-                                                 , let ns = Map.findWithDefault Set.empty nt table ])
-                    in if Set.size nts' > Set.size nts
-                          then reach nts'
-                          else nts
-invert :: Map NontermIdent (Set NontermIdent) -> Map NontermIdent (Set NontermIdent)
-invert m = foldr inv Map.empty (Map.toList m)
-  where inv (x,ns) m = fold (\n m -> Map.insertWith Set.union n (Set.singleton x) m) m ns
-
-path :: Map NontermIdent (Set NontermIdent) -> NontermIdent -> NontermIdent -> Set NontermIdent
-path table from to = let children = Map.findWithDefault Set.empty from table
-                         forward  = reachableFrom table children
-                         backward = reachableFrom (invert table)
-                                                  (Set.singleton to)
-                     in  Set.intersection forward backward
-{-# LINE 323 "../src-derived/Transform.hs" #-}
-
-{-# LINE 809 "Transform.ag" #-}
-
-pragmaMapUnion :: PragmaMap -> PragmaMap -> PragmaMap
-pragmaMapUnion = Map.unionWith (Map.unionWith Set.union)
-
-pragmaMapSingle :: NontermIdent -> ConstructorIdent -> Set Identifier -> PragmaMap
-pragmaMapSingle nt con nms = Map.singleton nt (Map.singleton con nms)
-{-# LINE 332 "../src-derived/Transform.hs" #-}
-
-{-# LINE 841 "Transform.ag" #-}
-
-orderMapUnion :: AttrOrderMap -> AttrOrderMap -> AttrOrderMap
-orderMapUnion = Map.unionWith (Map.unionWith Set.union)
-
-orderMapSingle :: NontermIdent -> ConstructorIdent -> Set Dependency -> AttrOrderMap
-orderMapSingle nt con deps = Map.singleton nt (Map.singleton con deps)
-{-# LINE 341 "../src-derived/Transform.hs" #-}
-
-{-# LINE 867 "Transform.ag" #-}
-
-mergeParams :: ParamMap -> ParamMap -> ParamMap
-mergeParams = Map.unionWith (++)
-{-# LINE 347 "../src-derived/Transform.hs" #-}
-
-{-# LINE 890 "Transform.ag" #-}
-
-mergeCtx :: ContextMap -> ContextMap -> ContextMap
-mergeCtx
-  = Map.unionWith nubconcat
-  where nubconcat a b = nub (a ++ b)
-{-# LINE 355 "../src-derived/Transform.hs" #-}
-
-{-# LINE 909 "Transform.ag" #-}
-
-mergeQuant :: QuantMap -> QuantMap -> QuantMap
-mergeQuant = Map.unionWith (++)
-{-# LINE 361 "../src-derived/Transform.hs" #-}
-
-{-# LINE 920 "Transform.ag" #-}
-
-mergeDerivings m1 m2 = foldr (\(n,cs) m -> Map.insertWith Set.union n cs m) m2 (Map.toList m1)
-{-# LINE 366 "../src-derived/Transform.hs" #-}
-
-{-# LINE 931 "Transform.ag" #-}
-
-merge x y = foldr f y (Map.toList x)
- where f ~(k,v) m = Map.insertWith (Map.union) k v m
-{-# LINE 372 "../src-derived/Transform.hs" #-}
-
-{-# LINE 972 "Transform.ag" #-}
-
-checkAttrs allFields nts inherited synthesized decls = foldErrors check decls nts where
-  check nt decls | not (nt `Map.member` allFields) = (decls,Seq.singleton(UndefNont nt))
-                 | otherwise = let (inh,syn) = Map.findWithDefault (Map.empty,Map.empty) nt decls
-                                   (inh',einh) = checkDuplicates (DupInhAttr nt) inherited   inh
-                                   (syn',esyn) = checkDuplicates (DupSynAttr nt) synthesized syn
-                               in (Map.insert nt (inh',syn') decls,einh >< esyn)
-{-# LINE 382 "../src-derived/Transform.hs" #-}
-
-{-# LINE 983 "Transform.ag" #-}
-
-addSelf name atMap = let (eInh,eSyn) = Map.findWithDefault(Map.empty,Map.empty) name atMap
-                     in  Map.insert name (eInh, Map.insert (Ident "self" noPos) (NT _SELF []) eSyn)atMap
-{-# LINE 388 "../src-derived/Transform.hs" #-}
-
-{-# LINE 1124 "Transform.ag" #-}
-
-makeType :: Set NontermIdent -> Type -> Type
-makeType nts tp@(NT x _) | x == _SELF       = tp
-                         | Set.member x nts = tp
-                         | otherwise        = Haskell (typeToHaskellString Nothing [] tp)
-makeType _   tp                             = tp
-{-# LINE 397 "../src-derived/Transform.hs" #-}
-
-{-# LINE 1131 "Transform.ag" #-}
-
-constructGrammar ::    Set NontermIdent
-                    -> ParamMap
-                    -> DataTypes
-                    -> Map NontermIdent (Attributes, Attributes)
-                    -> Map NontermIdent (Map Identifier (String, String, String))
-                    -> Derivings
-                    -> Set NontermIdent
-                    -> Map NontermIdent (Map ConstructorIdent [Rule])
-                    -> Map NontermIdent (Map ConstructorIdent [TypeSig])
-                    -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)])
-                    -> TypeSyns
-                    -> PragmaMap
-                    -> AttrOrderMap
-                    -> ContextMap
-                    -> QuantMap
-                    -> UniqueMap
-                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
-                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
-                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))
-                    -> Grammar
-
-constructGrammar nts ntParams gram attrs uses derivings wrappers allrules tsigs allinsts tsyns pragmaMap orderMap contextMap quantMap uniqueMap augmentsMap aroundsMap mergeMap =
-   let gr = [ (nt,Map.toList alts) | (nt,alts) <- Map.toList gram]
-       nonts = map nont gr
-       nont (nt,alts) =  let (inh,syn) = Map.findWithDefault (Map.empty,Map.empty) nt attrs
-                             rmap      = Map.findWithDefault Map.empty             nt allrules
-                             tsmap     = Map.findWithDefault Map.empty             nt tsigs
-                             instsmap  = Map.findWithDefault Map.empty             nt allinsts
-                             params    = Map.findWithDefault []                    nt ntParams
-                             mergemap  = Map.findWithDefault Map.empty             nt mergeMap
-                             alt (con,flds) =
-                                   let rules = maybe [] id (Map.lookup con rmap)
-                                       tsigs = maybe [] id (Map.lookup con tsmap)
-                                       insts = maybe [] id (Map.lookup con instsmap)
-                                       merges = [ (n, NT t []) | (n, (t, _, _)) <- Map.assocs $ maybe Map.empty id (Map.lookup con mergemap) ]
-
-                                       -- important: keep order of children
-                                       cldrn = map child (flds ++ filter (not . existsAsField) insts ++ merges)
-                                       child (nm, tp) =
-                                          let tpI = if existsAsInst nm
-                                                    then fromJust $ lookup nm insts
-                                                    else tp
-                                              (inh,syn) = case tpI of
-                                                 NT nt _ -> let nt' = maybe nt id (deforestedNt nt)
-                                                            in Map.findWithDefault (Map.empty,Map.empty) nt' attrs
-                                                 _       -> (Map.empty,Map.empty)
-                                              virt = if existsAsInst nm
-                                                     then case lookup nm flds of
-                                                            Just tp' -> Just (Just tp')
-                                                            Nothing  -> Just Nothing
-                                                     else if existsAsMerge nm
-                                                          then (Just Nothing)
-                                                          else Nothing
-                                          in Child nm tpI inh syn virt
-                                       existsAsInst nm = maybe False (const True) (lookup nm insts)
-                                       existsAsField (nm,_) = maybe False (const True) (lookup nm flds)
-                                       existsAsMerge nm = maybe False (const True) (lookup nm merges)
-                                   in Production con cldrn rules tsigs
-                            in Nonterminal nt params inh syn (map alt alts)
-   in Grammar tsyns uses derivings wrappers nonts pragmaMap orderMap ntParams contextMap quantMap uniqueMap augmentsMap aroundsMap mergeMap
-{-# LINE 461 "../src-derived/Transform.hs" #-}
-
-{-# LINE 1194 "Transform.ag" #-}
-
-mapUnionWithSetUnion = Map.unionWith Set.union
-mapUnionWithPlusPlus = Map.unionWith (++)
-{-# LINE 467 "../src-derived/Transform.hs" #-}
--- AG ----------------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         options              : Options
-      synthesized attributes:
-         blocks               : Blocks
-         errors               : Seq Error
-         moduleDecl           : Maybe (String,String,String)
-         output               : Grammar
-         pragmas              : Options -> Options
-   alternatives:
-      alternative AG:
-         child elems          : Elems 
-         visit 0:
-            local allFields   : _
-            local allConstrs  : _
-            local allRules    : _
-            local allSigs     : _
-            local allInsts    : _
-            local allUniques  : _
-            local allAugments : _
-            local allArounds  : _
-            local allMerges   : _
-            local augmentSigs : _
-            local allRulesErrs : _
-            local allNamesErrs : _
-            local allSigsErrs : _
-            local allInstsErrs : _
-            local allUniquesErrs : _
-            local allAugmentErrs : _
-            local allAroundsErrs : _
-            local allMergesErrs : _
-            local checkedRulesPre : _
-            local checkedSigs : _
-            local checkedInsts : _
-            local checkedUniques : _
-            local checkedAugments : _
-            local checkedArounds : _
-            local checkedRules : _
-            local checkedMerges : _
-            local errs1       : _
-            local errs2       : _
-            local errs3       : _
-            local errs4       : _
-            local errs5       : _
-            local errs6       : _
-            local errs7       : _
-            local errs8       : _
-            local errs9       : _
-            local errs10      : _
-            local errs11      : _
-            local allNonterminals : _
-            local allAttrDecls : _
--}
--- cata
-sem_AG :: AG  ->
-          T_AG 
-sem_AG (AG _elems )  =
-    (sem_AG_AG (sem_Elems _elems ) )
--- semantic domain
-newtype T_AG  = T_AG (Options ->
-                      ( Blocks,(Seq Error),(Maybe (String,String,String)),Grammar,(Options -> Options)))
-data Inh_AG  = Inh_AG {options_Inh_AG :: !(Options)}
-data Syn_AG  = Syn_AG {blocks_Syn_AG :: !(Blocks),errors_Syn_AG :: !((Seq Error)),moduleDecl_Syn_AG :: !((Maybe (String,String,String))),output_Syn_AG :: !(Grammar),pragmas_Syn_AG :: !((Options -> Options))}
-wrap_AG :: T_AG  ->
-           Inh_AG  ->
-           Syn_AG 
-wrap_AG (T_AG sem ) (Inh_AG _lhsIoptions )  =
-    (let ( _lhsOblocks,_lhsOerrors,_lhsOmoduleDecl,_lhsOoutput,_lhsOpragmas) = sem _lhsIoptions 
-     in  (Syn_AG _lhsOblocks _lhsOerrors _lhsOmoduleDecl _lhsOoutput _lhsOpragmas ))
-sem_AG_AG :: T_Elems  ->
-             T_AG 
-sem_AG_AG (T_Elems elems_ )  =
-    (T_AG (\ _lhsIoptions ->
-               (let _lhsOoutput :: Grammar
-                    _lhsOerrors :: (Seq Error)
-                    _elemsOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                    _elemsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                    _elemsOdefinedSets :: DefinedSets
-                    _elemsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                    _lhsOblocks :: Blocks
-                    _lhsOmoduleDecl :: (Maybe (String,String,String))
-                    _lhsOpragmas :: (Options -> Options)
-                    _elemsOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                    _elemsOallFields :: DataTypes
-                    _elemsOallNonterminals :: (Set NontermIdent)
-                    _elemsOoptions :: Options
-                    _elemsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                    _elemsIattrOrderCollect :: AttrOrderMap
-                    _elemsIblocks :: Blocks
-                    _elemsIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                    _elemsIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                    _elemsIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                    _elemsIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                    _elemsIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                    _elemsIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                    _elemsIcollectedNames :: (Set Identifier)
-                    _elemsIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                    _elemsIcollectedSetNames :: (Set Identifier)
-                    _elemsIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                    _elemsIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                    _elemsIctxCollect :: ContextMap
-                    _elemsIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                    _elemsIderivings :: Derivings
-                    _elemsIerrors :: (Seq Error)
-                    _elemsImoduleDecl :: (Maybe (String,String,String))
-                    _elemsIparamsCollect :: ParamMap
-                    _elemsIpragmas :: (Options -> Options)
-                    _elemsIquantCollect :: QuantMap
-                    _elemsIsemPragmasCollect :: PragmaMap
-                    _elemsItypeSyns :: TypeSyns
-                    _elemsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                    _elemsIwrappers :: (Set NontermIdent)
-                    -- "Transform.ag"(line 52, column 8)
-                    _lhsOoutput =
-                        ({-# LINE 52 "Transform.ag" #-}
-                         constructGrammar _allNonterminals
-                                          _elemsIparamsCollect
-                                          _allFields
-                                          _allAttrDecls
-                                          _elemsIuseMap
-                                          _elemsIderivings
-                                          (if wrappers _lhsIoptions then _allNonterminals     else _elemsIwrappers)
-                                          _checkedRules
-                                          _checkedSigs
-                                          _checkedInsts
-                                          _elemsItypeSyns
-                                          _elemsIsemPragmasCollect
-                                          _elemsIattrOrderCollect
-                                          _elemsIctxCollect
-                                          _elemsIquantCollect
-                                          _checkedUniques
-                                          _checkedAugments
-                                          _checkedArounds
-                                          _checkedMerges
-                         {-# LINE 604 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 254, column 10)
-                    _allFields =
-                        ({-# LINE 254 "Transform.ag" #-}
-                         let f (nt,con,fm) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con fm)
-                         in  foldr f (Map.empty) _elemsIcollectedFields
-                         {-# LINE 611 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 257, column 10)
-                    _allConstrs =
-                        ({-# LINE 257 "Transform.ag" #-}
-                         let f (nt,con,_) = Map.insertWith (++) nt [con]
-                         in  foldr f (Map.empty) _elemsIcollectedFields
-                         {-# LINE 618 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 260, column 10)
-                    _allRules =
-                        ({-# LINE 260 "Transform.ag" #-}
-                         let f (nt,con,r) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con [r])
-                         in  foldr f (Map.empty) _elemsIcollectedRules
-                         {-# LINE 625 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 263, column 10)
-                    _allSigs =
-                        ({-# LINE 263 "Transform.ag" #-}
-                         let f (nt,con,t) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con [t])
-                             typeof nt r = Map.findWithDefault (Haskell "<unknown>") r $ fst $ Map.findWithDefault (Map.empty,Map.empty) nt _allAttrDecls
-                         in  foldr f (Map.empty) ( _elemsIcollectedSigs
-                                                 ++ [ (nt, con, (ident,typeof nt ref))  | (nt, con, us) <- _elemsIcollectedUniques, (ident,ref) <- us ]
-                                                 )
-                         {-# LINE 635 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 269, column 10)
-                    _allInsts =
-                        ({-# LINE 269 "Transform.ag" #-}
-                         let f (nt,con,is) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con is)
-                         in  foldr f (Map.empty) _elemsIcollectedInsts
-                         {-# LINE 642 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 272, column 10)
-                    _allUniques =
-                        ({-# LINE 272 "Transform.ag" #-}
-                         let f (nt,con,us) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con us)
-                         in foldr f (Map.empty) _elemsIcollectedUniques
-                         {-# LINE 649 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 274, column 10)
-                    _allAugments =
-                        ({-# LINE 274 "Transform.ag" #-}
-                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
-                         in foldr f Map.empty _elemsIcollectedAugments
-                         {-# LINE 656 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 276, column 10)
-                    _allArounds =
-                        ({-# LINE 276 "Transform.ag" #-}
-                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
-                         in foldr f Map.empty _elemsIcollectedArounds
-                         {-# LINE 663 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 278, column 10)
-                    _allMerges =
-                        ({-# LINE 278 "Transform.ag" #-}
-                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
-                          in foldr f Map.empty _elemsIcollectedMerges
-                         {-# LINE 670 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 281, column 10)
-                    _augmentSigs =
-                        ({-# LINE 281 "Transform.ag" #-}
-                         let gen mp = []
-                         in Map.map (Map.map gen) _allAugments
-                         {-# LINE 677 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 284, column 10)
-                    _allRulesErrs =
-                        ({-# LINE 284 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkRules _allAttrDecls _allFields _allInsts _allSigs     _allMerges    )) _allRules
-                         {-# LINE 683 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 285, column 10)
-                    _allNamesErrs =
-                        ({-# LINE 285 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . checkRuleNames) _allRules
-                         {-# LINE 689 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 286, column 10)
-                    _allSigsErrs =
-                        ({-# LINE 286 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkSigs                                                 )) _allSigs
-                         {-# LINE 695 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 287, column 10)
-                    _allInstsErrs =
-                        ({-# LINE 287 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkInsts _allNonterminals     _allSigs     _allFields   )) _allInsts
-                         {-# LINE 701 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 288, column 10)
-                    _allUniquesErrs =
-                        ({-# LINE 288 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkUniques _allAttrDecls                                )) _allUniques
-                         {-# LINE 707 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 289, column 10)
-                    _allAugmentErrs =
-                        ({-# LINE 289 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkAugments _allAttrDecls                               )) _allAugments
-                         {-# LINE 713 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 290, column 10)
-                    _allAroundsErrs =
-                        ({-# LINE 290 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkArounds _allFields    )) _allArounds
-                         {-# LINE 719 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 291, column 10)
-                    _allMergesErrs =
-                        ({-# LINE 291 "Transform.ag" #-}
-                         Map.mapWithKey (Map.mapWithKey . (checkMerges _allNonterminals     _allInsts     _allFields    )) _allMerges
-                         {-# LINE 725 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 293, column 10)
-                    _checkedRulesPre =
-                        ({-# LINE 293 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allRulesErrs
-                         {-# LINE 731 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 294, column 10)
-                    _checkedSigs =
-                        ({-# LINE 294 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allSigsErrs     `unionunionplusplus` _augmentSigs
-                         {-# LINE 737 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 295, column 10)
-                    _checkedInsts =
-                        ({-# LINE 295 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allInstsErrs
-                         {-# LINE 743 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 296, column 10)
-                    _checkedUniques =
-                        ({-# LINE 296 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allUniquesErrs
-                         {-# LINE 749 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 297, column 10)
-                    _checkedAugments =
-                        ({-# LINE 297 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allAugmentErrs
-                         {-# LINE 755 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 298, column 10)
-                    _checkedArounds =
-                        ({-# LINE 298 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allAroundsErrs
-                         {-# LINE 761 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 299, column 10)
-                    _checkedRules =
-                        ({-# LINE 299 "Transform.ag" #-}
-                         Map.unionWith (Map.unionWith (++)) _checkedRulesPre     (Map.mapWithKey (Map.mapWithKey . (mkUniqueRules _lhsIoptions _allFields     _checkedInsts     _allAttrDecls    )) _checkedUniques    )
-                         {-# LINE 767 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 300, column 10)
-                    _checkedMerges =
-                        ({-# LINE 300 "Transform.ag" #-}
-                         Map.map (Map.map fst) _allMergesErrs
-                         {-# LINE 773 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 302, column 10)
-                    _errs1 =
-                        ({-# LINE 302 "Transform.ag" #-}
-                         let f = checkForDuplicates (DupSynonym)
-                         in  Seq.fromList . f . map fst $ _elemsItypeSyns
-                         {-# LINE 780 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 305, column 10)
-                    _errs2 =
-                        ({-# LINE 305 "Transform.ag" #-}
-                         let g nt (con,fm) = checkForDuplicates (DupChild nt con) (map fst fm)
-                             f (nt,cfm)    = concat . map (g nt) . Map.toList $ cfm
-                         in  Seq.fromList . concat . map f . Map.toList $ _allFields
-                         {-# LINE 788 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 309, column 10)
-                    _errs3 =
-                        ({-# LINE 309 "Transform.ag" #-}
-                         let f (nt,cons) = checkForDuplicates (DupAlt nt) cons
-                         in   Seq.empty
-                         {-# LINE 795 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 313, column 10)
-                    _errs4 =
-                        ({-# LINE 313 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allRulesErrs
-                         {-# LINE 802 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 316, column 10)
-                    _errs5 =
-                        ({-# LINE 316 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allSigsErrs
-                         {-# LINE 809 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 319, column 10)
-                    _errs6 =
-                        ({-# LINE 319 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allInstsErrs
-                         {-# LINE 816 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 322, column 10)
-                    _errs7 =
-                        ({-# LINE 322 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allUniquesErrs
-                         {-# LINE 823 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 325, column 10)
-                    _errs8 =
-                        ({-# LINE 325 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allAugmentErrs
-                         {-# LINE 830 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 328, column 10)
-                    _errs9 =
-                        ({-# LINE 328 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allAroundsErrs
-                         {-# LINE 837 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 331, column 10)
-                    _errs10 =
-                        ({-# LINE 331 "Transform.ag" #-}
-                         let  f m s = Map.fold ((><)) s m
-                         in Map.fold f Seq.empty _allNamesErrs
-                         {-# LINE 844 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 334, column 10)
-                    _errs11 =
-                        ({-# LINE 334 "Transform.ag" #-}
-                         let f m s = Map.fold ((><) . snd) s m
-                         in Map.fold f Seq.empty _allMergesErrs
-                         {-# LINE 851 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 337, column 10)
-                    _lhsOerrors =
-                        ({-# LINE 337 "Transform.ag" #-}
-                         _elemsIerrors >< _errs1 >< _errs2 >< _errs3 >< _errs4 >< _errs5 >< _errs6 >< _errs7 >< _errs8 >< _errs9 >< _errs10 >< _errs11
-                         {-# LINE 857 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 561, column 10)
-                    _allNonterminals =
-                        ({-# LINE 561 "Transform.ag" #-}
-                         _elemsIcollectedNames `Set.difference` _elemsIcollectedSetNames
-                         {-# LINE 863 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 581, column 8)
-                    _elemsOallConstructors =
-                        ({-# LINE 581 "Transform.ag" #-}
-                         _elemsIcollectedConstructorsMap
-                         {-# LINE 869 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 654, column 8)
-                    _elemsOdefSets =
-                        ({-# LINE 654 "Transform.ag" #-}
-                         Map.fromList (map (\x->(x,(Set.singleton x, Set.empty))) (Set.toList _allNonterminals    ))
-                         {-# LINE 875 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 655, column 8)
-                    _elemsOdefinedSets =
-                        ({-# LINE 655 "Transform.ag" #-}
-                         Map.map fst _elemsIdefSets
-                         {-# LINE 881 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 937, column 8)
-                    _elemsOattrDecls =
-                        ({-# LINE 937 "Transform.ag" #-}
-                         Map.empty
-                         {-# LINE 887 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 990, column 9)
-                    _allAttrDecls =
-                        ({-# LINE 990 "Transform.ag" #-}
-                         if withSelf _lhsIoptions
-                          then foldr addSelf _elemsIattrDecls (Set.toList _allNonterminals    )
-                          else               _elemsIattrDecls
-                         {-# LINE 895 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 45, column 19)
-                    _lhsOblocks =
-                        ({-# LINE 45 "Transform.ag" #-}
-                         _elemsIblocks
-                         {-# LINE 901 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1114, column 37)
-                    _lhsOmoduleDecl =
-                        ({-# LINE 1114 "Transform.ag" #-}
-                         _elemsImoduleDecl
-                         {-# LINE 907 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 747, column 34)
-                    _lhsOpragmas =
-                        ({-# LINE 747 "Transform.ag" #-}
-                         _elemsIpragmas
-                         {-# LINE 913 "Transform.hs" #-}
-                         )
-                    -- copy rule (from local)
-                    _elemsOallAttrDecls =
-                        ({-# LINE 822 "Transform.ag" #-}
-                         _allAttrDecls
-                         {-# LINE 919 "Transform.hs" #-}
-                         )
-                    -- copy rule (from local)
-                    _elemsOallFields =
-                        ({-# LINE 129 "Transform.ag" #-}
-                         _allFields
-                         {-# LINE 925 "Transform.hs" #-}
-                         )
-                    -- copy rule (from local)
-                    _elemsOallNonterminals =
-                        ({-# LINE 89 "Transform.ag" #-}
-                         _allNonterminals
-                         {-# LINE 931 "Transform.hs" #-}
-                         )
-                    -- copy rule (down)
-                    _elemsOoptions =
-                        ({-# LINE 39 "Transform.ag" #-}
-                         _lhsIoptions
-                         {-# LINE 937 "Transform.hs" #-}
-                         )
-                    ( _elemsIattrDecls,_elemsIattrOrderCollect,_elemsIblocks,_elemsIcollectedArounds,_elemsIcollectedAugments,_elemsIcollectedConstructorsMap,_elemsIcollectedFields,_elemsIcollectedInsts,_elemsIcollectedMerges,_elemsIcollectedNames,_elemsIcollectedRules,_elemsIcollectedSetNames,_elemsIcollectedSigs,_elemsIcollectedUniques,_elemsIctxCollect,_elemsIdefSets,_elemsIderivings,_elemsIerrors,_elemsImoduleDecl,_elemsIparamsCollect,_elemsIpragmas,_elemsIquantCollect,_elemsIsemPragmasCollect,_elemsItypeSyns,_elemsIuseMap,_elemsIwrappers) =
-                        elems_ _elemsOallAttrDecls _elemsOallConstructors _elemsOallFields _elemsOallNonterminals _elemsOattrDecls _elemsOdefSets _elemsOdefinedSets _elemsOoptions 
-                in  ( _lhsOblocks,_lhsOerrors,_lhsOmoduleDecl,_lhsOoutput,_lhsOpragmas))) )
--- Alt ---------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allConstructors      : Map NontermIdent (Set ConstructorIdent)
-         allNonterminals      : Set NontermIdent
-         nts                  : Set NontermIdent
-      synthesized attributes:
-         collectedConstructorNames : Set ConstructorIdent
-         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
-   alternatives:
-      alternative Alt:
-         child pos            : {Pos}
-         child names          : ConstructorSet 
-         child fields         : {Fields}
--}
--- cata
-sem_Alt :: Alt  ->
-           T_Alt 
-sem_Alt (Alt _pos _names _fields )  =
-    (sem_Alt_Alt _pos (sem_ConstructorSet _names ) _fields )
--- semantic domain
-newtype T_Alt  = T_Alt ((Map NontermIdent (Set ConstructorIdent)) ->
-                        (Set NontermIdent) ->
-                        (Set NontermIdent) ->
-                        ( (Set ConstructorIdent),([(NontermIdent, ConstructorIdent, FieldMap)])))
-data Inh_Alt  = Inh_Alt {allConstructors_Inh_Alt :: !((Map NontermIdent (Set ConstructorIdent))),allNonterminals_Inh_Alt :: !((Set NontermIdent)),nts_Inh_Alt :: !((Set NontermIdent))}
-data Syn_Alt  = Syn_Alt {collectedConstructorNames_Syn_Alt :: !((Set ConstructorIdent)),collectedFields_Syn_Alt :: !(([(NontermIdent, ConstructorIdent, FieldMap)]))}
-wrap_Alt :: T_Alt  ->
-            Inh_Alt  ->
-            Syn_Alt 
-wrap_Alt (T_Alt sem ) (Inh_Alt _lhsIallConstructors _lhsIallNonterminals _lhsInts )  =
-    (let ( _lhsOcollectedConstructorNames,_lhsOcollectedFields) = sem _lhsIallConstructors _lhsIallNonterminals _lhsInts 
-     in  (Syn_Alt _lhsOcollectedConstructorNames _lhsOcollectedFields ))
-sem_Alt_Alt :: Pos ->
-               T_ConstructorSet  ->
-               Fields ->
-               T_Alt 
-sem_Alt_Alt pos_ (T_ConstructorSet names_ ) fields_  =
-    (T_Alt (\ _lhsIallConstructors
-              _lhsIallNonterminals
-              _lhsInts ->
-                (let _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                     _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                     _namesIcollectedConstructorNames :: (Set ConstructorIdent)
-                     _namesIconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                     _namesIerrors :: (Seq Error)
-                     -- "Transform.ag"(line 239, column 10)
-                     _lhsOcollectedFields =
-                         ({-# LINE 239 "Transform.ag" #-}
-                          let fieldTable =
-                               [ (attr, makeType _lhsIallNonterminals tp)
-                               | (attr, tp) <- fields_
-                               ]
-                          in   [ (nt, con, fieldTable)
-                               | nt  <- Set.toList _lhsInts
-                               , con <- Set.toList (_namesIconstructors (Map.findWithDefault Set.empty nt _lhsIallConstructors))
-                               ]
-                          {-# LINE 1000 "Transform.hs" #-}
-                          )
-                     -- use rule "Transform.ag"(line 94, column 62)
-                     _lhsOcollectedConstructorNames =
-                         ({-# LINE 94 "Transform.ag" #-}
-                          _namesIcollectedConstructorNames
-                          {-# LINE 1006 "Transform.hs" #-}
-                          )
-                     ( _namesIcollectedConstructorNames,_namesIconstructors,_namesIerrors) =
-                         names_ 
-                 in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
--- Alts --------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allConstructors      : Map NontermIdent (Set ConstructorIdent)
-         allNonterminals      : Set NontermIdent
-         nts                  : Set NontermIdent
-      synthesized attributes:
-         collectedConstructorNames : Set ConstructorIdent
-         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
-   alternatives:
-      alternative Cons:
-         child hd             : Alt 
-         child tl             : Alts 
-      alternative Nil:
--}
--- cata
-sem_Alts :: Alts  ->
-            T_Alts 
-sem_Alts list  =
-    (Prelude.foldr sem_Alts_Cons sem_Alts_Nil (Prelude.map sem_Alt list) )
--- semantic domain
-newtype T_Alts  = T_Alts ((Map NontermIdent (Set ConstructorIdent)) ->
-                          (Set NontermIdent) ->
-                          (Set NontermIdent) ->
-                          ( (Set ConstructorIdent),([(NontermIdent, ConstructorIdent, FieldMap)])))
-data Inh_Alts  = Inh_Alts {allConstructors_Inh_Alts :: !((Map NontermIdent (Set ConstructorIdent))),allNonterminals_Inh_Alts :: !((Set NontermIdent)),nts_Inh_Alts :: !((Set NontermIdent))}
-data Syn_Alts  = Syn_Alts {collectedConstructorNames_Syn_Alts :: !((Set ConstructorIdent)),collectedFields_Syn_Alts :: !(([(NontermIdent, ConstructorIdent, FieldMap)]))}
-wrap_Alts :: T_Alts  ->
-             Inh_Alts  ->
-             Syn_Alts 
-wrap_Alts (T_Alts sem ) (Inh_Alts _lhsIallConstructors _lhsIallNonterminals _lhsInts )  =
-    (let ( _lhsOcollectedConstructorNames,_lhsOcollectedFields) = sem _lhsIallConstructors _lhsIallNonterminals _lhsInts 
-     in  (Syn_Alts _lhsOcollectedConstructorNames _lhsOcollectedFields ))
-sem_Alts_Cons :: T_Alt  ->
-                 T_Alts  ->
-                 T_Alts 
-sem_Alts_Cons (T_Alt hd_ ) (T_Alts tl_ )  =
-    (T_Alts (\ _lhsIallConstructors
-               _lhsIallNonterminals
-               _lhsInts ->
-                 (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _hdOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                      _hdOallNonterminals :: (Set NontermIdent)
-                      _hdOnts :: (Set NontermIdent)
-                      _tlOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                      _tlOallNonterminals :: (Set NontermIdent)
-                      _tlOnts :: (Set NontermIdent)
-                      _hdIcollectedConstructorNames :: (Set ConstructorIdent)
-                      _hdIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _tlIcollectedConstructorNames :: (Set ConstructorIdent)
-                      _tlIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      -- use rule "Transform.ag"(line 94, column 62)
-                      _lhsOcollectedConstructorNames =
-                          ({-# LINE 94 "Transform.ag" #-}
-                           _hdIcollectedConstructorNames `Set.union` _tlIcollectedConstructorNames
-                           {-# LINE 1068 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           _hdIcollectedFields ++ _tlIcollectedFields
-                           {-# LINE 1074 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _hdOallConstructors =
-                          ({-# LINE 97 "Transform.ag" #-}
-                           _lhsIallConstructors
-                           {-# LINE 1080 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _hdOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 1086 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _hdOnts =
-                          ({-# LINE 168 "Transform.ag" #-}
-                           _lhsInts
-                           {-# LINE 1092 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _tlOallConstructors =
-                          ({-# LINE 97 "Transform.ag" #-}
-                           _lhsIallConstructors
-                           {-# LINE 1098 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _tlOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 1104 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _tlOnts =
-                          ({-# LINE 168 "Transform.ag" #-}
-                           _lhsInts
-                           {-# LINE 1110 "Transform.hs" #-}
-                           )
-                      ( _hdIcollectedConstructorNames,_hdIcollectedFields) =
-                          hd_ _hdOallConstructors _hdOallNonterminals _hdOnts 
-                      ( _tlIcollectedConstructorNames,_tlIcollectedFields) =
-                          tl_ _tlOallConstructors _tlOallNonterminals _tlOnts 
-                  in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
-sem_Alts_Nil :: T_Alts 
-sem_Alts_Nil  =
-    (T_Alts (\ _lhsIallConstructors
-               _lhsIallNonterminals
-               _lhsInts ->
-                 (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      -- use rule "Transform.ag"(line 94, column 62)
-                      _lhsOcollectedConstructorNames =
-                          ({-# LINE 94 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 1128 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 1134 "Transform.hs" #-}
-                           )
-                  in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
--- Attrs -------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allFields            : DataTypes
-         allNonterminals      : Set NontermIdent
-         nts                  : Set NontermIdent
-         options              : Options
-      chained attribute:
-         attrDecls            : Map NontermIdent (Attributes, Attributes)
-      synthesized attributes:
-         errors               : Seq Error
-         useMap               : Map NontermIdent (Map Identifier (String,String,String))
-   alternatives:
-      alternative Attrs:
-         child pos            : {Pos}
-         child inh            : {AttrNames}
-         child chn            : {AttrNames}
-         child syn            : {AttrNames}
-         visit 0:
-            local _tup1       : _
-            local attrDecls   : _
-            local errors      : _
-            local _tup2       : _
-            local inherited   : _
-            local synthesized : _
-            local useMap      : _
-            local errors1     : _
--}
--- cata
-sem_Attrs :: Attrs  ->
-             T_Attrs 
-sem_Attrs (Attrs _pos _inh _chn _syn )  =
-    (sem_Attrs_Attrs _pos _inh _chn _syn )
--- semantic domain
-newtype T_Attrs  = T_Attrs (DataTypes ->
-                            (Set NontermIdent) ->
-                            (Map NontermIdent (Attributes, Attributes)) ->
-                            (Set NontermIdent) ->
-                            Options ->
-                            ( (Map NontermIdent (Attributes, Attributes)),(Seq Error),(Map NontermIdent (Map Identifier (String,String,String)))))
-data Inh_Attrs  = Inh_Attrs {allFields_Inh_Attrs :: !(DataTypes),allNonterminals_Inh_Attrs :: !((Set NontermIdent)),attrDecls_Inh_Attrs :: !((Map NontermIdent (Attributes, Attributes))),nts_Inh_Attrs :: !((Set NontermIdent)),options_Inh_Attrs :: !(Options)}
-data Syn_Attrs  = Syn_Attrs {attrDecls_Syn_Attrs :: !((Map NontermIdent (Attributes, Attributes))),errors_Syn_Attrs :: !((Seq Error)),useMap_Syn_Attrs :: !((Map NontermIdent (Map Identifier (String,String,String))))}
-wrap_Attrs :: T_Attrs  ->
-              Inh_Attrs  ->
-              Syn_Attrs 
-wrap_Attrs (T_Attrs sem ) (Inh_Attrs _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsInts _lhsIoptions )  =
-    (let ( _lhsOattrDecls,_lhsOerrors,_lhsOuseMap) = sem _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsInts _lhsIoptions 
-     in  (Syn_Attrs _lhsOattrDecls _lhsOerrors _lhsOuseMap ))
-sem_Attrs_Attrs :: Pos ->
-                   AttrNames ->
-                   AttrNames ->
-                   AttrNames ->
-                   T_Attrs 
-sem_Attrs_Attrs pos_ inh_ chn_ syn_  =
-    (T_Attrs (\ _lhsIallFields
-                _lhsIallNonterminals
-                _lhsIattrDecls
-                _lhsInts
-                _lhsIoptions ->
-                  (let _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       -- "Transform.ag"(line 945, column 15)
-                       __tup1 =
-                           ({-# LINE 945 "Transform.ag" #-}
-                            checkAttrs _lhsIallFields (Set.toList _lhsInts) _inherited _synthesized _lhsIattrDecls
-                            {-# LINE 1204 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 945, column 15)
-                       (_attrDecls,_) =
-                           ({-# LINE 945 "Transform.ag" #-}
-                            __tup1
-                            {-# LINE 1210 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 945, column 15)
-                       (_,_errors) =
-                           ({-# LINE 945 "Transform.ag" #-}
-                            __tup1
-                            {-# LINE 1216 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 947, column 15)
-                       __tup2 =
-                           ({-# LINE 947 "Transform.ag" #-}
-                            let splitAttrs xs = unzip [ ((n,makeType _lhsIallNonterminals t),(n,ud))
-                                                      | (n,t,ud) <- xs
-                                                      ]
-                                (inh,_)     = splitAttrs inh_
-                                (chn,uses1) = splitAttrs chn_
-                                (syn,uses2) = splitAttrs syn_
-                                isUse (n,(e1,e2,_)) = not (null e1 || null e2)
-                            in (inh++chn,chn++syn, Map.fromList (Prelude.filter isUse (uses1++uses2)))
-                            {-# LINE 1229 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 947, column 15)
-                       (_inherited,_,_) =
-                           ({-# LINE 947 "Transform.ag" #-}
-                            __tup2
-                            {-# LINE 1235 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 947, column 15)
-                       (_,_synthesized,_) =
-                           ({-# LINE 947 "Transform.ag" #-}
-                            __tup2
-                            {-# LINE 1241 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 947, column 15)
-                       (_,_,_useMap) =
-                           ({-# LINE 947 "Transform.ag" #-}
-                            __tup2
-                            {-# LINE 1247 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 955, column 11)
-                       _lhsOuseMap =
-                           ({-# LINE 955 "Transform.ag" #-}
-                            Map.fromList (zip (Set.toList _lhsInts) (repeat _useMap))
-                            {-# LINE 1253 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 957, column 11)
-                       _errors1 =
-                           ({-# LINE 957 "Transform.ag" #-}
-                            if checkParseTy _lhsIoptions
-                            then let attrs  = inh_ ++ syn_ ++ chn_
-                                     items = map (\(ident,tp,_) -> (getPos ident, tp)) attrs
-                                     errs  = map check items
-                                     check (pos,Haskell s) =
-                                       let exp = Expression pos tks
-                                           tks = [tk]
-                                           tk  = HsToken s pos
-                                       in Seq.fromList $ checkTy exp
-                                     check _ = Seq.empty
-                                 in foldr (Seq.><) Seq.empty errs
-                            else Seq.empty
-                            {-# LINE 1270 "Transform.hs" #-}
-                            )
-                       -- "Transform.ag"(line 969, column 11)
-                       _lhsOerrors =
-                           ({-# LINE 969 "Transform.ag" #-}
-                            _errors     Seq.>< _errors1
-                            {-# LINE 1276 "Transform.hs" #-}
-                            )
-                       -- copy rule (from local)
-                       _lhsOattrDecls =
-                           ({-# LINE 137 "Transform.ag" #-}
-                            _attrDecls
-                            {-# LINE 1282 "Transform.hs" #-}
-                            )
-                   in  ( _lhsOattrDecls,_lhsOerrors,_lhsOuseMap))) )
--- ConstructorSet ----------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         collectedConstructorNames : Set ConstructorIdent
-         constructors         : (Set ConstructorIdent->Set ConstructorIdent)
-         errors               : Seq Error
-   alternatives:
-      alternative CAll:
-      alternative CDifference:
-         child set1           : ConstructorSet 
-         child set2           : ConstructorSet 
-      alternative CName:
-         child name           : {ConstructorIdent}
-      alternative CUnion:
-         child set1           : ConstructorSet 
-         child set2           : ConstructorSet 
--}
--- cata
-sem_ConstructorSet :: ConstructorSet  ->
-                      T_ConstructorSet 
-sem_ConstructorSet (CAll )  =
-    (sem_ConstructorSet_CAll )
-sem_ConstructorSet (CDifference _set1 _set2 )  =
-    (sem_ConstructorSet_CDifference (sem_ConstructorSet _set1 ) (sem_ConstructorSet _set2 ) )
-sem_ConstructorSet (CName _name )  =
-    (sem_ConstructorSet_CName _name )
-sem_ConstructorSet (CUnion _set1 _set2 )  =
-    (sem_ConstructorSet_CUnion (sem_ConstructorSet _set1 ) (sem_ConstructorSet _set2 ) )
--- semantic domain
-newtype T_ConstructorSet  = T_ConstructorSet (( (Set ConstructorIdent),((Set ConstructorIdent->Set ConstructorIdent)),(Seq Error)))
-data Inh_ConstructorSet  = Inh_ConstructorSet {}
-data Syn_ConstructorSet  = Syn_ConstructorSet {collectedConstructorNames_Syn_ConstructorSet :: !((Set ConstructorIdent)),constructors_Syn_ConstructorSet :: !(((Set ConstructorIdent->Set ConstructorIdent))),errors_Syn_ConstructorSet :: !((Seq Error))}
-wrap_ConstructorSet :: T_ConstructorSet  ->
-                       Inh_ConstructorSet  ->
-                       Syn_ConstructorSet 
-wrap_ConstructorSet (T_ConstructorSet sem ) (Inh_ConstructorSet )  =
-    (let ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors) = sem 
-     in  (Syn_ConstructorSet _lhsOcollectedConstructorNames _lhsOconstructors _lhsOerrors ))
-sem_ConstructorSet_CAll :: T_ConstructorSet 
-sem_ConstructorSet_CAll  =
-    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                           _lhsOerrors :: (Seq Error)
-                           -- "Transform.ag"(line 725, column 17)
-                           _lhsOconstructors =
-                               ({-# LINE 725 "Transform.ag" #-}
-                                \ds -> ds
-                                {-# LINE 1333 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 94, column 62)
-                           _lhsOcollectedConstructorNames =
-                               ({-# LINE 94 "Transform.ag" #-}
-                                Set.empty
-                                {-# LINE 1339 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 43, column 19)
-                           _lhsOerrors =
-                               ({-# LINE 43 "Transform.ag" #-}
-                                Seq.empty
-                                {-# LINE 1345 "Transform.hs" #-}
-                                )
-                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
-sem_ConstructorSet_CDifference :: T_ConstructorSet  ->
-                                  T_ConstructorSet  ->
-                                  T_ConstructorSet 
-sem_ConstructorSet_CDifference (T_ConstructorSet set1_ ) (T_ConstructorSet set2_ )  =
-    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                           _lhsOerrors :: (Seq Error)
-                           _set1IcollectedConstructorNames :: (Set ConstructorIdent)
-                           _set1Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _set1Ierrors :: (Seq Error)
-                           _set2IcollectedConstructorNames :: (Set ConstructorIdent)
-                           _set2Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _set2Ierrors :: (Seq Error)
-                           -- "Transform.ag"(line 724, column 17)
-                           _lhsOconstructors =
-                               ({-# LINE 724 "Transform.ag" #-}
-                                \ds -> _set1Iconstructors ds `Set.difference` _set2Iconstructors ds
-                                {-# LINE 1365 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 94, column 62)
-                           _lhsOcollectedConstructorNames =
-                               ({-# LINE 94 "Transform.ag" #-}
-                                _set1IcollectedConstructorNames `Set.union` _set2IcollectedConstructorNames
-                                {-# LINE 1371 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 43, column 19)
-                           _lhsOerrors =
-                               ({-# LINE 43 "Transform.ag" #-}
-                                _set1Ierrors Seq.>< _set2Ierrors
-                                {-# LINE 1377 "Transform.hs" #-}
-                                )
-                           ( _set1IcollectedConstructorNames,_set1Iconstructors,_set1Ierrors) =
-                               set1_ 
-                           ( _set2IcollectedConstructorNames,_set2Iconstructors,_set2Ierrors) =
-                               set2_ 
-                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
-sem_ConstructorSet_CName :: ConstructorIdent ->
-                            T_ConstructorSet 
-sem_ConstructorSet_CName name_  =
-    (T_ConstructorSet (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                           _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _lhsOerrors :: (Seq Error)
-                           -- "Transform.ag"(line 569, column 11)
-                           _lhsOcollectedConstructorNames =
-                               ({-# LINE 569 "Transform.ag" #-}
-                                Set.singleton name_
-                                {-# LINE 1394 "Transform.hs" #-}
-                                )
-                           -- "Transform.ag"(line 722, column 17)
-                           _lhsOconstructors =
-                               ({-# LINE 722 "Transform.ag" #-}
-                                \ds -> Set.singleton name_
-                                {-# LINE 1400 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 43, column 19)
-                           _lhsOerrors =
-                               ({-# LINE 43 "Transform.ag" #-}
-                                Seq.empty
-                                {-# LINE 1406 "Transform.hs" #-}
-                                )
-                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
-sem_ConstructorSet_CUnion :: T_ConstructorSet  ->
-                             T_ConstructorSet  ->
-                             T_ConstructorSet 
-sem_ConstructorSet_CUnion (T_ConstructorSet set1_ ) (T_ConstructorSet set2_ )  =
-    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
-                           _lhsOerrors :: (Seq Error)
-                           _set1IcollectedConstructorNames :: (Set ConstructorIdent)
-                           _set1Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _set1Ierrors :: (Seq Error)
-                           _set2IcollectedConstructorNames :: (Set ConstructorIdent)
-                           _set2Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                           _set2Ierrors :: (Seq Error)
-                           -- "Transform.ag"(line 723, column 17)
-                           _lhsOconstructors =
-                               ({-# LINE 723 "Transform.ag" #-}
-                                \ds -> _set1Iconstructors ds `Set.union`      _set2Iconstructors ds
-                                {-# LINE 1426 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 94, column 62)
-                           _lhsOcollectedConstructorNames =
-                               ({-# LINE 94 "Transform.ag" #-}
-                                _set1IcollectedConstructorNames `Set.union` _set2IcollectedConstructorNames
-                                {-# LINE 1432 "Transform.hs" #-}
-                                )
-                           -- use rule "Transform.ag"(line 43, column 19)
-                           _lhsOerrors =
-                               ({-# LINE 43 "Transform.ag" #-}
-                                _set1Ierrors Seq.>< _set2Ierrors
-                                {-# LINE 1438 "Transform.hs" #-}
-                                )
-                           ( _set1IcollectedConstructorNames,_set1Iconstructors,_set1Ierrors) =
-                               set1_ 
-                           ( _set2IcollectedConstructorNames,_set2Iconstructors,_set2Ierrors) =
-                               set2_ 
-                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
--- Elem --------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
-         allConstructors      : Map NontermIdent (Set ConstructorIdent)
-         allFields            : DataTypes
-         allNonterminals      : Set NontermIdent
-         definedSets          : DefinedSets
-         options              : Options
-      chained attributes:
-         attrDecls            : Map NontermIdent (Attributes, Attributes)
-         defSets              : Map Identifier (Set NontermIdent,Set Identifier)
-      synthesized attributes:
-         attrOrderCollect     : AttrOrderMap
-         blocks               : Blocks
-         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
-         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
-         collectedConstructorsMap : Map NontermIdent (Set ConstructorIdent)
-         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
-         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
-         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
-         collectedNames       : Set Identifier
-         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
-         collectedSetNames    : Set Identifier
-         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
-         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
-         ctxCollect           : ContextMap
-         derivings            : Derivings
-         errors               : Seq Error
-         moduleDecl           : Maybe (String,String,String)
-         paramsCollect        : ParamMap
-         pragmas              : Options -> Options
-         quantCollect         : QuantMap
-         semPragmasCollect    : PragmaMap
-         typeSyns             : TypeSyns
-         useMap               : Map NontermIdent (Map Identifier (String,String,String))
-         wrappers             : Set NontermIdent
-   alternatives:
-      alternative Attr:
-         child pos            : {Pos}
-         child ctx            : {ClassContext}
-         child names          : NontSet 
-         child quants         : {[String]}
-         child attrs          : Attrs 
-      alternative Data:
-         child pos            : {Pos}
-         child ctx            : {ClassContext}
-         child names          : NontSet 
-         child params         : {[Identifier]}
-         child attrs          : Attrs 
-         child alts           : Alts 
-         child ext            : {Bool}
-      alternative Deriving:
-         child pos            : {Pos}
-         child set            : NontSet 
-         child classes        : {[NontermIdent]}
-      alternative Module:
-         child pos            : {Pos}
-         child name           : {String}
-         child exports        : {String}
-         child imports        : {String}
-      alternative Nocatas:
-         child pos            : {Pos}
-         child set            : NontSet 
-      alternative Pragma:
-         child pos            : {Pos}
-         child names          : {[NontermIdent]}
-      alternative Sem:
-         child pos            : {Pos}
-         child ctx            : {ClassContext}
-         child names          : NontSet 
-         child attrs          : Attrs 
-         child quants         : {[String]}
-         child alts           : SemAlts 
-      alternative Set:
-         child pos            : {Pos}
-         child name           : {NontermIdent}
-         child merge          : {Bool}
-         child set            : NontSet 
-         visit 0:
-            local _tup3       : _
-            local defSets2    : _
-            local errs        : _
-      alternative Txt:
-         child pos            : {Pos}
-         child name           : {Identifier}
-         child mbNt           : {Maybe NontermIdent}
-         child lines          : {[String]}
-         visit 0:
-            local blockInfo   : _
-            local blockValue  : _
-      alternative Type:
-         child pos            : {Pos}
-         child ctx            : {ClassContext}
-         child name           : {NontermIdent}
-         child params         : {[Identifier]}
-         child type           : {ComplexType}
-         visit 0:
-            local expanded    : _
-            local argType     : _
-      alternative Wrapper:
-         child pos            : {Pos}
-         child set            : NontSet 
--}
--- cata
-sem_Elem :: Elem  ->
-            T_Elem 
-sem_Elem (Attr _pos _ctx _names _quants _attrs )  =
-    (sem_Elem_Attr _pos _ctx (sem_NontSet _names ) _quants (sem_Attrs _attrs ) )
-sem_Elem (Data _pos _ctx _names _params _attrs _alts _ext )  =
-    (sem_Elem_Data _pos _ctx (sem_NontSet _names ) _params (sem_Attrs _attrs ) (sem_Alts _alts ) _ext )
-sem_Elem (Deriving _pos _set _classes )  =
-    (sem_Elem_Deriving _pos (sem_NontSet _set ) _classes )
-sem_Elem (Module _pos _name _exports _imports )  =
-    (sem_Elem_Module _pos _name _exports _imports )
-sem_Elem (Nocatas _pos _set )  =
-    (sem_Elem_Nocatas _pos (sem_NontSet _set ) )
-sem_Elem (Pragma _pos _names )  =
-    (sem_Elem_Pragma _pos _names )
-sem_Elem (Sem _pos _ctx _names _attrs _quants _alts )  =
-    (sem_Elem_Sem _pos _ctx (sem_NontSet _names ) (sem_Attrs _attrs ) _quants (sem_SemAlts _alts ) )
-sem_Elem (Set _pos _name _merge _set )  =
-    (sem_Elem_Set _pos _name _merge (sem_NontSet _set ) )
-sem_Elem (Txt _pos _name _mbNt _lines )  =
-    (sem_Elem_Txt _pos _name _mbNt _lines )
-sem_Elem (Type _pos _ctx _name _params _type )  =
-    (sem_Elem_Type _pos _ctx _name _params _type )
-sem_Elem (Wrapper _pos _set )  =
-    (sem_Elem_Wrapper _pos (sem_NontSet _set ) )
--- semantic domain
-newtype T_Elem  = T_Elem ((Map NontermIdent (Attributes, Attributes)) ->
-                          (Map NontermIdent (Set ConstructorIdent)) ->
-                          DataTypes ->
-                          (Set NontermIdent) ->
-                          (Map NontermIdent (Attributes, Attributes)) ->
-                          (Map Identifier (Set NontermIdent,Set Identifier)) ->
-                          DefinedSets ->
-                          Options ->
-                          ( (Map NontermIdent (Attributes, Attributes)),AttrOrderMap,Blocks,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),(Map NontermIdent (Set ConstructorIdent)),([(NontermIdent, ConstructorIdent, FieldMap)]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),(Set Identifier),([ (NontermIdent, ConstructorIdent, RuleInfo)]),(Set Identifier),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),ContextMap,(Map Identifier (Set NontermIdent,Set Identifier)),Derivings,(Seq Error),(Maybe (String,String,String)),ParamMap,(Options -> Options),QuantMap,PragmaMap,TypeSyns,(Map NontermIdent (Map Identifier (String,String,String))),(Set NontermIdent)))
-data Inh_Elem  = Inh_Elem {allAttrDecls_Inh_Elem :: !((Map NontermIdent (Attributes, Attributes))),allConstructors_Inh_Elem :: !((Map NontermIdent (Set ConstructorIdent))),allFields_Inh_Elem :: !(DataTypes),allNonterminals_Inh_Elem :: !((Set NontermIdent)),attrDecls_Inh_Elem :: !((Map NontermIdent (Attributes, Attributes))),defSets_Inh_Elem :: !((Map Identifier (Set NontermIdent,Set Identifier))),definedSets_Inh_Elem :: !(DefinedSets),options_Inh_Elem :: !(Options)}
-data Syn_Elem  = Syn_Elem {attrDecls_Syn_Elem :: !((Map NontermIdent (Attributes, Attributes))),attrOrderCollect_Syn_Elem :: !(AttrOrderMap),blocks_Syn_Elem :: !(Blocks),collectedArounds_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedConstructorsMap_Syn_Elem :: !((Map NontermIdent (Set ConstructorIdent))),collectedFields_Syn_Elem :: !(([(NontermIdent, ConstructorIdent, FieldMap)])),collectedInsts_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedNames_Syn_Elem :: !((Set Identifier)),collectedRules_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSetNames_Syn_Elem :: !((Set Identifier)),collectedSigs_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),ctxCollect_Syn_Elem :: !(ContextMap),defSets_Syn_Elem :: !((Map Identifier (Set NontermIdent,Set Identifier))),derivings_Syn_Elem :: !(Derivings),errors_Syn_Elem :: !((Seq Error)),moduleDecl_Syn_Elem :: !((Maybe (String,String,String))),paramsCollect_Syn_Elem :: !(ParamMap),pragmas_Syn_Elem :: !((Options -> Options)),quantCollect_Syn_Elem :: !(QuantMap),semPragmasCollect_Syn_Elem :: !(PragmaMap),typeSyns_Syn_Elem :: !(TypeSyns),useMap_Syn_Elem :: !((Map NontermIdent (Map Identifier (String,String,String)))),wrappers_Syn_Elem :: !((Set NontermIdent))}
-wrap_Elem :: T_Elem  ->
-             Inh_Elem  ->
-             Syn_Elem 
-wrap_Elem (T_Elem sem ) (Inh_Elem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions )  =
-    (let ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers) = sem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions 
-     in  (Syn_Elem _lhsOattrDecls _lhsOattrOrderCollect _lhsOblocks _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedConstructorsMap _lhsOcollectedFields _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedNames _lhsOcollectedRules _lhsOcollectedSetNames _lhsOcollectedSigs _lhsOcollectedUniques _lhsOctxCollect _lhsOdefSets _lhsOderivings _lhsOerrors _lhsOmoduleDecl _lhsOparamsCollect _lhsOpragmas _lhsOquantCollect _lhsOsemPragmasCollect _lhsOtypeSyns _lhsOuseMap _lhsOwrappers ))
-sem_Elem_Attr :: Pos ->
-                 ClassContext ->
-                 T_NontSet  ->
-                 ([String]) ->
-                 T_Attrs  ->
-                 T_Elem 
-sem_Elem_Attr pos_ ctx_ (T_NontSet names_ ) quants_ (T_Attrs attrs_ )  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOctxCollect :: ContextMap
-                      _lhsOquantCollect :: QuantMap
-                      _attrsOnts :: (Set NontermIdent)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _namesOallFields :: DataTypes
-                      _namesOallNonterminals :: (Set NontermIdent)
-                      _namesOdefinedSets :: DefinedSets
-                      _attrsOallFields :: DataTypes
-                      _attrsOallNonterminals :: (Set NontermIdent)
-                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsOoptions :: Options
-                      _namesIcollectedNames :: (Set Identifier)
-                      _namesIerrors :: (Seq Error)
-                      _namesInontSet :: (Set NontermIdent)
-                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsIerrors :: (Seq Error)
-                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      -- "Transform.ag"(line 880, column 7)
-                      _lhsOctxCollect =
-                          ({-# LINE 880 "Transform.ag" #-}
-                           if null ctx_
-                           then Map.empty
-                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 1654 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 905, column 7)
-                      _lhsOquantCollect =
-                          ({-# LINE 905 "Transform.ag" #-}
-                           if null quants_
-                           then Map.empty
-                           else Map.fromList [(nt, quants_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 1662 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 941, column 10)
-                      _attrsOnts =
-                          ({-# LINE 941 "Transform.ag" #-}
-                           _namesInontSet
-                           {-# LINE 1668 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1674 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1680 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 1686 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 1692 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1698 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 1704 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 1710 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 1716 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _namesIcollectedNames
-                           {-# LINE 1722 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 1728 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 1734 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 1740 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 1746 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1752 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _namesIerrors Seq.>< _attrsIerrors
-                           {-# LINE 1758 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 1764 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1770 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 1776 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1782 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 1788 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           _attrsIuseMap
-                           {-# LINE 1794 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 1800 "Transform.hs" #-}
-                           )
-                      -- copy rule (up)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _attrsIattrDecls
-                           {-# LINE 1806 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 1812 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 1818 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 1824 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 1830 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 1836 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 1842 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 1848 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOoptions =
-                          ({-# LINE 39 "Transform.ag" #-}
-                           _lhsIoptions
-                           {-# LINE 1854 "Transform.hs" #-}
-                           )
-                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
-                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
-                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
-                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Data :: Pos ->
-                 ClassContext ->
-                 T_NontSet  ->
-                 ([Identifier]) ->
-                 T_Attrs  ->
-                 T_Alts  ->
-                 Bool ->
-                 T_Elem 
-sem_Elem_Data pos_ ctx_ (T_NontSet names_ ) params_ (T_Attrs attrs_ ) (T_Alts alts_ ) ext_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _altsOnts :: (Set NontermIdent)
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOctxCollect :: ContextMap
-                      _attrsOnts :: (Set NontermIdent)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _namesOallFields :: DataTypes
-                      _namesOallNonterminals :: (Set NontermIdent)
-                      _namesOdefinedSets :: DefinedSets
-                      _attrsOallFields :: DataTypes
-                      _attrsOallNonterminals :: (Set NontermIdent)
-                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsOoptions :: Options
-                      _altsOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                      _altsOallNonterminals :: (Set NontermIdent)
-                      _namesIcollectedNames :: (Set Identifier)
-                      _namesIerrors :: (Seq Error)
-                      _namesInontSet :: (Set NontermIdent)
-                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsIerrors :: (Seq Error)
-                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _altsIcollectedConstructorNames :: (Set ConstructorIdent)
-                      _altsIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      -- "Transform.ag"(line 171, column 10)
-                      _altsOnts =
-                          ({-# LINE 171 "Transform.ag" #-}
-                           _namesInontSet
-                           {-# LINE 1927 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 575, column 11)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 575 "Transform.ag" #-}
-                           Map.fromList
-                           [ (n, _altsIcollectedConstructorNames)
-                           | n <- Set.toList _namesInontSet
-                           ]
-                           {-# LINE 1936 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 857, column 7)
-                      _lhsOparamsCollect =
-                          ({-# LINE 857 "Transform.ag" #-}
-                           if null params_
-                           then Map.empty
-                           else Map.fromList [(nt, params_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 1944 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 880, column 7)
-                      _lhsOctxCollect =
-                          ({-# LINE 880 "Transform.ag" #-}
-                           if null ctx_
-                           then Map.empty
-                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 1952 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 940, column 10)
-                      _attrsOnts =
-                          ({-# LINE 940 "Transform.ag" #-}
-                           _namesInontSet
-                           {-# LINE 1958 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1964 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 1970 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 1976 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 1982 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           _altsIcollectedFields
-                           {-# LINE 1988 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 1994 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 2000 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _namesIcollectedNames
-                           {-# LINE 2006 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 2012 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2018 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 2024 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 2030 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2036 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _namesIerrors Seq.>< _attrsIerrors
-                           {-# LINE 2042 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 2048 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 2054 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2060 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2066 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 2072 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           _attrsIuseMap
-                           {-# LINE 2078 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2084 "Transform.hs" #-}
-                           )
-                      -- copy rule (up)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _attrsIattrDecls
-                           {-# LINE 2090 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 2096 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 2102 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 2108 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 2114 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 2120 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 2126 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 2132 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOoptions =
-                          ({-# LINE 39 "Transform.ag" #-}
-                           _lhsIoptions
-                           {-# LINE 2138 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _altsOallConstructors =
-                          ({-# LINE 97 "Transform.ag" #-}
-                           _lhsIallConstructors
-                           {-# LINE 2144 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _altsOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 2150 "Transform.hs" #-}
-                           )
-                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
-                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
-                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
-                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
-                      ( _altsIcollectedConstructorNames,_altsIcollectedFields) =
-                          alts_ _altsOallConstructors _altsOallNonterminals _altsOnts 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Deriving :: Pos ->
-                     T_NontSet  ->
-                     ([NontermIdent]) ->
-                     T_Elem 
-sem_Elem_Deriving pos_ (T_NontSet set_ ) classes_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOderivings :: Derivings
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _setOallFields :: DataTypes
-                      _setOallNonterminals :: (Set NontermIdent)
-                      _setOdefinedSets :: DefinedSets
-                      _setIcollectedNames :: (Set Identifier)
-                      _setIerrors :: (Seq Error)
-                      _setInontSet :: (Set NontermIdent)
-                      -- "Transform.ag"(line 925, column 14)
-                      _lhsOderivings =
-                          ({-# LINE 925 "Transform.ag" #-}
-                           Map.fromList [(nt,Set.fromList classes_) | nt <- Set.toList _setInontSet]
-                           {-# LINE 2208 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2214 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2220 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 2226 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 2232 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2238 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 2244 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 2250 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 2256 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _setIcollectedNames
-                           {-# LINE 2262 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 2268 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2274 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 2280 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 2286 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2292 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _setIerrors
-                           {-# LINE 2298 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 2304 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2310 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 2316 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2322 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2328 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 2334 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2340 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2346 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 2352 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 2358 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 2364 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 2370 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 2376 "Transform.hs" #-}
-                           )
-                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
-                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Module :: Pos ->
-                   String ->
-                   String ->
-                   String ->
-                   T_Elem 
-sem_Elem_Module pos_ name_ exports_ imports_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      -- "Transform.ag"(line 1118, column 7)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1118 "Transform.ag" #-}
-                           Just (name_, exports_, imports_)
-                           {-# LINE 2425 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2431 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2437 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 2443 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 2449 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2455 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 2461 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 2467 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 2473 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2479 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 2485 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2491 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 2497 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 2503 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2509 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2515 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           Seq.empty
-                           {-# LINE 2521 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2527 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 2533 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2539 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2545 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 2551 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2557 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2563 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 2569 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 2575 "Transform.hs" #-}
-                           )
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Nocatas :: Pos ->
-                    T_NontSet  ->
-                    T_Elem 
-sem_Elem_Nocatas pos_ (T_NontSet set_ )  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOpragmas :: (Options -> Options)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _setOallFields :: DataTypes
-                      _setOallNonterminals :: (Set NontermIdent)
-                      _setOdefinedSets :: DefinedSets
-                      _setIcollectedNames :: (Set Identifier)
-                      _setIerrors :: (Seq Error)
-                      _setInontSet :: (Set NontermIdent)
-                      -- "Transform.ag"(line 741, column 14)
-                      _lhsOpragmas =
-                          ({-# LINE 741 "Transform.ag" #-}
-                           \o -> o { nocatas = _setInontSet `Set.union` nocatas o }
-                           {-# LINE 2626 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2632 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2638 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 2644 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 2650 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2656 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 2662 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 2668 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 2674 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _setIcollectedNames
-                           {-# LINE 2680 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 2686 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2692 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 2698 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 2704 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2710 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2716 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _setIerrors
-                           {-# LINE 2722 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 2728 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2734 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2740 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2746 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 2752 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2758 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2764 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 2770 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 2776 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 2782 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 2788 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 2794 "Transform.hs" #-}
-                           )
-                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
-                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Pragma :: Pos ->
-                   ([NontermIdent]) ->
-                   T_Elem 
-sem_Elem_Pragma pos_ names_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOpragmas :: (Options -> Options)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      -- "Transform.ag"(line 750, column 13)
-                      _lhsOpragmas =
-                          ({-# LINE 750 "Transform.ag" #-}
-                           let mk n o = case getName n of
-                                          "gencatas"     -> o { folds       = True  }
-                                          "nogencatas"   -> o { folds       = False }
-                                          "gendatas"     -> o { dataTypes   = True  }
-                                          "nogendatas"   -> o { dataTypes   = False }
-                                          "gensems"      -> o { semfuns     = True  }
-                                          "nogensems"    -> o { semfuns     = False }
-                                          "gentypesigs"  -> o { typeSigs    = True  }
-                                          "nogentypesigs"-> o { typeSigs    = False }
-                                          "nocycle"      -> o { withCycle   = False }
-                                          "cycle"        -> o { withCycle   = True  }
-                                          "nostrictdata" -> o { strictData  = False }
-                                          "strictdata"   -> o { strictData  = True  }
-                                          "nostrictcase" -> o { strictCases = False }
-                                          "strictcase"   -> o { strictCases = True  }
-                                          "strictercase" -> o { strictCases = True, stricterCases = True }
-                                          "nostrictwrap" -> o { strictWrap  = False }
-                                          "strictwrap"   -> o { strictWrap  = True  }
-                                          "novisit"      -> o { visit       = False }
-                                          "visit"        -> o { visit       = True  }
-                                          "nocase"       -> o { cases       = False }
-                                          "case"         -> o { cases       = True  }
-                                          "noseq"        -> o { withSeq     = False }
-                                          "seq"          -> o { withSeq     = True  }
-                                          "nounbox"      -> o { unbox       = False }
-                                          "unbox"        -> o { unbox       = True  }
-                                          "bangpats"     -> o { bangpats    = True  }
-                                          "breadthfirst" -> o { breadthFirst = True }
-                                          "breadthfirstStrict" -> o { breadthFirstStrict = True }
-                                          "nooptimize"   -> o { cases = False , visit = False }
-                                          "optimize"     -> o { cases = True  , visit = True  }
-                                          "strictsem"    -> o { strictSems = True }
-                                          "gentraces"    -> o { genTraces = True }
-                                          "genusetraces" -> o { genUseTraces = True }
-                                          "splitsems"    -> o { splitSems = True }
-                                          "gencostcentres" -> o { genCostCentres = True }
-                                          "sepsemmods"   -> o { sepSemMods = True }
-                                          "genlinepragmas" -> o { genLinePragmas = True }
-                                          "newtypes"       -> o { newtypes = True }
-                                          "nonewtypes"     -> o { newtypes = False }
-                                          _              -> o
-                           in \o -> foldr mk o names_
-                           {-# LINE 2882 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2888 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2894 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 2900 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 2906 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2912 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 2918 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 2924 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 2930 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2936 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 2942 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 2948 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 2954 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 2960 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2966 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2972 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           Seq.empty
-                           {-# LINE 2978 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 2984 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2990 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 2996 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3002 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 3008 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3014 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3020 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 3026 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 3032 "Transform.hs" #-}
-                           )
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Sem :: Pos ->
-                ClassContext ->
-                T_NontSet  ->
-                T_Attrs  ->
-                ([String]) ->
-                T_SemAlts  ->
-                T_Elem 
-sem_Elem_Sem pos_ ctx_ (T_NontSet names_ ) (T_Attrs attrs_ ) quants_ (T_SemAlts alts_ )  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _altsOnts :: (Set NontermIdent)
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOquantCollect :: QuantMap
-                      _attrsOnts :: (Set NontermIdent)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _namesOallFields :: DataTypes
-                      _namesOallNonterminals :: (Set NontermIdent)
-                      _namesOdefinedSets :: DefinedSets
-                      _attrsOallFields :: DataTypes
-                      _attrsOallNonterminals :: (Set NontermIdent)
-                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsOoptions :: Options
-                      _altsOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _altsOallFields :: DataTypes
-                      _altsOoptions :: Options
-                      _namesIcollectedNames :: (Set Identifier)
-                      _namesIerrors :: (Seq Error)
-                      _namesInontSet :: (Set NontermIdent)
-                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _attrsIerrors :: (Seq Error)
-                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _altsIattrOrderCollect :: AttrOrderMap
-                      _altsIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _altsIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _altsIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _altsIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _altsIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _altsIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _altsIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _altsIerrors :: (Seq Error)
-                      _altsIsemPragmasCollect :: PragmaMap
-                      -- "Transform.ag"(line 172, column 10)
-                      _altsOnts =
-                          ({-# LINE 172 "Transform.ag" #-}
-                           _namesInontSet
-                           {-# LINE 3109 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 880, column 7)
-                      _lhsOctxCollect =
-                          ({-# LINE 880 "Transform.ag" #-}
-                           if null ctx_
-                           then Map.empty
-                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 3117 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 905, column 7)
-                      _lhsOquantCollect =
-                          ({-# LINE 905 "Transform.ag" #-}
-                           if null quants_
-                           then Map.empty
-                           else Map.fromList [(nt, quants_) | nt <- Set.toList _namesInontSet]
-                           {-# LINE 3125 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 942, column 10)
-                      _attrsOnts =
-                          ({-# LINE 942 "Transform.ag" #-}
-                           _namesInontSet
-                           {-# LINE 3131 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           _altsIattrOrderCollect
-                           {-# LINE 3137 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3143 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           _altsIcollectedArounds
-                           {-# LINE 3149 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           _altsIcollectedAugments
-                           {-# LINE 3155 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3161 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 3167 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           _altsIcollectedInsts
-                           {-# LINE 3173 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           _altsIcollectedMerges
-                           {-# LINE 3179 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _namesIcollectedNames
-                           {-# LINE 3185 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           _altsIcollectedRules
-                           {-# LINE 3191 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3197 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           _altsIcollectedSigs
-                           {-# LINE 3203 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           _altsIcollectedUniques
-                           {-# LINE 3209 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3215 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _namesIerrors Seq.>< _attrsIerrors Seq.>< _altsIerrors
-                           {-# LINE 3221 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 3227 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3233 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 3239 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           _altsIsemPragmasCollect
-                           {-# LINE 3245 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 3251 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           _attrsIuseMap
-                           {-# LINE 3257 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3263 "Transform.hs" #-}
-                           )
-                      -- copy rule (up)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _attrsIattrDecls
-                           {-# LINE 3269 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 3275 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 3281 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 3287 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _namesOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 3293 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 3299 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 3305 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 3311 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _attrsOoptions =
-                          ({-# LINE 39 "Transform.ag" #-}
-                           _lhsIoptions
-                           {-# LINE 3317 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _altsOallAttrDecls =
-                          ({-# LINE 822 "Transform.ag" #-}
-                           _lhsIallAttrDecls
-                           {-# LINE 3323 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _altsOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 3329 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _altsOoptions =
-                          ({-# LINE 39 "Transform.ag" #-}
-                           _lhsIoptions
-                           {-# LINE 3335 "Transform.hs" #-}
-                           )
-                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
-                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
-                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
-                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
-                      ( _altsIattrOrderCollect,_altsIcollectedArounds,_altsIcollectedAugments,_altsIcollectedInsts,_altsIcollectedMerges,_altsIcollectedRules,_altsIcollectedSigs,_altsIcollectedUniques,_altsIerrors,_altsIsemPragmasCollect) =
-                          alts_ _altsOallAttrDecls _altsOallFields _altsOnts _altsOoptions 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Set :: Pos ->
-                NontermIdent ->
-                Bool ->
-                T_NontSet  ->
-                T_Elem 
-sem_Elem_Set pos_ name_ merge_ (T_NontSet set_ )  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _setOallFields :: DataTypes
-                      _setOallNonterminals :: (Set NontermIdent)
-                      _setOdefinedSets :: DefinedSets
-                      _setIcollectedNames :: (Set Identifier)
-                      _setIerrors :: (Seq Error)
-                      _setInontSet :: (Set NontermIdent)
-                      -- "Transform.ag"(line 552, column 10)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 552 "Transform.ag" #-}
-                           Set.singleton name_
-                           {-# LINE 3394 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 659, column 13)
-                      __tup3 =
-                          ({-# LINE 659 "Transform.ag" #-}
-                           let allUsedNames = Set.unions [ maybe (Set.singleton n)
-                                                                 snd
-                                                                 (Map.lookup n _lhsIdefSets)
-                                                         | n <- Set.toList _setIcollectedNames
-                                                         ]
-                               (nontSet,e1) | Set.member name_ allUsedNames
-                                                        = (Set.empty, Seq.singleton(CyclicSet name_))
-                                            | otherwise = (_setInontSet, Seq.empty)
-                               (res, e2) = let toAdd = (nontSet,Set.insert name_ allUsedNames)
-                                               union (a,b) (c,d) = (a `Set.union` c, b `Set.union` d)
-                                           in if Set.member name_ _lhsIallNonterminals || not merge_
-                                              then checkDuplicate DupSet name_ toAdd _lhsIdefSets
-                                              else (Map.insertWith union name_ toAdd _lhsIdefSets, Seq.empty)
-                           in (res, e1 Seq.>< e2)
-                           {-# LINE 3413 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 659, column 13)
-                      (_defSets2,_) =
-                          ({-# LINE 659 "Transform.ag" #-}
-                           __tup3
-                           {-# LINE 3419 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 659, column 13)
-                      (_,_errs) =
-                          ({-# LINE 659 "Transform.ag" #-}
-                           __tup3
-                           {-# LINE 3425 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 673, column 9)
-                      _lhsOdefSets =
-                          ({-# LINE 673 "Transform.ag" #-}
-                           _defSets2
-                           {-# LINE 3431 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 673, column 9)
-                      _lhsOerrors =
-                          ({-# LINE 674 "Transform.ag" #-}
-                           _errs >< _setIerrors
-                           {-# LINE 3437 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3443 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3449 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 3455 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 3461 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3467 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 3473 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 3479 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 3485 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _setIcollectedNames
-                           {-# LINE 3491 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 3497 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 3503 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 3509 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3515 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3521 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 3527 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3533 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 3539 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3545 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3551 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 3557 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3563 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3569 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 3575 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 3581 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 3587 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 3593 "Transform.hs" #-}
-                           )
-                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
-                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Txt :: Pos ->
-                Identifier ->
-                (Maybe NontermIdent) ->
-                ([String]) ->
-                T_Elem 
-sem_Elem_Txt pos_ name_ mbNt_ lines_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOblocks :: Blocks
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      -- "Transform.ag"(line 181, column 10)
-                      _blockInfo =
-                          ({-# LINE 181 "Transform.ag" #-}
-                           ( let nm = getName name_
-                             in if nm == "imports"
-                                then BlockImport
-                                else if nm == "optpragmas"
-                                     then BlockPragma
-                                     else BlockOther
-                           , mbNt_
-                           )
-                           {-# LINE 3649 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 189, column 10)
-                      _blockValue =
-                          ({-# LINE 189 "Transform.ag" #-}
-                           [(lines_, pos_)]
-                           {-# LINE 3655 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 190, column 10)
-                      _lhsOblocks =
-                          ({-# LINE 190 "Transform.ag" #-}
-                           Map.singleton _blockInfo     _blockValue
-                           {-# LINE 3661 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 191, column 10)
-                      _lhsOerrors =
-                          ({-# LINE 191 "Transform.ag" #-}
-                           if checkParseBlock _lhsIoptions
-                           then let exp = Expression pos_ tks
-                                    tks = [tk]
-                                    tk  = HsToken (unlines lines_) pos_
-                                in Seq.fromList $ checkBlock $ exp
-                           else Seq.empty
-                           {-# LINE 3672 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3678 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 3684 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 3690 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3696 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 3702 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 3708 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 3714 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3720 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 3726 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3732 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 3738 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 3744 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3750 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3756 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 3762 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3768 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 3774 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3780 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3786 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 3792 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3798 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3804 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 3810 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 3816 "Transform.hs" #-}
-                           )
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Type :: Pos ->
-                 ClassContext ->
-                 NontermIdent ->
-                 ([Identifier]) ->
-                 ComplexType ->
-                 T_Elem 
-sem_Elem_Type pos_ ctx_ name_ params_ type_  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      -- "Transform.ag"(line 249, column 10)
-                      _lhsOcollectedFields =
-                          ({-# LINE 249 "Transform.ag" #-}
-                           map (\(x,y)->(name_, x, y)) _expanded
-                           {-# LINE 3864 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 555, column 11)
-                      _lhsOcollectedNames =
-                          ({-# LINE 555 "Transform.ag" #-}
-                           Set.singleton name_
-                           {-# LINE 3870 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 609, column 11)
-                      _expanded =
-                          ({-# LINE 609 "Transform.ag" #-}
-                           case _argType of
-                                   List tp -> [(Ident "Cons" pos_, [(Ident "hd" pos_, tp)
-                                                                   ,(Ident "tl" pos_, NT name_ (map getName params_))
-                                                                   ]
-                                               )
-                                              ,(Ident "Nil" pos_,  [])
-                                              ]
-                                   Maybe tp -> [(Ident "Just" pos_, [(Ident "just" pos_, tp)
-                                                                   ]
-                                               )
-                                              ,(Ident "Nothing" pos_,  [])
-                                              ]
-                                   Either tp1 tp2 -> [
-                                                (Ident "Left"    pos_,  [(Ident "left"  pos_, tp1) ])
-                                              , (Ident "Right"   pos_,  [(Ident "right" pos_, tp2) ])
-                                              ]
-                                   Map tp1 tp2 -> [ (Ident "Entry" pos_, [ (Ident "key" pos_, tp1)
-                                                                         , (Ident "val" pos_, tp2)
-                                                                         , (Ident "tl" pos_, NT name_ (map getName params_))
-                                                                         ])
-                                                  , (Ident "Nil" pos_, [])
-                                                  ]
-                                   IntMap tp   -> [ (Ident "Entry" pos_, [ (Ident "key" pos_, Haskell "Int")
-                                                                         , (Ident "val" pos_, tp)
-                                                                         , (Ident "tl" pos_, NT name_ (map getName params_))
-                                                                         ])
-                                                  , (Ident "Nil" pos_, [])
-                                                  ]
-                                   Tuple xs -> [(Ident "Tuple" pos_, xs)]
-                           {-# LINE 3904 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 638, column 11)
-                      _argType =
-                          ({-# LINE 638 "Transform.ag" #-}
-                           case type_ of
-                            Maybe tp       -> Maybe  (  makeType _lhsIallNonterminals tp)
-                            Either tp1 tp2 -> Either (  makeType _lhsIallNonterminals tp1) (makeType _lhsIallNonterminals tp2)
-                            List tp        -> List   (  makeType _lhsIallNonterminals tp)
-                            Tuple xs       -> Tuple [(f,makeType _lhsIallNonterminals tp) | (f,tp) <- xs]
-                            Map tp1 tp2    -> Map    (  makeType _lhsIallNonterminals tp1) (makeType _lhsIallNonterminals tp2)
-                            IntMap tp      -> IntMap (  makeType _lhsIallNonterminals tp)
-                           {-# LINE 3916 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 645, column 11)
-                      _lhsOtypeSyns =
-                          ({-# LINE 645 "Transform.ag" #-}
-                           [(name_,_argType)]
-                           {-# LINE 3922 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 863, column 7)
-                      _lhsOparamsCollect =
-                          ({-# LINE 863 "Transform.ag" #-}
-                           if null params_
-                           then Map.empty
-                           else Map.singleton name_ params_
-                           {-# LINE 3930 "Transform.hs" #-}
-                           )
-                      -- "Transform.ag"(line 886, column 7)
-                      _lhsOctxCollect =
-                          ({-# LINE 886 "Transform.ag" #-}
-                           if null ctx_
-                           then Map.empty
-                           else Map.singleton name_ ctx_
-                           {-# LINE 3938 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3944 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3950 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 3956 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 3962 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 3968 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 3974 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 3980 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 3986 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 3992 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 3998 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 4004 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4010 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           Seq.empty
-                           {-# LINE 4016 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 4022 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 4028 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4034 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4040 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4046 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 731, column 32)
-                      _lhsOwrappers =
-                          ({-# LINE 731 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 4052 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 4058 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 4064 "Transform.hs" #-}
-                           )
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elem_Wrapper :: Pos ->
-                    T_NontSet  ->
-                    T_Elem 
-sem_Elem_Wrapper pos_ (T_NontSet set_ )  =
-    (T_Elem (\ _lhsIallAttrDecls
-               _lhsIallConstructors
-               _lhsIallFields
-               _lhsIallNonterminals
-               _lhsIattrDecls
-               _lhsIdefSets
-               _lhsIdefinedSets
-               _lhsIoptions ->
-                 (let _lhsOwrappers :: (Set NontermIdent)
-                      _lhsOattrOrderCollect :: AttrOrderMap
-                      _lhsOblocks :: Blocks
-                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                      _lhsOcollectedNames :: (Set Identifier)
-                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                      _lhsOcollectedSetNames :: (Set Identifier)
-                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                      _lhsOctxCollect :: ContextMap
-                      _lhsOderivings :: Derivings
-                      _lhsOerrors :: (Seq Error)
-                      _lhsOmoduleDecl :: (Maybe (String,String,String))
-                      _lhsOparamsCollect :: ParamMap
-                      _lhsOpragmas :: (Options -> Options)
-                      _lhsOquantCollect :: QuantMap
-                      _lhsOsemPragmasCollect :: PragmaMap
-                      _lhsOtypeSyns :: TypeSyns
-                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                      _setOallFields :: DataTypes
-                      _setOallNonterminals :: (Set NontermIdent)
-                      _setOdefinedSets :: DefinedSets
-                      _setIcollectedNames :: (Set Identifier)
-                      _setIerrors :: (Seq Error)
-                      _setInontSet :: (Set NontermIdent)
-                      -- "Transform.ag"(line 734, column 13)
-                      _lhsOwrappers =
-                          ({-# LINE 734 "Transform.ag" #-}
-                           _setInontSet
-                           {-# LINE 4115 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 821, column 55)
-                      _lhsOattrOrderCollect =
-                          ({-# LINE 821 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4121 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 45, column 19)
-                      _lhsOblocks =
-                          ({-# LINE 45 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4127 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 157, column 32)
-                      _lhsOcollectedArounds =
-                          ({-# LINE 157 "Transform.ag" #-}
-                           []
-                           {-# LINE 4133 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 156, column 32)
-                      _lhsOcollectedAugments =
-                          ({-# LINE 156 "Transform.ag" #-}
-                           []
-                           {-# LINE 4139 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 95, column 48)
-                      _lhsOcollectedConstructorsMap =
-                          ({-# LINE 95 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4145 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 126, column 28)
-                      _lhsOcollectedFields =
-                          ({-# LINE 126 "Transform.ag" #-}
-                           []
-                           {-# LINE 4151 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 154, column 32)
-                      _lhsOcollectedInsts =
-                          ({-# LINE 154 "Transform.ag" #-}
-                           []
-                           {-# LINE 4157 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 158, column 32)
-                      _lhsOcollectedMerges =
-                          ({-# LINE 158 "Transform.ag" #-}
-                           []
-                           {-# LINE 4163 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 87, column 50)
-                      _lhsOcollectedNames =
-                          ({-# LINE 87 "Transform.ag" #-}
-                           _setIcollectedNames
-                           {-# LINE 4169 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 152, column 32)
-                      _lhsOcollectedRules =
-                          ({-# LINE 152 "Transform.ag" #-}
-                           []
-                           {-# LINE 4175 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 86, column 50)
-                      _lhsOcollectedSetNames =
-                          ({-# LINE 86 "Transform.ag" #-}
-                           Set.empty
-                           {-# LINE 4181 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 153, column 32)
-                      _lhsOcollectedSigs =
-                          ({-# LINE 153 "Transform.ag" #-}
-                           []
-                           {-# LINE 4187 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 155, column 32)
-                      _lhsOcollectedUniques =
-                          ({-# LINE 155 "Transform.ag" #-}
-                           []
-                           {-# LINE 4193 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 876, column 34)
-                      _lhsOctxCollect =
-                          ({-# LINE 876 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4199 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 918, column 33)
-                      _lhsOderivings =
-                          ({-# LINE 918 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4205 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 43, column 19)
-                      _lhsOerrors =
-                          ({-# LINE 43 "Transform.ag" #-}
-                           _setIerrors
-                           {-# LINE 4211 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 1114, column 37)
-                      _lhsOmoduleDecl =
-                          ({-# LINE 1114 "Transform.ag" #-}
-                           mzero
-                           {-# LINE 4217 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 853, column 37)
-                      _lhsOparamsCollect =
-                          ({-# LINE 853 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4223 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 747, column 34)
-                      _lhsOpragmas =
-                          ({-# LINE 747 "Transform.ag" #-}
-                           id
-                           {-# LINE 4229 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 901, column 36)
-                      _lhsOquantCollect =
-                          ({-# LINE 901 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4235 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 793, column 56)
-                      _lhsOsemPragmasCollect =
-                          ({-# LINE 793 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4241 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 596, column 32)
-                      _lhsOtypeSyns =
-                          ({-# LINE 596 "Transform.ag" #-}
-                           []
-                           {-# LINE 4247 "Transform.hs" #-}
-                           )
-                      -- use rule "Transform.ag"(line 138, column 15)
-                      _lhsOuseMap =
-                          ({-# LINE 138 "Transform.ag" #-}
-                           Map.empty
-                           {-# LINE 4253 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOattrDecls =
-                          ({-# LINE 137 "Transform.ag" #-}
-                           _lhsIattrDecls
-                           {-# LINE 4259 "Transform.hs" #-}
-                           )
-                      -- copy rule (chain)
-                      _lhsOdefSets =
-                          ({-# LINE 105 "Transform.ag" #-}
-                           _lhsIdefSets
-                           {-# LINE 4265 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallFields =
-                          ({-# LINE 129 "Transform.ag" #-}
-                           _lhsIallFields
-                           {-# LINE 4271 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOallNonterminals =
-                          ({-# LINE 89 "Transform.ag" #-}
-                           _lhsIallNonterminals
-                           {-# LINE 4277 "Transform.hs" #-}
-                           )
-                      -- copy rule (down)
-                      _setOdefinedSets =
-                          ({-# LINE 108 "Transform.ag" #-}
-                           _lhsIdefinedSets
-                           {-# LINE 4283 "Transform.hs" #-}
-                           )
-                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
-                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
-                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
--- Elems -------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
-         allConstructors      : Map NontermIdent (Set ConstructorIdent)
-         allFields            : DataTypes
-         allNonterminals      : Set NontermIdent
-         definedSets          : DefinedSets
-         options              : Options
-      chained attributes:
-         attrDecls            : Map NontermIdent (Attributes, Attributes)
-         defSets              : Map Identifier (Set NontermIdent,Set Identifier)
-      synthesized attributes:
-         attrOrderCollect     : AttrOrderMap
-         blocks               : Blocks
-         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
-         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
-         collectedConstructorsMap : Map NontermIdent (Set ConstructorIdent)
-         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
-         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
-         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
-         collectedNames       : Set Identifier
-         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
-         collectedSetNames    : Set Identifier
-         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
-         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
-         ctxCollect           : ContextMap
-         derivings            : Derivings
-         errors               : Seq Error
-         moduleDecl           : Maybe (String,String,String)
-         paramsCollect        : ParamMap
-         pragmas              : Options -> Options
-         quantCollect         : QuantMap
-         semPragmasCollect    : PragmaMap
-         typeSyns             : TypeSyns
-         useMap               : Map NontermIdent (Map Identifier (String,String,String))
-         wrappers             : Set NontermIdent
-   alternatives:
-      alternative Cons:
-         child hd             : Elem 
-         child tl             : Elems 
-      alternative Nil:
--}
--- cata
-sem_Elems :: Elems  ->
-             T_Elems 
-sem_Elems list  =
-    (Prelude.foldr sem_Elems_Cons sem_Elems_Nil (Prelude.map sem_Elem list) )
--- semantic domain
-newtype T_Elems  = T_Elems ((Map NontermIdent (Attributes, Attributes)) ->
-                            (Map NontermIdent (Set ConstructorIdent)) ->
-                            DataTypes ->
-                            (Set NontermIdent) ->
-                            (Map NontermIdent (Attributes, Attributes)) ->
-                            (Map Identifier (Set NontermIdent,Set Identifier)) ->
-                            DefinedSets ->
-                            Options ->
-                            ( (Map NontermIdent (Attributes, Attributes)),AttrOrderMap,Blocks,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),(Map NontermIdent (Set ConstructorIdent)),([(NontermIdent, ConstructorIdent, FieldMap)]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),(Set Identifier),([ (NontermIdent, ConstructorIdent, RuleInfo)]),(Set Identifier),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),ContextMap,(Map Identifier (Set NontermIdent,Set Identifier)),Derivings,(Seq Error),(Maybe (String,String,String)),ParamMap,(Options -> Options),QuantMap,PragmaMap,TypeSyns,(Map NontermIdent (Map Identifier (String,String,String))),(Set NontermIdent)))
-data Inh_Elems  = Inh_Elems {allAttrDecls_Inh_Elems :: !((Map NontermIdent (Attributes, Attributes))),allConstructors_Inh_Elems :: !((Map NontermIdent (Set ConstructorIdent))),allFields_Inh_Elems :: !(DataTypes),allNonterminals_Inh_Elems :: !((Set NontermIdent)),attrDecls_Inh_Elems :: !((Map NontermIdent (Attributes, Attributes))),defSets_Inh_Elems :: !((Map Identifier (Set NontermIdent,Set Identifier))),definedSets_Inh_Elems :: !(DefinedSets),options_Inh_Elems :: !(Options)}
-data Syn_Elems  = Syn_Elems {attrDecls_Syn_Elems :: !((Map NontermIdent (Attributes, Attributes))),attrOrderCollect_Syn_Elems :: !(AttrOrderMap),blocks_Syn_Elems :: !(Blocks),collectedArounds_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedConstructorsMap_Syn_Elems :: !((Map NontermIdent (Set ConstructorIdent))),collectedFields_Syn_Elems :: !(([(NontermIdent, ConstructorIdent, FieldMap)])),collectedInsts_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedNames_Syn_Elems :: !((Set Identifier)),collectedRules_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSetNames_Syn_Elems :: !((Set Identifier)),collectedSigs_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),ctxCollect_Syn_Elems :: !(ContextMap),defSets_Syn_Elems :: !((Map Identifier (Set NontermIdent,Set Identifier))),derivings_Syn_Elems :: !(Derivings),errors_Syn_Elems :: !((Seq Error)),moduleDecl_Syn_Elems :: !((Maybe (String,String,String))),paramsCollect_Syn_Elems :: !(ParamMap),pragmas_Syn_Elems :: !((Options -> Options)),quantCollect_Syn_Elems :: !(QuantMap),semPragmasCollect_Syn_Elems :: !(PragmaMap),typeSyns_Syn_Elems :: !(TypeSyns),useMap_Syn_Elems :: !((Map NontermIdent (Map Identifier (String,String,String)))),wrappers_Syn_Elems :: !((Set NontermIdent))}
-wrap_Elems :: T_Elems  ->
-              Inh_Elems  ->
-              Syn_Elems 
-wrap_Elems (T_Elems sem ) (Inh_Elems _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions )  =
-    (let ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers) = sem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions 
-     in  (Syn_Elems _lhsOattrDecls _lhsOattrOrderCollect _lhsOblocks _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedConstructorsMap _lhsOcollectedFields _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedNames _lhsOcollectedRules _lhsOcollectedSetNames _lhsOcollectedSigs _lhsOcollectedUniques _lhsOctxCollect _lhsOdefSets _lhsOderivings _lhsOerrors _lhsOmoduleDecl _lhsOparamsCollect _lhsOpragmas _lhsOquantCollect _lhsOsemPragmasCollect _lhsOtypeSyns _lhsOuseMap _lhsOwrappers ))
-sem_Elems_Cons :: T_Elem  ->
-                  T_Elems  ->
-                  T_Elems 
-sem_Elems_Cons (T_Elem hd_ ) (T_Elems tl_ )  =
-    (T_Elems (\ _lhsIallAttrDecls
-                _lhsIallConstructors
-                _lhsIallFields
-                _lhsIallNonterminals
-                _lhsIattrDecls
-                _lhsIdefSets
-                _lhsIdefinedSets
-                _lhsIoptions ->
-                  (let _lhsOattrOrderCollect :: AttrOrderMap
-                       _lhsOblocks :: Blocks
-                       _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                       _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                       _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                       _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                       _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                       _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                       _lhsOcollectedNames :: (Set Identifier)
-                       _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                       _lhsOcollectedSetNames :: (Set Identifier)
-                       _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                       _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                       _lhsOctxCollect :: ContextMap
-                       _lhsOderivings :: Derivings
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOmoduleDecl :: (Maybe (String,String,String))
-                       _lhsOparamsCollect :: ParamMap
-                       _lhsOpragmas :: (Options -> Options)
-                       _lhsOquantCollect :: QuantMap
-                       _lhsOsemPragmasCollect :: PragmaMap
-                       _lhsOtypeSyns :: TypeSyns
-                       _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                       _lhsOwrappers :: (Set NontermIdent)
-                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       _hdOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _hdOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                       _hdOallFields :: DataTypes
-                       _hdOallNonterminals :: (Set NontermIdent)
-                       _hdOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _hdOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       _hdOdefinedSets :: DefinedSets
-                       _hdOoptions :: Options
-                       _tlOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _tlOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
-                       _tlOallFields :: DataTypes
-                       _tlOallNonterminals :: (Set NontermIdent)
-                       _tlOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _tlOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       _tlOdefinedSets :: DefinedSets
-                       _tlOoptions :: Options
-                       _hdIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _hdIattrOrderCollect :: AttrOrderMap
-                       _hdIblocks :: Blocks
-                       _hdIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                       _hdIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                       _hdIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                       _hdIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                       _hdIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                       _hdIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                       _hdIcollectedNames :: (Set Identifier)
-                       _hdIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                       _hdIcollectedSetNames :: (Set Identifier)
-                       _hdIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                       _hdIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                       _hdIctxCollect :: ContextMap
-                       _hdIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       _hdIderivings :: Derivings
-                       _hdIerrors :: (Seq Error)
-                       _hdImoduleDecl :: (Maybe (String,String,String))
-                       _hdIparamsCollect :: ParamMap
-                       _hdIpragmas :: (Options -> Options)
-                       _hdIquantCollect :: QuantMap
-                       _hdIsemPragmasCollect :: PragmaMap
-                       _hdItypeSyns :: TypeSyns
-                       _hdIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                       _hdIwrappers :: (Set NontermIdent)
-                       _tlIattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _tlIattrOrderCollect :: AttrOrderMap
-                       _tlIblocks :: Blocks
-                       _tlIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                       _tlIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                       _tlIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                       _tlIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                       _tlIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                       _tlIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                       _tlIcollectedNames :: (Set Identifier)
-                       _tlIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                       _tlIcollectedSetNames :: (Set Identifier)
-                       _tlIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                       _tlIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                       _tlIctxCollect :: ContextMap
-                       _tlIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       _tlIderivings :: Derivings
-                       _tlIerrors :: (Seq Error)
-                       _tlImoduleDecl :: (Maybe (String,String,String))
-                       _tlIparamsCollect :: ParamMap
-                       _tlIpragmas :: (Options -> Options)
-                       _tlIquantCollect :: QuantMap
-                       _tlIsemPragmasCollect :: PragmaMap
-                       _tlItypeSyns :: TypeSyns
-                       _tlIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                       _tlIwrappers :: (Set NontermIdent)
-                       -- use rule "Transform.ag"(line 821, column 55)
-                       _lhsOattrOrderCollect =
-                           ({-# LINE 821 "Transform.ag" #-}
-                            _hdIattrOrderCollect `orderMapUnion` _tlIattrOrderCollect
-                            {-# LINE 4465 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 45, column 19)
-                       _lhsOblocks =
-                           ({-# LINE 45 "Transform.ag" #-}
-                            _hdIblocks `mapUnionWithPlusPlus` _tlIblocks
-                            {-# LINE 4471 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 157, column 32)
-                       _lhsOcollectedArounds =
-                           ({-# LINE 157 "Transform.ag" #-}
-                            _hdIcollectedArounds ++ _tlIcollectedArounds
-                            {-# LINE 4477 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 156, column 32)
-                       _lhsOcollectedAugments =
-                           ({-# LINE 156 "Transform.ag" #-}
-                            _hdIcollectedAugments ++ _tlIcollectedAugments
-                            {-# LINE 4483 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 95, column 48)
-                       _lhsOcollectedConstructorsMap =
-                           ({-# LINE 95 "Transform.ag" #-}
-                            _hdIcollectedConstructorsMap `mapUnionWithSetUnion` _tlIcollectedConstructorsMap
-                            {-# LINE 4489 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 126, column 28)
-                       _lhsOcollectedFields =
-                           ({-# LINE 126 "Transform.ag" #-}
-                            _hdIcollectedFields ++ _tlIcollectedFields
-                            {-# LINE 4495 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 154, column 32)
-                       _lhsOcollectedInsts =
-                           ({-# LINE 154 "Transform.ag" #-}
-                            _hdIcollectedInsts ++ _tlIcollectedInsts
-                            {-# LINE 4501 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 158, column 32)
-                       _lhsOcollectedMerges =
-                           ({-# LINE 158 "Transform.ag" #-}
-                            _hdIcollectedMerges ++ _tlIcollectedMerges
-                            {-# LINE 4507 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 87, column 50)
-                       _lhsOcollectedNames =
-                           ({-# LINE 87 "Transform.ag" #-}
-                            _hdIcollectedNames `Set.union` _tlIcollectedNames
-                            {-# LINE 4513 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 152, column 32)
-                       _lhsOcollectedRules =
-                           ({-# LINE 152 "Transform.ag" #-}
-                            _hdIcollectedRules ++ _tlIcollectedRules
-                            {-# LINE 4519 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 86, column 50)
-                       _lhsOcollectedSetNames =
-                           ({-# LINE 86 "Transform.ag" #-}
-                            _hdIcollectedSetNames `Set.union` _tlIcollectedSetNames
-                            {-# LINE 4525 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 153, column 32)
-                       _lhsOcollectedSigs =
-                           ({-# LINE 153 "Transform.ag" #-}
-                            _hdIcollectedSigs ++ _tlIcollectedSigs
-                            {-# LINE 4531 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 155, column 32)
-                       _lhsOcollectedUniques =
-                           ({-# LINE 155 "Transform.ag" #-}
-                            _hdIcollectedUniques ++ _tlIcollectedUniques
-                            {-# LINE 4537 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 876, column 34)
-                       _lhsOctxCollect =
-                           ({-# LINE 876 "Transform.ag" #-}
-                            _hdIctxCollect `mergeCtx` _tlIctxCollect
-                            {-# LINE 4543 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 918, column 33)
-                       _lhsOderivings =
-                           ({-# LINE 918 "Transform.ag" #-}
-                            _hdIderivings `mergeDerivings` _tlIderivings
-                            {-# LINE 4549 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 43, column 19)
-                       _lhsOerrors =
-                           ({-# LINE 43 "Transform.ag" #-}
-                            _hdIerrors Seq.>< _tlIerrors
-                            {-# LINE 4555 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 1114, column 37)
-                       _lhsOmoduleDecl =
-                           ({-# LINE 1114 "Transform.ag" #-}
-                            _hdImoduleDecl `mplus` _tlImoduleDecl
-                            {-# LINE 4561 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 853, column 37)
-                       _lhsOparamsCollect =
-                           ({-# LINE 853 "Transform.ag" #-}
-                            _hdIparamsCollect `mergeParams` _tlIparamsCollect
-                            {-# LINE 4567 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 747, column 34)
-                       _lhsOpragmas =
-                           ({-# LINE 747 "Transform.ag" #-}
-                            _hdIpragmas . _tlIpragmas
-                            {-# LINE 4573 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 901, column 36)
-                       _lhsOquantCollect =
-                           ({-# LINE 901 "Transform.ag" #-}
-                            _hdIquantCollect `mergeQuant` _tlIquantCollect
-                            {-# LINE 4579 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 793, column 56)
-                       _lhsOsemPragmasCollect =
-                           ({-# LINE 793 "Transform.ag" #-}
-                            _hdIsemPragmasCollect `pragmaMapUnion` _tlIsemPragmasCollect
-                            {-# LINE 4585 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 596, column 32)
-                       _lhsOtypeSyns =
-                           ({-# LINE 596 "Transform.ag" #-}
-                            _hdItypeSyns ++ _tlItypeSyns
-                            {-# LINE 4591 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 138, column 15)
-                       _lhsOuseMap =
-                           ({-# LINE 138 "Transform.ag" #-}
-                            _hdIuseMap `merge` _tlIuseMap
-                            {-# LINE 4597 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 731, column 32)
-                       _lhsOwrappers =
-                           ({-# LINE 731 "Transform.ag" #-}
-                            _hdIwrappers `Set.union` _tlIwrappers
-                            {-# LINE 4603 "Transform.hs" #-}
-                            )
-                       -- copy rule (up)
-                       _lhsOattrDecls =
-                           ({-# LINE 137 "Transform.ag" #-}
-                            _tlIattrDecls
-                            {-# LINE 4609 "Transform.hs" #-}
-                            )
-                       -- copy rule (up)
-                       _lhsOdefSets =
-                           ({-# LINE 105 "Transform.ag" #-}
-                            _tlIdefSets
-                            {-# LINE 4615 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallAttrDecls =
-                           ({-# LINE 822 "Transform.ag" #-}
-                            _lhsIallAttrDecls
-                            {-# LINE 4621 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallConstructors =
-                           ({-# LINE 97 "Transform.ag" #-}
-                            _lhsIallConstructors
-                            {-# LINE 4627 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallFields =
-                           ({-# LINE 129 "Transform.ag" #-}
-                            _lhsIallFields
-                            {-# LINE 4633 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOallNonterminals =
-                           ({-# LINE 89 "Transform.ag" #-}
-                            _lhsIallNonterminals
-                            {-# LINE 4639 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOattrDecls =
-                           ({-# LINE 137 "Transform.ag" #-}
-                            _lhsIattrDecls
-                            {-# LINE 4645 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOdefSets =
-                           ({-# LINE 105 "Transform.ag" #-}
-                            _lhsIdefSets
-                            {-# LINE 4651 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOdefinedSets =
-                           ({-# LINE 108 "Transform.ag" #-}
-                            _lhsIdefinedSets
-                            {-# LINE 4657 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _hdOoptions =
-                           ({-# LINE 39 "Transform.ag" #-}
-                            _lhsIoptions
-                            {-# LINE 4663 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallAttrDecls =
-                           ({-# LINE 822 "Transform.ag" #-}
-                            _lhsIallAttrDecls
-                            {-# LINE 4669 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallConstructors =
-                           ({-# LINE 97 "Transform.ag" #-}
-                            _lhsIallConstructors
-                            {-# LINE 4675 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallFields =
-                           ({-# LINE 129 "Transform.ag" #-}
-                            _lhsIallFields
-                            {-# LINE 4681 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOallNonterminals =
-                           ({-# LINE 89 "Transform.ag" #-}
-                            _lhsIallNonterminals
-                            {-# LINE 4687 "Transform.hs" #-}
-                            )
-                       -- copy rule (chain)
-                       _tlOattrDecls =
-                           ({-# LINE 137 "Transform.ag" #-}
-                            _hdIattrDecls
-                            {-# LINE 4693 "Transform.hs" #-}
-                            )
-                       -- copy rule (chain)
-                       _tlOdefSets =
-                           ({-# LINE 105 "Transform.ag" #-}
-                            _hdIdefSets
-                            {-# LINE 4699 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOdefinedSets =
-                           ({-# LINE 108 "Transform.ag" #-}
-                            _lhsIdefinedSets
-                            {-# LINE 4705 "Transform.hs" #-}
-                            )
-                       -- copy rule (down)
-                       _tlOoptions =
-                           ({-# LINE 39 "Transform.ag" #-}
-                            _lhsIoptions
-                            {-# LINE 4711 "Transform.hs" #-}
-                            )
-                       ( _hdIattrDecls,_hdIattrOrderCollect,_hdIblocks,_hdIcollectedArounds,_hdIcollectedAugments,_hdIcollectedConstructorsMap,_hdIcollectedFields,_hdIcollectedInsts,_hdIcollectedMerges,_hdIcollectedNames,_hdIcollectedRules,_hdIcollectedSetNames,_hdIcollectedSigs,_hdIcollectedUniques,_hdIctxCollect,_hdIdefSets,_hdIderivings,_hdIerrors,_hdImoduleDecl,_hdIparamsCollect,_hdIpragmas,_hdIquantCollect,_hdIsemPragmasCollect,_hdItypeSyns,_hdIuseMap,_hdIwrappers) =
-                           hd_ _hdOallAttrDecls _hdOallConstructors _hdOallFields _hdOallNonterminals _hdOattrDecls _hdOdefSets _hdOdefinedSets _hdOoptions 
-                       ( _tlIattrDecls,_tlIattrOrderCollect,_tlIblocks,_tlIcollectedArounds,_tlIcollectedAugments,_tlIcollectedConstructorsMap,_tlIcollectedFields,_tlIcollectedInsts,_tlIcollectedMerges,_tlIcollectedNames,_tlIcollectedRules,_tlIcollectedSetNames,_tlIcollectedSigs,_tlIcollectedUniques,_tlIctxCollect,_tlIdefSets,_tlIderivings,_tlIerrors,_tlImoduleDecl,_tlIparamsCollect,_tlIpragmas,_tlIquantCollect,_tlIsemPragmasCollect,_tlItypeSyns,_tlIuseMap,_tlIwrappers) =
-                           tl_ _tlOallAttrDecls _tlOallConstructors _tlOallFields _tlOallNonterminals _tlOattrDecls _tlOdefSets _tlOdefinedSets _tlOoptions 
-                   in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
-sem_Elems_Nil :: T_Elems 
-sem_Elems_Nil  =
-    (T_Elems (\ _lhsIallAttrDecls
-                _lhsIallConstructors
-                _lhsIallFields
-                _lhsIallNonterminals
-                _lhsIattrDecls
-                _lhsIdefSets
-                _lhsIdefinedSets
-                _lhsIoptions ->
-                  (let _lhsOattrOrderCollect :: AttrOrderMap
-                       _lhsOblocks :: Blocks
-                       _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                       _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                       _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
-                       _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
-                       _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                       _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                       _lhsOcollectedNames :: (Set Identifier)
-                       _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                       _lhsOcollectedSetNames :: (Set Identifier)
-                       _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                       _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                       _lhsOctxCollect :: ContextMap
-                       _lhsOderivings :: Derivings
-                       _lhsOerrors :: (Seq Error)
-                       _lhsOmoduleDecl :: (Maybe (String,String,String))
-                       _lhsOparamsCollect :: ParamMap
-                       _lhsOpragmas :: (Options -> Options)
-                       _lhsOquantCollect :: QuantMap
-                       _lhsOsemPragmasCollect :: PragmaMap
-                       _lhsOtypeSyns :: TypeSyns
-                       _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
-                       _lhsOwrappers :: (Set NontermIdent)
-                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
-                       _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
-                       -- use rule "Transform.ag"(line 821, column 55)
-                       _lhsOattrOrderCollect =
-                           ({-# LINE 821 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4758 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 45, column 19)
-                       _lhsOblocks =
-                           ({-# LINE 45 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4764 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 157, column 32)
-                       _lhsOcollectedArounds =
-                           ({-# LINE 157 "Transform.ag" #-}
-                            []
-                            {-# LINE 4770 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 156, column 32)
-                       _lhsOcollectedAugments =
-                           ({-# LINE 156 "Transform.ag" #-}
-                            []
-                            {-# LINE 4776 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 95, column 48)
-                       _lhsOcollectedConstructorsMap =
-                           ({-# LINE 95 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4782 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 126, column 28)
-                       _lhsOcollectedFields =
-                           ({-# LINE 126 "Transform.ag" #-}
-                            []
-                            {-# LINE 4788 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 154, column 32)
-                       _lhsOcollectedInsts =
-                           ({-# LINE 154 "Transform.ag" #-}
-                            []
-                            {-# LINE 4794 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 158, column 32)
-                       _lhsOcollectedMerges =
-                           ({-# LINE 158 "Transform.ag" #-}
-                            []
-                            {-# LINE 4800 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 87, column 50)
-                       _lhsOcollectedNames =
-                           ({-# LINE 87 "Transform.ag" #-}
-                            Set.empty
-                            {-# LINE 4806 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 152, column 32)
-                       _lhsOcollectedRules =
-                           ({-# LINE 152 "Transform.ag" #-}
-                            []
-                            {-# LINE 4812 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 86, column 50)
-                       _lhsOcollectedSetNames =
-                           ({-# LINE 86 "Transform.ag" #-}
-                            Set.empty
-                            {-# LINE 4818 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 153, column 32)
-                       _lhsOcollectedSigs =
-                           ({-# LINE 153 "Transform.ag" #-}
-                            []
-                            {-# LINE 4824 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 155, column 32)
-                       _lhsOcollectedUniques =
-                           ({-# LINE 155 "Transform.ag" #-}
-                            []
-                            {-# LINE 4830 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 876, column 34)
-                       _lhsOctxCollect =
-                           ({-# LINE 876 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4836 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 918, column 33)
-                       _lhsOderivings =
-                           ({-# LINE 918 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4842 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 43, column 19)
-                       _lhsOerrors =
-                           ({-# LINE 43 "Transform.ag" #-}
-                            Seq.empty
-                            {-# LINE 4848 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 1114, column 37)
-                       _lhsOmoduleDecl =
-                           ({-# LINE 1114 "Transform.ag" #-}
-                            mzero
-                            {-# LINE 4854 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 853, column 37)
-                       _lhsOparamsCollect =
-                           ({-# LINE 853 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4860 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 747, column 34)
-                       _lhsOpragmas =
-                           ({-# LINE 747 "Transform.ag" #-}
-                            id
-                            {-# LINE 4866 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 901, column 36)
-                       _lhsOquantCollect =
-                           ({-# LINE 901 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4872 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 793, column 56)
-                       _lhsOsemPragmasCollect =
-                           ({-# LINE 793 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4878 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 596, column 32)
-                       _lhsOtypeSyns =
-                           ({-# LINE 596 "Transform.ag" #-}
-                            []
-                            {-# LINE 4884 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 138, column 15)
-                       _lhsOuseMap =
-                           ({-# LINE 138 "Transform.ag" #-}
-                            Map.empty
-                            {-# LINE 4890 "Transform.hs" #-}
-                            )
-                       -- use rule "Transform.ag"(line 731, column 32)
-                       _lhsOwrappers =
-                           ({-# LINE 731 "Transform.ag" #-}
-                            Set.empty
-                            {-# LINE 4896 "Transform.hs" #-}
-                            )
-                       -- copy rule (chain)
-                       _lhsOattrDecls =
-                           ({-# LINE 137 "Transform.ag" #-}
-                            _lhsIattrDecls
-                            {-# LINE 4902 "Transform.hs" #-}
-                            )
-                       -- copy rule (chain)
-                       _lhsOdefSets =
-                           ({-# LINE 105 "Transform.ag" #-}
-                            _lhsIdefSets
-                            {-# LINE 4908 "Transform.hs" #-}
-                            )
-                   in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
--- NontSet -----------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allFields            : DataTypes
-         allNonterminals      : Set NontermIdent
-         definedSets          : DefinedSets
-      synthesized attributes:
-         collectedNames       : Set Identifier
-         errors               : Seq Error
-         nontSet              : Set NontermIdent
-   alternatives:
-      alternative All:
-      alternative Difference:
-         child set1           : NontSet 
-         child set2           : NontSet 
-      alternative Intersect:
-         child set1           : NontSet 
-         child set2           : NontSet 
-      alternative NamedSet:
-         child name           : {NontermIdent}
-         visit 0:
-            local _tup4       : _
-            local nontSet     : _
-            local errors      : _
-      alternative Path:
-         child from           : {NontermIdent}
-         child to             : {NontermIdent}
-      alternative Union:
-         child set1           : NontSet 
-         child set2           : NontSet 
--}
--- cata
-sem_NontSet :: NontSet  ->
-               T_NontSet 
-sem_NontSet (All )  =
-    (sem_NontSet_All )
-sem_NontSet (Difference _set1 _set2 )  =
-    (sem_NontSet_Difference (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
-sem_NontSet (Intersect _set1 _set2 )  =
-    (sem_NontSet_Intersect (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
-sem_NontSet (NamedSet _name )  =
-    (sem_NontSet_NamedSet _name )
-sem_NontSet (Path _from _to )  =
-    (sem_NontSet_Path _from _to )
-sem_NontSet (Union _set1 _set2 )  =
-    (sem_NontSet_Union (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
--- semantic domain
-newtype T_NontSet  = T_NontSet (DataTypes ->
-                                (Set NontermIdent) ->
-                                DefinedSets ->
-                                ( (Set Identifier),(Seq Error),(Set NontermIdent)))
-data Inh_NontSet  = Inh_NontSet {allFields_Inh_NontSet :: !(DataTypes),allNonterminals_Inh_NontSet :: !((Set NontermIdent)),definedSets_Inh_NontSet :: !(DefinedSets)}
-data Syn_NontSet  = Syn_NontSet {collectedNames_Syn_NontSet :: !((Set Identifier)),errors_Syn_NontSet :: !((Seq Error)),nontSet_Syn_NontSet :: !((Set NontermIdent))}
-wrap_NontSet :: T_NontSet  ->
-                Inh_NontSet  ->
-                Syn_NontSet 
-wrap_NontSet (T_NontSet sem ) (Inh_NontSet _lhsIallFields _lhsIallNonterminals _lhsIdefinedSets )  =
-    (let ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet) = sem _lhsIallFields _lhsIallNonterminals _lhsIdefinedSets 
-     in  (Syn_NontSet _lhsOcollectedNames _lhsOerrors _lhsOnontSet ))
-sem_NontSet_All :: T_NontSet 
-sem_NontSet_All  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOnontSet :: (Set NontermIdent)
-                         _lhsOcollectedNames :: (Set Identifier)
-                         _lhsOerrors :: (Seq Error)
-                         -- "Transform.ag"(line 677, column 16)
-                         _lhsOnontSet =
-                             ({-# LINE 677 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 4983 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 87, column 50)
-                         _lhsOcollectedNames =
-                             ({-# LINE 87 "Transform.ag" #-}
-                              Set.empty
-                              {-# LINE 4989 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              Seq.empty
-                              {-# LINE 4995 "Transform.hs" #-}
-                              )
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
-sem_NontSet_Difference :: T_NontSet  ->
-                          T_NontSet  ->
-                          T_NontSet 
-sem_NontSet_Difference (T_NontSet set1_ ) (T_NontSet set2_ )  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOnontSet :: (Set NontermIdent)
-                         _lhsOcollectedNames :: (Set Identifier)
-                         _lhsOerrors :: (Seq Error)
-                         _set1OallFields :: DataTypes
-                         _set1OallNonterminals :: (Set NontermIdent)
-                         _set1OdefinedSets :: DefinedSets
-                         _set2OallFields :: DataTypes
-                         _set2OallNonterminals :: (Set NontermIdent)
-                         _set2OdefinedSets :: DefinedSets
-                         _set1IcollectedNames :: (Set Identifier)
-                         _set1Ierrors :: (Seq Error)
-                         _set1InontSet :: (Set NontermIdent)
-                         _set2IcollectedNames :: (Set Identifier)
-                         _set2Ierrors :: (Seq Error)
-                         _set2InontSet :: (Set NontermIdent)
-                         -- "Transform.ag"(line 683, column 16)
-                         _lhsOnontSet =
-                             ({-# LINE 683 "Transform.ag" #-}
-                              Set.difference    _set1InontSet _set2InontSet
-                              {-# LINE 5024 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 87, column 50)
-                         _lhsOcollectedNames =
-                             ({-# LINE 87 "Transform.ag" #-}
-                              _set1IcollectedNames `Set.union` _set2IcollectedNames
-                              {-# LINE 5030 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _set1Ierrors Seq.>< _set2Ierrors
-                              {-# LINE 5036 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5042 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5048 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5054 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5060 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5066 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5072 "Transform.hs" #-}
-                              )
-                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
-                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
-                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
-                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
-sem_NontSet_Intersect :: T_NontSet  ->
-                         T_NontSet  ->
-                         T_NontSet 
-sem_NontSet_Intersect (T_NontSet set1_ ) (T_NontSet set2_ )  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOnontSet :: (Set NontermIdent)
-                         _lhsOcollectedNames :: (Set Identifier)
-                         _lhsOerrors :: (Seq Error)
-                         _set1OallFields :: DataTypes
-                         _set1OallNonterminals :: (Set NontermIdent)
-                         _set1OdefinedSets :: DefinedSets
-                         _set2OallFields :: DataTypes
-                         _set2OallNonterminals :: (Set NontermIdent)
-                         _set2OdefinedSets :: DefinedSets
-                         _set1IcollectedNames :: (Set Identifier)
-                         _set1Ierrors :: (Seq Error)
-                         _set1InontSet :: (Set NontermIdent)
-                         _set2IcollectedNames :: (Set Identifier)
-                         _set2Ierrors :: (Seq Error)
-                         _set2InontSet :: (Set NontermIdent)
-                         -- "Transform.ag"(line 682, column 16)
-                         _lhsOnontSet =
-                             ({-# LINE 682 "Transform.ag" #-}
-                              Set.intersection  _set1InontSet _set2InontSet
-                              {-# LINE 5105 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 87, column 50)
-                         _lhsOcollectedNames =
-                             ({-# LINE 87 "Transform.ag" #-}
-                              _set1IcollectedNames `Set.union` _set2IcollectedNames
-                              {-# LINE 5111 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _set1Ierrors Seq.>< _set2Ierrors
-                              {-# LINE 5117 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5123 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5129 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5135 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5141 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5147 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5153 "Transform.hs" #-}
-                              )
-                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
-                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
-                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
-                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
-sem_NontSet_NamedSet :: NontermIdent ->
-                        T_NontSet 
-sem_NontSet_NamedSet name_  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOcollectedNames :: (Set Identifier)
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOnontSet :: (Set NontermIdent)
-                         -- "Transform.ag"(line 558, column 14)
-                         _lhsOcollectedNames =
-                             ({-# LINE 558 "Transform.ag" #-}
-                              Set.singleton name_
-                              {-# LINE 5173 "Transform.hs" #-}
-                              )
-                         -- "Transform.ag"(line 678, column 20)
-                         __tup4 =
-                             ({-# LINE 678 "Transform.ag" #-}
-                              case Map.lookup name_ _lhsIdefinedSets of
-                                           Nothing  -> (Set.empty, Seq.singleton (UndefNont name_))
-                                           Just set -> (set, Seq.empty)
-                              {-# LINE 5181 "Transform.hs" #-}
-                              )
-                         -- "Transform.ag"(line 678, column 20)
-                         (_nontSet,_) =
-                             ({-# LINE 678 "Transform.ag" #-}
-                              __tup4
-                              {-# LINE 5187 "Transform.hs" #-}
-                              )
-                         -- "Transform.ag"(line 678, column 20)
-                         (_,_errors) =
-                             ({-# LINE 678 "Transform.ag" #-}
-                              __tup4
-                              {-# LINE 5193 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _errors
-                              {-# LINE 5199 "Transform.hs" #-}
-                              )
-                         -- copy rule (from local)
-                         _lhsOnontSet =
-                             ({-# LINE 113 "Transform.ag" #-}
-                              _nontSet
-                              {-# LINE 5205 "Transform.hs" #-}
-                              )
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
-sem_NontSet_Path :: NontermIdent ->
-                    NontermIdent ->
-                    T_NontSet 
-sem_NontSet_Path from_ to_  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOnontSet :: (Set NontermIdent)
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOcollectedNames :: (Set Identifier)
-                         -- "Transform.ag"(line 684, column 16)
-                         _lhsOnontSet =
-                             ({-# LINE 684 "Transform.ag" #-}
-                              let table = flattenDatas _lhsIallFields
-                              in path table from_ to_
-                              {-# LINE 5223 "Transform.hs" #-}
-                              )
-                         -- "Transform.ag"(line 686, column 16)
-                         _lhsOerrors =
-                             ({-# LINE 686 "Transform.ag" #-}
-                              let check name | Set.member name _lhsIallNonterminals
-                                                         = Seq.empty
-                                             | otherwise = Seq.singleton (UndefNont name)
-                              in check from_ >< check to_
-                              {-# LINE 5232 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 87, column 50)
-                         _lhsOcollectedNames =
-                             ({-# LINE 87 "Transform.ag" #-}
-                              Set.empty
-                              {-# LINE 5238 "Transform.hs" #-}
-                              )
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
-sem_NontSet_Union :: T_NontSet  ->
-                     T_NontSet  ->
-                     T_NontSet 
-sem_NontSet_Union (T_NontSet set1_ ) (T_NontSet set2_ )  =
-    (T_NontSet (\ _lhsIallFields
-                  _lhsIallNonterminals
-                  _lhsIdefinedSets ->
-                    (let _lhsOnontSet :: (Set NontermIdent)
-                         _lhsOcollectedNames :: (Set Identifier)
-                         _lhsOerrors :: (Seq Error)
-                         _set1OallFields :: DataTypes
-                         _set1OallNonterminals :: (Set NontermIdent)
-                         _set1OdefinedSets :: DefinedSets
-                         _set2OallFields :: DataTypes
-                         _set2OallNonterminals :: (Set NontermIdent)
-                         _set2OdefinedSets :: DefinedSets
-                         _set1IcollectedNames :: (Set Identifier)
-                         _set1Ierrors :: (Seq Error)
-                         _set1InontSet :: (Set NontermIdent)
-                         _set2IcollectedNames :: (Set Identifier)
-                         _set2Ierrors :: (Seq Error)
-                         _set2InontSet :: (Set NontermIdent)
-                         -- "Transform.ag"(line 681, column 16)
-                         _lhsOnontSet =
-                             ({-# LINE 681 "Transform.ag" #-}
-                              Set.union         _set1InontSet _set2InontSet
-                              {-# LINE 5267 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 87, column 50)
-                         _lhsOcollectedNames =
-                             ({-# LINE 87 "Transform.ag" #-}
-                              _set1IcollectedNames `Set.union` _set2IcollectedNames
-                              {-# LINE 5273 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _set1Ierrors Seq.>< _set2Ierrors
-                              {-# LINE 5279 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5285 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5291 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set1OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5297 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 5303 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OallNonterminals =
-                             ({-# LINE 89 "Transform.ag" #-}
-                              _lhsIallNonterminals
-                              {-# LINE 5309 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _set2OdefinedSets =
-                             ({-# LINE 108 "Transform.ag" #-}
-                              _lhsIdefinedSets
-                              {-# LINE 5315 "Transform.hs" #-}
-                              )
-                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
-                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
-                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
-                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
-                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
--- Pattern -----------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         copy                 : SELF 
-         definedAttrs         : [AttrName]
-         definedInsts         : [Identifier]
-         patunder             : [AttrName]->Pattern
-         stpos                : Pos
-   alternatives:
-      alternative Alias:
-         child field          : {Identifier}
-         child attr           : {Identifier}
-         child pat            : Pattern 
-         child parts          : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Constr:
-         child name           : {ConstructorIdent}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Irrefutable:
-         child pat            : Pattern 
-         visit 0:
-            local copy        : _
-      alternative Product:
-         child pos            : {Pos}
-         child pats           : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Underscore:
-         child pos            : {Pos}
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Pattern :: Pattern  ->
-               T_Pattern 
-sem_Pattern (Alias _field _attr _pat _parts )  =
-    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
-sem_Pattern (Constr _name _pats )  =
-    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
-sem_Pattern (Irrefutable _pat )  =
-    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
-sem_Pattern (Product _pos _pats )  =
-    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
-sem_Pattern (Underscore _pos )  =
-    (sem_Pattern_Underscore _pos )
--- semantic domain
-newtype T_Pattern  = T_Pattern (( Pattern ,([AttrName]),([Identifier]),([AttrName]->Pattern),Pos))
-data Inh_Pattern  = Inh_Pattern {}
-data Syn_Pattern  = Syn_Pattern {copy_Syn_Pattern :: !(Pattern ),definedAttrs_Syn_Pattern :: !(([AttrName])),definedInsts_Syn_Pattern :: !(([Identifier])),patunder_Syn_Pattern :: !(([AttrName]->Pattern)),stpos_Syn_Pattern :: !(Pos)}
-wrap_Pattern :: T_Pattern  ->
-                Inh_Pattern  ->
-                Syn_Pattern 
-wrap_Pattern (T_Pattern sem ) (Inh_Pattern )  =
-    (let ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos) = sem 
-     in  (Syn_Pattern _lhsOcopy _lhsOdefinedAttrs _lhsOdefinedInsts _lhsOpatunder _lhsOstpos ))
-sem_Pattern_Alias :: Identifier ->
-                     Identifier ->
-                     T_Pattern  ->
-                     T_Patterns  ->
-                     T_Pattern 
-sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
-    (T_Pattern (let _lhsOdefinedAttrs :: ([AttrName])
-                    _lhsOpatunder :: ([AttrName]->Pattern)
-                    _lhsOdefinedInsts :: ([Identifier])
-                    _lhsOstpos :: Pos
-                    _lhsOcopy :: Pattern 
-                    _patIcopy :: Pattern 
-                    _patIdefinedAttrs :: ([AttrName])
-                    _patIdefinedInsts :: ([Identifier])
-                    _patIpatunder :: ([AttrName]->Pattern)
-                    _patIstpos :: Pos
-                    _partsIcopy :: Patterns 
-                    _partsIdefinedAttrs :: ([AttrName])
-                    _partsIdefinedInsts :: ([Identifier])
-                    _partsIpatunder :: ([AttrName]->Patterns)
-                    -- "Transform.ag"(line 1090, column 11)
-                    _lhsOdefinedAttrs =
-                        ({-# LINE 1090 "Transform.ag" #-}
-                         (field_, attr_) : _patIdefinedAttrs
-                         {-# LINE 5405 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1091, column 11)
-                    _lhsOpatunder =
-                        ({-# LINE 1091 "Transform.ag" #-}
-                         \us -> if ((field_,attr_) `elem` us) then Underscore noPos else _copy
-                         {-# LINE 5411 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1092, column 11)
-                    _lhsOdefinedInsts =
-                        ({-# LINE 1092 "Transform.ag" #-}
-                         (if field_ == _INST then [attr_] else []) ++ _patIdefinedInsts
-                         {-# LINE 5417 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1107, column 16)
-                    _lhsOstpos =
-                        ({-# LINE 1107 "Transform.ag" #-}
-                         getPos field_
-                         {-# LINE 5423 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Alias field_ attr_ _patIcopy _partsIcopy
-                         {-# LINE 5429 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 5435 "Transform.hs" #-}
-                         )
-                    ( _patIcopy,_patIdefinedAttrs,_patIdefinedInsts,_patIpatunder,_patIstpos) =
-                        pat_ 
-                    ( _partsIcopy,_partsIdefinedAttrs,_partsIdefinedInsts,_partsIpatunder) =
-                        parts_ 
-                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
-sem_Pattern_Constr :: ConstructorIdent ->
-                      T_Patterns  ->
-                      T_Pattern 
-sem_Pattern_Constr name_ (T_Patterns pats_ )  =
-    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
-                    _lhsOstpos :: Pos
-                    _lhsOdefinedAttrs :: ([AttrName])
-                    _lhsOdefinedInsts :: ([Identifier])
-                    _lhsOcopy :: Pattern 
-                    _patsIcopy :: Patterns 
-                    _patsIdefinedAttrs :: ([AttrName])
-                    _patsIdefinedInsts :: ([Identifier])
-                    _patsIpatunder :: ([AttrName]->Patterns)
-                    -- "Transform.ag"(line 1094, column 12)
-                    _lhsOpatunder =
-                        ({-# LINE 1094 "Transform.ag" #-}
-                         \us -> Constr name_ (_patsIpatunder us)
-                         {-# LINE 5459 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1105, column 16)
-                    _lhsOstpos =
-                        ({-# LINE 1105 "Transform.ag" #-}
-                         getPos name_
-                         {-# LINE 5465 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1085, column 42)
-                    _lhsOdefinedAttrs =
-                        ({-# LINE 1085 "Transform.ag" #-}
-                         _patsIdefinedAttrs
-                         {-# LINE 5471 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1084, column 55)
-                    _lhsOdefinedInsts =
-                        ({-# LINE 1084 "Transform.ag" #-}
-                         _patsIdefinedInsts
-                         {-# LINE 5477 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Constr name_ _patsIcopy
-                         {-# LINE 5483 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 5489 "Transform.hs" #-}
-                         )
-                    ( _patsIcopy,_patsIdefinedAttrs,_patsIdefinedInsts,_patsIpatunder) =
-                        pats_ 
-                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
-sem_Pattern_Irrefutable :: T_Pattern  ->
-                           T_Pattern 
-sem_Pattern_Irrefutable (T_Pattern pat_ )  =
-    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
-                    _lhsOdefinedAttrs :: ([AttrName])
-                    _lhsOdefinedInsts :: ([Identifier])
-                    _lhsOcopy :: Pattern 
-                    _lhsOstpos :: Pos
-                    _patIcopy :: Pattern 
-                    _patIdefinedAttrs :: ([AttrName])
-                    _patIdefinedInsts :: ([Identifier])
-                    _patIpatunder :: ([AttrName]->Pattern)
-                    _patIstpos :: Pos
-                    -- "Transform.ag"(line 1096, column 17)
-                    _lhsOpatunder =
-                        ({-# LINE 1096 "Transform.ag" #-}
-                         \us -> Irrefutable (_patIpatunder us)
-                         {-# LINE 5511 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1085, column 42)
-                    _lhsOdefinedAttrs =
-                        ({-# LINE 1085 "Transform.ag" #-}
-                         _patIdefinedAttrs
-                         {-# LINE 5517 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1084, column 55)
-                    _lhsOdefinedInsts =
-                        ({-# LINE 1084 "Transform.ag" #-}
-                         _patIdefinedInsts
-                         {-# LINE 5523 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Irrefutable _patIcopy
-                         {-# LINE 5529 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 5535 "Transform.hs" #-}
-                         )
-                    -- copy rule (up)
-                    _lhsOstpos =
-                        ({-# LINE 1102 "Transform.ag" #-}
-                         _patIstpos
-                         {-# LINE 5541 "Transform.hs" #-}
-                         )
-                    ( _patIcopy,_patIdefinedAttrs,_patIdefinedInsts,_patIpatunder,_patIstpos) =
-                        pat_ 
-                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
-sem_Pattern_Product :: Pos ->
-                       T_Patterns  ->
-                       T_Pattern 
-sem_Pattern_Product pos_ (T_Patterns pats_ )  =
-    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
-                    _lhsOstpos :: Pos
-                    _lhsOdefinedAttrs :: ([AttrName])
-                    _lhsOdefinedInsts :: ([Identifier])
-                    _lhsOcopy :: Pattern 
-                    _patsIcopy :: Patterns 
-                    _patsIdefinedAttrs :: ([AttrName])
-                    _patsIdefinedInsts :: ([Identifier])
-                    _patsIpatunder :: ([AttrName]->Patterns)
-                    -- "Transform.ag"(line 1095, column 13)
-                    _lhsOpatunder =
-                        ({-# LINE 1095 "Transform.ag" #-}
-                         \us -> Product pos_ (_patsIpatunder us)
-                         {-# LINE 5563 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1106, column 16)
-                    _lhsOstpos =
-                        ({-# LINE 1106 "Transform.ag" #-}
-                         pos_
-                         {-# LINE 5569 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1085, column 42)
-                    _lhsOdefinedAttrs =
-                        ({-# LINE 1085 "Transform.ag" #-}
-                         _patsIdefinedAttrs
-                         {-# LINE 5575 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1084, column 55)
-                    _lhsOdefinedInsts =
-                        ({-# LINE 1084 "Transform.ag" #-}
-                         _patsIdefinedInsts
-                         {-# LINE 5581 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Product pos_ _patsIcopy
-                         {-# LINE 5587 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 5593 "Transform.hs" #-}
-                         )
-                    ( _patsIcopy,_patsIdefinedAttrs,_patsIdefinedInsts,_patsIpatunder) =
-                        pats_ 
-                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
-sem_Pattern_Underscore :: Pos ->
-                          T_Pattern 
-sem_Pattern_Underscore pos_  =
-    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
-                    _lhsOstpos :: Pos
-                    _lhsOdefinedAttrs :: ([AttrName])
-                    _lhsOdefinedInsts :: ([Identifier])
-                    _lhsOcopy :: Pattern 
-                    -- "Transform.ag"(line 1093, column 16)
-                    _lhsOpatunder =
-                        ({-# LINE 1093 "Transform.ag" #-}
-                         \us -> _copy
-                         {-# LINE 5610 "Transform.hs" #-}
-                         )
-                    -- "Transform.ag"(line 1108, column 16)
-                    _lhsOstpos =
-                        ({-# LINE 1108 "Transform.ag" #-}
-                         pos_
-                         {-# LINE 5616 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1085, column 42)
-                    _lhsOdefinedAttrs =
-                        ({-# LINE 1085 "Transform.ag" #-}
-                         []
-                         {-# LINE 5622 "Transform.hs" #-}
-                         )
-                    -- use rule "Transform.ag"(line 1084, column 55)
-                    _lhsOdefinedInsts =
-                        ({-# LINE 1084 "Transform.ag" #-}
-                         []
-                         {-# LINE 5628 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _copy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         Underscore pos_
-                         {-# LINE 5634 "Transform.hs" #-}
-                         )
-                    -- self rule
-                    _lhsOcopy =
-                        ({-# LINE 23 "./Patterns.ag" #-}
-                         _copy
-                         {-# LINE 5640 "Transform.hs" #-}
-                         )
-                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
--- Patterns ----------------------------------------------------
-{-
-   visit 0:
-      synthesized attributes:
-         copy                 : SELF 
-         definedAttrs         : [AttrName]
-         definedInsts         : [Identifier]
-         patunder             : [AttrName]->Patterns
-   alternatives:
-      alternative Cons:
-         child hd             : Pattern 
-         child tl             : Patterns 
-         visit 0:
-            local copy        : _
-      alternative Nil:
-         visit 0:
-            local copy        : _
--}
--- cata
-sem_Patterns :: Patterns  ->
-                T_Patterns 
-sem_Patterns list  =
-    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
--- semantic domain
-newtype T_Patterns  = T_Patterns (( Patterns ,([AttrName]),([Identifier]),([AttrName]->Patterns)))
-data Inh_Patterns  = Inh_Patterns {}
-data Syn_Patterns  = Syn_Patterns {copy_Syn_Patterns :: !(Patterns ),definedAttrs_Syn_Patterns :: !(([AttrName])),definedInsts_Syn_Patterns :: !(([Identifier])),patunder_Syn_Patterns :: !(([AttrName]->Patterns))}
-wrap_Patterns :: T_Patterns  ->
-                 Inh_Patterns  ->
-                 Syn_Patterns 
-wrap_Patterns (T_Patterns sem ) (Inh_Patterns )  =
-    (let ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder) = sem 
-     in  (Syn_Patterns _lhsOcopy _lhsOdefinedAttrs _lhsOdefinedInsts _lhsOpatunder ))
-sem_Patterns_Cons :: T_Pattern  ->
-                     T_Patterns  ->
-                     T_Patterns 
-sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
-    (T_Patterns (let _lhsOpatunder :: ([AttrName]->Patterns)
-                     _lhsOdefinedAttrs :: ([AttrName])
-                     _lhsOdefinedInsts :: ([Identifier])
-                     _lhsOcopy :: Patterns 
-                     _hdIcopy :: Pattern 
-                     _hdIdefinedAttrs :: ([AttrName])
-                     _hdIdefinedInsts :: ([Identifier])
-                     _hdIpatunder :: ([AttrName]->Pattern)
-                     _hdIstpos :: Pos
-                     _tlIcopy :: Patterns 
-                     _tlIdefinedAttrs :: ([AttrName])
-                     _tlIdefinedInsts :: ([Identifier])
-                     _tlIpatunder :: ([AttrName]->Patterns)
-                     -- "Transform.ag"(line 1100, column 10)
-                     _lhsOpatunder =
-                         ({-# LINE 1100 "Transform.ag" #-}
-                          \us -> (_hdIpatunder us) : (_tlIpatunder us)
-                          {-# LINE 5697 "Transform.hs" #-}
-                          )
-                     -- use rule "Transform.ag"(line 1085, column 42)
-                     _lhsOdefinedAttrs =
-                         ({-# LINE 1085 "Transform.ag" #-}
-                          _hdIdefinedAttrs ++ _tlIdefinedAttrs
-                          {-# LINE 5703 "Transform.hs" #-}
-                          )
-                     -- use rule "Transform.ag"(line 1084, column 55)
-                     _lhsOdefinedInsts =
-                         ({-# LINE 1084 "Transform.ag" #-}
-                          _hdIdefinedInsts ++ _tlIdefinedInsts
-                          {-# LINE 5709 "Transform.hs" #-}
-                          )
-                     -- self rule
-                     _copy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          (:) _hdIcopy _tlIcopy
-                          {-# LINE 5715 "Transform.hs" #-}
-                          )
-                     -- self rule
-                     _lhsOcopy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          _copy
-                          {-# LINE 5721 "Transform.hs" #-}
-                          )
-                     ( _hdIcopy,_hdIdefinedAttrs,_hdIdefinedInsts,_hdIpatunder,_hdIstpos) =
-                         hd_ 
-                     ( _tlIcopy,_tlIdefinedAttrs,_tlIdefinedInsts,_tlIpatunder) =
-                         tl_ 
-                 in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder)) )
-sem_Patterns_Nil :: T_Patterns 
-sem_Patterns_Nil  =
-    (T_Patterns (let _lhsOpatunder :: ([AttrName]->Patterns)
-                     _lhsOdefinedAttrs :: ([AttrName])
-                     _lhsOdefinedInsts :: ([Identifier])
-                     _lhsOcopy :: Patterns 
-                     -- "Transform.ag"(line 1099, column 9)
-                     _lhsOpatunder =
-                         ({-# LINE 1099 "Transform.ag" #-}
-                          \us ->  []
-                          {-# LINE 5738 "Transform.hs" #-}
-                          )
-                     -- use rule "Transform.ag"(line 1085, column 42)
-                     _lhsOdefinedAttrs =
-                         ({-# LINE 1085 "Transform.ag" #-}
-                          []
-                          {-# LINE 5744 "Transform.hs" #-}
-                          )
-                     -- use rule "Transform.ag"(line 1084, column 55)
-                     _lhsOdefinedInsts =
-                         ({-# LINE 1084 "Transform.ag" #-}
-                          []
-                          {-# LINE 5750 "Transform.hs" #-}
-                          )
-                     -- self rule
-                     _copy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          []
-                          {-# LINE 5756 "Transform.hs" #-}
-                          )
-                     -- self rule
-                     _lhsOcopy =
-                         ({-# LINE 23 "./Patterns.ag" #-}
-                          _copy
-                          {-# LINE 5762 "Transform.hs" #-}
-                          )
-                 in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder)) )
--- SemAlt ------------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
-         allFields            : DataTypes
-         nts                  : Set NontermIdent
-         options              : Options
-      synthesized attributes:
-         attrOrderCollect     : AttrOrderMap
-         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
-         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
-         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
-         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
-         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
-         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
-         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
-         errors               : Seq Error
-         semPragmasCollect    : PragmaMap
-   alternatives:
-      alternative SemAlt:
-         child pos            : {Pos}
-         child constructorSet : ConstructorSet 
-         child rules          : SemDefs 
-         visit 0:
-            local pragmaNames : _
-            local attrOrders  : _
-            local coninfo     : _
--}
--- cata
-sem_SemAlt :: SemAlt  ->
-              T_SemAlt 
-sem_SemAlt (SemAlt _pos _constructorSet _rules )  =
-    (sem_SemAlt_SemAlt _pos (sem_ConstructorSet _constructorSet ) (sem_SemDefs _rules ) )
--- semantic domain
-newtype T_SemAlt  = T_SemAlt ((Map NontermIdent (Attributes, Attributes)) ->
-                              DataTypes ->
-                              (Set NontermIdent) ->
-                              Options ->
-                              ( AttrOrderMap,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),([ (NontermIdent, ConstructorIdent, RuleInfo)]),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),(Seq Error),PragmaMap))
-data Inh_SemAlt  = Inh_SemAlt {allAttrDecls_Inh_SemAlt :: !((Map NontermIdent (Attributes, Attributes))),allFields_Inh_SemAlt :: !(DataTypes),nts_Inh_SemAlt :: !((Set NontermIdent)),options_Inh_SemAlt :: !(Options)}
-data Syn_SemAlt  = Syn_SemAlt {attrOrderCollect_Syn_SemAlt :: !(AttrOrderMap),collectedArounds_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedInsts_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedRules_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSigs_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),errors_Syn_SemAlt :: !((Seq Error)),semPragmasCollect_Syn_SemAlt :: !(PragmaMap)}
-wrap_SemAlt :: T_SemAlt  ->
-               Inh_SemAlt  ->
-               Syn_SemAlt 
-wrap_SemAlt (T_SemAlt sem ) (Inh_SemAlt _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions )  =
-    (let ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect) = sem _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions 
-     in  (Syn_SemAlt _lhsOattrOrderCollect _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedRules _lhsOcollectedSigs _lhsOcollectedUniques _lhsOerrors _lhsOsemPragmasCollect ))
-sem_SemAlt_SemAlt :: Pos ->
-                     T_ConstructorSet  ->
-                     T_SemDefs  ->
-                     T_SemAlt 
-sem_SemAlt_SemAlt pos_ (T_ConstructorSet constructorSet_ ) (T_SemDefs rules_ )  =
-    (T_SemAlt (\ _lhsIallAttrDecls
-                 _lhsIallFields
-                 _lhsInts
-                 _lhsIoptions ->
-                   (let _lhsOsemPragmasCollect :: PragmaMap
-                        _lhsOattrOrderCollect :: AttrOrderMap
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                        _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                        _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                        _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                        _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                        _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                        _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                        _rulesOoptions :: Options
-                        _constructorSetIcollectedConstructorNames :: (Set ConstructorIdent)
-                        _constructorSetIconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
-                        _constructorSetIerrors :: (Seq Error)
-                        _rulesIaroundInfos :: ([AroundInfo])
-                        _rulesIaugmentInfos :: ([AugmentInfo])
-                        _rulesIdefinedInsts :: ([Identifier])
-                        _rulesIerrors :: (Seq Error)
-                        _rulesImergeInfos :: ([MergeInfo])
-                        _rulesIorderDepsCollect :: (Set Dependency)
-                        _rulesIpragmaNamesCollect :: ([Identifier])
-                        _rulesIruleInfos :: ([RuleInfo])
-                        _rulesIsigInfos :: ([SigInfo])
-                        _rulesIuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 797, column 7)
-                        _pragmaNames =
-                            ({-# LINE 797 "Transform.ag" #-}
-                             Set.fromList _rulesIpragmaNamesCollect
-                             {-# LINE 5850 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 798, column 7)
-                        _lhsOsemPragmasCollect =
-                            ({-# LINE 798 "Transform.ag" #-}
-                             foldr pragmaMapUnion Map.empty [ pragmaMapSingle nt con _pragmaNames
-                                                            | (nt, conset, _) <- _coninfo
-                                                            , con <- Set.toList conset
-                                                            ]
-                             {-# LINE 5859 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 826, column 7)
-                        _attrOrders =
-                            ({-# LINE 826 "Transform.ag" #-}
-                             [ orderMapSingle nt con _rulesIorderDepsCollect
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5868 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 832, column 7)
-                        _lhsOattrOrderCollect =
-                            ({-# LINE 832 "Transform.ag" #-}
-                             foldr orderMapUnion Map.empty _attrOrders
-                             {-# LINE 5874 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1009, column 12)
-                        _coninfo =
-                            ({-# LINE 1009 "Transform.ag" #-}
-                             [ (nt, conset, conkeys)
-                             | nt  <- Set.toList _lhsInts
-                             , let conmap = Map.findWithDefault Map.empty nt _lhsIallFields
-                             , let conkeys = Set.fromList (Map.keys conmap)
-                             , let conset  = _constructorSetIconstructors conkeys
-                             ]
-                             {-# LINE 5885 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1016, column 12)
-                        _lhsOerrors =
-                            ({-# LINE 1016 "Transform.ag" #-}
-                             Seq.fromList
-                                [ UndefAlt nt con
-                                | (nt, conset, conkeys) <- _coninfo
-                                , con <- Set.toList (Set.difference conset conkeys)
-                                ]
-                             Seq.>< _rulesIerrors
-                             {-# LINE 5896 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1022, column 12)
-                        _lhsOcollectedRules =
-                            ({-# LINE 1022 "Transform.ag" #-}
-                             [ (nt,con,r)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             , r <- _rulesIruleInfos
-                             ]
-                             {-# LINE 5906 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1028, column 12)
-                        _lhsOcollectedSigs =
-                            ({-# LINE 1028 "Transform.ag" #-}
-                             [ (nt,con,ts)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             , ts <- _rulesIsigInfos
-                             ]
-                             {-# LINE 5916 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1035, column 12)
-                        _lhsOcollectedInsts =
-                            ({-# LINE 1035 "Transform.ag" #-}
-                             [ (nt,con,_rulesIdefinedInsts)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5925 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1041, column 12)
-                        _lhsOcollectedUniques =
-                            ({-# LINE 1041 "Transform.ag" #-}
-                             [ (nt,con,_rulesIuniqueInfos)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5934 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1047, column 12)
-                        _lhsOcollectedAugments =
-                            ({-# LINE 1047 "Transform.ag" #-}
-                             [ (nt, con, _rulesIaugmentInfos)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5943 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1053, column 12)
-                        _lhsOcollectedArounds =
-                            ({-# LINE 1053 "Transform.ag" #-}
-                             [ (nt, con, _rulesIaroundInfos)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5952 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1059, column 12)
-                        _lhsOcollectedMerges =
-                            ({-# LINE 1059 "Transform.ag" #-}
-                             [ (nt, con, _rulesImergeInfos)
-                             | (nt, conset, _) <- _coninfo
-                             , con <- Set.toList conset
-                             ]
-                             {-# LINE 5961 "Transform.hs" #-}
-                             )
-                        -- copy rule (down)
-                        _rulesOoptions =
-                            ({-# LINE 39 "Transform.ag" #-}
-                             _lhsIoptions
-                             {-# LINE 5967 "Transform.hs" #-}
-                             )
-                        ( _constructorSetIcollectedConstructorNames,_constructorSetIconstructors,_constructorSetIerrors) =
-                            constructorSet_ 
-                        ( _rulesIaroundInfos,_rulesIaugmentInfos,_rulesIdefinedInsts,_rulesIerrors,_rulesImergeInfos,_rulesIorderDepsCollect,_rulesIpragmaNamesCollect,_rulesIruleInfos,_rulesIsigInfos,_rulesIuniqueInfos) =
-                            rules_ _rulesOoptions 
-                    in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
--- SemAlts -----------------------------------------------------
-{-
-   visit 0:
-      inherited attributes:
-         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
-         allFields            : DataTypes
-         nts                  : Set NontermIdent
-         options              : Options
-      synthesized attributes:
-         attrOrderCollect     : AttrOrderMap
-         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
-         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
-         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
-         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
-         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
-         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
-         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
-         errors               : Seq Error
-         semPragmasCollect    : PragmaMap
-   alternatives:
-      alternative Cons:
-         child hd             : SemAlt 
-         child tl             : SemAlts 
-      alternative Nil:
--}
--- cata
-sem_SemAlts :: SemAlts  ->
-               T_SemAlts 
-sem_SemAlts list  =
-    (Prelude.foldr sem_SemAlts_Cons sem_SemAlts_Nil (Prelude.map sem_SemAlt list) )
--- semantic domain
-newtype T_SemAlts  = T_SemAlts ((Map NontermIdent (Attributes, Attributes)) ->
-                                DataTypes ->
-                                (Set NontermIdent) ->
-                                Options ->
-                                ( AttrOrderMap,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),([ (NontermIdent, ConstructorIdent, RuleInfo)]),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),(Seq Error),PragmaMap))
-data Inh_SemAlts  = Inh_SemAlts {allAttrDecls_Inh_SemAlts :: !((Map NontermIdent (Attributes, Attributes))),allFields_Inh_SemAlts :: !(DataTypes),nts_Inh_SemAlts :: !((Set NontermIdent)),options_Inh_SemAlts :: !(Options)}
-data Syn_SemAlts  = Syn_SemAlts {attrOrderCollect_Syn_SemAlts :: !(AttrOrderMap),collectedArounds_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedInsts_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedRules_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSigs_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),errors_Syn_SemAlts :: !((Seq Error)),semPragmasCollect_Syn_SemAlts :: !(PragmaMap)}
-wrap_SemAlts :: T_SemAlts  ->
-                Inh_SemAlts  ->
-                Syn_SemAlts 
-wrap_SemAlts (T_SemAlts sem ) (Inh_SemAlts _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions )  =
-    (let ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect) = sem _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions 
-     in  (Syn_SemAlts _lhsOattrOrderCollect _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedRules _lhsOcollectedSigs _lhsOcollectedUniques _lhsOerrors _lhsOsemPragmasCollect ))
-sem_SemAlts_Cons :: T_SemAlt  ->
-                    T_SemAlts  ->
-                    T_SemAlts 
-sem_SemAlts_Cons (T_SemAlt hd_ ) (T_SemAlts tl_ )  =
-    (T_SemAlts (\ _lhsIallAttrDecls
-                  _lhsIallFields
-                  _lhsInts
-                  _lhsIoptions ->
-                    (let _lhsOattrOrderCollect :: AttrOrderMap
-                         _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                         _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                         _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                         _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                         _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                         _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                         _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOsemPragmasCollect :: PragmaMap
-                         _hdOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                         _hdOallFields :: DataTypes
-                         _hdOnts :: (Set NontermIdent)
-                         _hdOoptions :: Options
-                         _tlOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
-                         _tlOallFields :: DataTypes
-                         _tlOnts :: (Set NontermIdent)
-                         _tlOoptions :: Options
-                         _hdIattrOrderCollect :: AttrOrderMap
-                         _hdIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                         _hdIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                         _hdIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                         _hdIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                         _hdIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                         _hdIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                         _hdIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                         _hdIerrors :: (Seq Error)
-                         _hdIsemPragmasCollect :: PragmaMap
-                         _tlIattrOrderCollect :: AttrOrderMap
-                         _tlIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                         _tlIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                         _tlIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                         _tlIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                         _tlIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                         _tlIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                         _tlIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                         _tlIerrors :: (Seq Error)
-                         _tlIsemPragmasCollect :: PragmaMap
-                         -- use rule "Transform.ag"(line 821, column 55)
-                         _lhsOattrOrderCollect =
-                             ({-# LINE 821 "Transform.ag" #-}
-                              _hdIattrOrderCollect `orderMapUnion` _tlIattrOrderCollect
-                              {-# LINE 6068 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 157, column 32)
-                         _lhsOcollectedArounds =
-                             ({-# LINE 157 "Transform.ag" #-}
-                              _hdIcollectedArounds ++ _tlIcollectedArounds
-                              {-# LINE 6074 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 156, column 32)
-                         _lhsOcollectedAugments =
-                             ({-# LINE 156 "Transform.ag" #-}
-                              _hdIcollectedAugments ++ _tlIcollectedAugments
-                              {-# LINE 6080 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 154, column 32)
-                         _lhsOcollectedInsts =
-                             ({-# LINE 154 "Transform.ag" #-}
-                              _hdIcollectedInsts ++ _tlIcollectedInsts
-                              {-# LINE 6086 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 158, column 32)
-                         _lhsOcollectedMerges =
-                             ({-# LINE 158 "Transform.ag" #-}
-                              _hdIcollectedMerges ++ _tlIcollectedMerges
-                              {-# LINE 6092 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 152, column 32)
-                         _lhsOcollectedRules =
-                             ({-# LINE 152 "Transform.ag" #-}
-                              _hdIcollectedRules ++ _tlIcollectedRules
-                              {-# LINE 6098 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 153, column 32)
-                         _lhsOcollectedSigs =
-                             ({-# LINE 153 "Transform.ag" #-}
-                              _hdIcollectedSigs ++ _tlIcollectedSigs
-                              {-# LINE 6104 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 155, column 32)
-                         _lhsOcollectedUniques =
-                             ({-# LINE 155 "Transform.ag" #-}
-                              _hdIcollectedUniques ++ _tlIcollectedUniques
-                              {-# LINE 6110 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _hdIerrors Seq.>< _tlIerrors
-                              {-# LINE 6116 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 793, column 56)
-                         _lhsOsemPragmasCollect =
-                             ({-# LINE 793 "Transform.ag" #-}
-                              _hdIsemPragmasCollect `pragmaMapUnion` _tlIsemPragmasCollect
-                              {-# LINE 6122 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _hdOallAttrDecls =
-                             ({-# LINE 822 "Transform.ag" #-}
-                              _lhsIallAttrDecls
-                              {-# LINE 6128 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _hdOallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 6134 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _hdOnts =
-                             ({-# LINE 168 "Transform.ag" #-}
-                              _lhsInts
-                              {-# LINE 6140 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _hdOoptions =
-                             ({-# LINE 39 "Transform.ag" #-}
-                              _lhsIoptions
-                              {-# LINE 6146 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _tlOallAttrDecls =
-                             ({-# LINE 822 "Transform.ag" #-}
-                              _lhsIallAttrDecls
-                              {-# LINE 6152 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _tlOallFields =
-                             ({-# LINE 129 "Transform.ag" #-}
-                              _lhsIallFields
-                              {-# LINE 6158 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _tlOnts =
-                             ({-# LINE 168 "Transform.ag" #-}
-                              _lhsInts
-                              {-# LINE 6164 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _tlOoptions =
-                             ({-# LINE 39 "Transform.ag" #-}
-                              _lhsIoptions
-                              {-# LINE 6170 "Transform.hs" #-}
-                              )
-                         ( _hdIattrOrderCollect,_hdIcollectedArounds,_hdIcollectedAugments,_hdIcollectedInsts,_hdIcollectedMerges,_hdIcollectedRules,_hdIcollectedSigs,_hdIcollectedUniques,_hdIerrors,_hdIsemPragmasCollect) =
-                             hd_ _hdOallAttrDecls _hdOallFields _hdOnts _hdOoptions 
-                         ( _tlIattrOrderCollect,_tlIcollectedArounds,_tlIcollectedAugments,_tlIcollectedInsts,_tlIcollectedMerges,_tlIcollectedRules,_tlIcollectedSigs,_tlIcollectedUniques,_tlIerrors,_tlIsemPragmasCollect) =
-                             tl_ _tlOallAttrDecls _tlOallFields _tlOnts _tlOoptions 
-                     in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
-sem_SemAlts_Nil :: T_SemAlts 
-sem_SemAlts_Nil  =
-    (T_SemAlts (\ _lhsIallAttrDecls
-                  _lhsIallFields
-                  _lhsInts
-                  _lhsIoptions ->
-                    (let _lhsOattrOrderCollect :: AttrOrderMap
-                         _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
-                         _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
-                         _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
-                         _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
-                         _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
-                         _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
-                         _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOsemPragmasCollect :: PragmaMap
-                         -- use rule "Transform.ag"(line 821, column 55)
-                         _lhsOattrOrderCollect =
-                             ({-# LINE 821 "Transform.ag" #-}
-                              Map.empty
-                              {-# LINE 6197 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 157, column 32)
-                         _lhsOcollectedArounds =
-                             ({-# LINE 157 "Transform.ag" #-}
-                              []
-                              {-# LINE 6203 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 156, column 32)
-                         _lhsOcollectedAugments =
-                             ({-# LINE 156 "Transform.ag" #-}
-                              []
-                              {-# LINE 6209 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 154, column 32)
-                         _lhsOcollectedInsts =
-                             ({-# LINE 154 "Transform.ag" #-}
-                              []
-                              {-# LINE 6215 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 158, column 32)
-                         _lhsOcollectedMerges =
-                             ({-# LINE 158 "Transform.ag" #-}
-                              []
-                              {-# LINE 6221 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 152, column 32)
-                         _lhsOcollectedRules =
-                             ({-# LINE 152 "Transform.ag" #-}
-                              []
-                              {-# LINE 6227 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 153, column 32)
-                         _lhsOcollectedSigs =
-                             ({-# LINE 153 "Transform.ag" #-}
-                              []
-                              {-# LINE 6233 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 155, column 32)
-                         _lhsOcollectedUniques =
-                             ({-# LINE 155 "Transform.ag" #-}
-                              []
-                              {-# LINE 6239 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              Seq.empty
-                              {-# LINE 6245 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 793, column 56)
-                         _lhsOsemPragmasCollect =
-                             ({-# LINE 793 "Transform.ag" #-}
-                              Map.empty
-                              {-# LINE 6251 "Transform.hs" #-}
-                              )
-                     in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
--- SemDef ------------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         options              : Options
-      synthesized attributes:
-         aroundInfos          : [AroundInfo]
-         augmentInfos         : [AugmentInfo]
-         definedInsts         : [Identifier]
-         errors               : Seq Error
-         mergeInfos           : [MergeInfo]
-         orderDepsCollect     : Set Dependency
-         pragmaNamesCollect   : [Identifier]
-         ruleInfos            : [RuleInfo]
-         sigInfos             : [SigInfo]
-         uniqueInfos          : [UniqueInfo]
-   alternatives:
-      alternative AroundDef:
-         child ident          : {Identifier}
-         child rhs            : {Expression}
-      alternative AttrOrderBefore:
-         child before         : {[Occurrence]}
-         child after          : {[Occurrence]}
-         visit 0:
-            local dependency  : _
-      alternative AugmentDef:
-         child ident          : {Identifier}
-         child rhs            : {Expression}
-      alternative Def:
-         child pos            : {Pos}
-         child mbName         : {Maybe Identifier}
-         child pattern        : Pattern 
-         child rhs            : {Expression}
-         child owrt           : {Bool}
-      alternative MergeDef:
-         child target         : {Identifier}
-         child nt             : {Identifier}
-         child sources        : {[Identifier]}
-         child rhs            : {Expression}
-      alternative SemPragma:
-         child names          : {[NontermIdent]}
-      alternative TypeDef:
-         child pos            : {Pos}
-         child ident          : {Identifier}
-         child tp             : {Type}
-      alternative UniqueDef:
-         child ident          : {Identifier}
-         child ref            : {Identifier}
--}
--- cata
-sem_SemDef :: SemDef  ->
-              T_SemDef 
-sem_SemDef (AroundDef _ident _rhs )  =
-    (sem_SemDef_AroundDef _ident _rhs )
-sem_SemDef (AttrOrderBefore _before _after )  =
-    (sem_SemDef_AttrOrderBefore _before _after )
-sem_SemDef (AugmentDef _ident _rhs )  =
-    (sem_SemDef_AugmentDef _ident _rhs )
-sem_SemDef (Def _pos _mbName _pattern _rhs _owrt )  =
-    (sem_SemDef_Def _pos _mbName (sem_Pattern _pattern ) _rhs _owrt )
-sem_SemDef (MergeDef _target _nt _sources _rhs )  =
-    (sem_SemDef_MergeDef _target _nt _sources _rhs )
-sem_SemDef (SemPragma _names )  =
-    (sem_SemDef_SemPragma _names )
-sem_SemDef (TypeDef _pos _ident _tp )  =
-    (sem_SemDef_TypeDef _pos _ident _tp )
-sem_SemDef (UniqueDef _ident _ref )  =
-    (sem_SemDef_UniqueDef _ident _ref )
--- semantic domain
-newtype T_SemDef  = T_SemDef (Options ->
-                              ( ([AroundInfo]),([AugmentInfo]),([Identifier]),(Seq Error),([MergeInfo]),(Set Dependency),([Identifier]),([RuleInfo]),([SigInfo]),([UniqueInfo])))
-data Inh_SemDef  = Inh_SemDef {options_Inh_SemDef :: !(Options)}
-data Syn_SemDef  = Syn_SemDef {aroundInfos_Syn_SemDef :: !(([AroundInfo])),augmentInfos_Syn_SemDef :: !(([AugmentInfo])),definedInsts_Syn_SemDef :: !(([Identifier])),errors_Syn_SemDef :: !((Seq Error)),mergeInfos_Syn_SemDef :: !(([MergeInfo])),orderDepsCollect_Syn_SemDef :: !((Set Dependency)),pragmaNamesCollect_Syn_SemDef :: !(([Identifier])),ruleInfos_Syn_SemDef :: !(([RuleInfo])),sigInfos_Syn_SemDef :: !(([SigInfo])),uniqueInfos_Syn_SemDef :: !(([UniqueInfo]))}
-wrap_SemDef :: T_SemDef  ->
-               Inh_SemDef  ->
-               Syn_SemDef 
-wrap_SemDef (T_SemDef sem ) (Inh_SemDef _lhsIoptions )  =
-    (let ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos) = sem _lhsIoptions 
-     in  (Syn_SemDef _lhsOaroundInfos _lhsOaugmentInfos _lhsOdefinedInsts _lhsOerrors _lhsOmergeInfos _lhsOorderDepsCollect _lhsOpragmaNamesCollect _lhsOruleInfos _lhsOsigInfos _lhsOuniqueInfos ))
-sem_SemDef_AroundDef :: Identifier ->
-                        Expression ->
-                        T_SemDef 
-sem_SemDef_AroundDef ident_ rhs_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 1078, column 17)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1078 "Transform.ag" #-}
-                             [ (ident_, rhs_) ]
-                             {-# LINE 6352 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6358 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6364 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 43, column 19)
-                        _lhsOerrors =
-                            ({-# LINE 43 "Transform.ag" #-}
-                             Seq.empty
-                             {-# LINE 6370 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6376 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6382 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6388 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6394 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6400 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6406 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_AttrOrderBefore :: ([Occurrence]) ->
-                              ([Occurrence]) ->
-                              T_SemDef 
-sem_SemDef_AttrOrderBefore before_ after_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 838, column 7)
-                        _dependency =
-                            ({-# LINE 838 "Transform.ag" #-}
-                             [ Dependency b a | b <- before_, a <- after_ ]
-                             {-# LINE 6428 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 839, column 7)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 839 "Transform.ag" #-}
-                             Set.fromList _dependency
-                             {-# LINE 6434 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6440 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6446 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6452 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 43, column 19)
-                        _lhsOerrors =
-                            ({-# LINE 43 "Transform.ag" #-}
-                             Seq.empty
-                             {-# LINE 6458 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6464 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6470 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6476 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6482 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6488 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_AugmentDef :: Identifier ->
-                         Expression ->
-                         T_SemDef 
-sem_SemDef_AugmentDef ident_ rhs_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 1075, column 17)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1075 "Transform.ag" #-}
-                             [ (ident_, rhs_) ]
-                             {-# LINE 6510 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6516 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6522 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 43, column 19)
-                        _lhsOerrors =
-                            ({-# LINE 43 "Transform.ag" #-}
-                             Seq.empty
-                             {-# LINE 6528 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6534 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6540 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6546 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6552 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6558 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6564 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_Def :: Pos ->
-                  (Maybe Identifier) ->
-                  T_Pattern  ->
-                  Expression ->
-                  Bool ->
-                  T_SemDef 
-sem_SemDef_Def pos_ mbName_ (T_Pattern pattern_ ) rhs_ owrt_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOerrors :: (Seq Error)
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        _patternIcopy :: Pattern 
-                        _patternIdefinedAttrs :: ([AttrName])
-                        _patternIdefinedInsts :: ([Identifier])
-                        _patternIpatunder :: ([AttrName]->Pattern)
-                        _patternIstpos :: Pos
-                        -- "Transform.ag"(line 528, column 3)
-                        _lhsOerrors =
-                            ({-# LINE 528 "Transform.ag" #-}
-                             if checkParseRhs _lhsIoptions
-                             then Seq.fromList $ checkRhs rhs_
-                             else Seq.empty
-                             {-# LINE 6596 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1066, column 10)
-                        _lhsOruleInfos =
-                            ({-# LINE 1066 "Transform.ag" #-}
-                             [ (mbName_, _patternIpatunder, rhs_, _patternIdefinedAttrs, owrt_, show _patternIstpos) ]
-                             {-# LINE 6602 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6608 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6614 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             _patternIdefinedInsts
-                             {-# LINE 6620 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6626 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6632 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6638 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6644 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6650 "Transform.hs" #-}
-                             )
-                        ( _patternIcopy,_patternIdefinedAttrs,_patternIdefinedInsts,_patternIpatunder,_patternIstpos) =
-                            pattern_ 
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_MergeDef :: Identifier ->
-                       Identifier ->
-                       ([Identifier]) ->
-                       Expression ->
-                       T_SemDef 
-sem_SemDef_MergeDef target_ nt_ sources_ rhs_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 528, column 3)
-                        _lhsOerrors =
-                            ({-# LINE 528 "Transform.ag" #-}
-                             if checkParseRhs _lhsIoptions
-                             then Seq.fromList $ checkRhs rhs_
-                             else Seq.empty
-                             {-# LINE 6678 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1081, column 17)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1081 "Transform.ag" #-}
-                             [ (target_, nt_, sources_, rhs_) ]
-                             {-# LINE 6684 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6690 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6696 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6702 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6708 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6714 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6720 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6726 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6732 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_SemPragma :: ([NontermIdent]) ->
-                        T_SemDef 
-sem_SemDef_SemPragma names_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 807, column 7)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 807 "Transform.ag" #-}
-                             names_
-                             {-# LINE 6753 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6759 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6765 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6771 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 43, column 19)
-                        _lhsOerrors =
-                            ({-# LINE 43 "Transform.ag" #-}
-                             Seq.empty
-                             {-# LINE 6777 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6783 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6789 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6795 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6801 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6807 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_TypeDef :: Pos ->
-                      Identifier ->
-                      Type ->
-                      T_SemDef 
-sem_SemDef_TypeDef pos_ ident_ tp_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOerrors :: (Seq Error)
-                        _lhsOsigInfos :: ([SigInfo])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOuniqueInfos :: ([UniqueInfo])
-                        -- "Transform.ag"(line 535, column 3)
-                        _lhsOerrors =
-                            ({-# LINE 535 "Transform.ag" #-}
-                             if checkParseTy _lhsIoptions
-                             then case tp_ of
-                                    Haskell s -> let exp = Expression pos_ tks
-                                                     tks = [tk]
-                                                     tk  = HsToken s pos_
-                                                 in Seq.fromList $ checkTy exp
-                                    _ -> Seq.empty
-                             else Seq.empty
-                             {-# LINE 6837 "Transform.hs" #-}
-                             )
-                        -- "Transform.ag"(line 1069, column 14)
-                        _lhsOsigInfos =
-                            ({-# LINE 1069 "Transform.ag" #-}
-                             [ (ident_, tp_) ]
-                             {-# LINE 6843 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6849 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6855 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6861 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6867 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6873 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6879 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6885 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1001, column 40)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1001 "Transform.ag" #-}
-                             []
-                             {-# LINE 6891 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDef_UniqueDef :: Identifier ->
-                        Identifier ->
-                        T_SemDef 
-sem_SemDef_UniqueDef ident_ ref_  =
-    (T_SemDef (\ _lhsIoptions ->
-                   (let _lhsOuniqueInfos :: ([UniqueInfo])
-                        _lhsOaroundInfos :: ([AroundInfo])
-                        _lhsOaugmentInfos :: ([AugmentInfo])
-                        _lhsOdefinedInsts :: ([Identifier])
-                        _lhsOerrors :: (Seq Error)
-                        _lhsOmergeInfos :: ([MergeInfo])
-                        _lhsOorderDepsCollect :: (Set Dependency)
-                        _lhsOpragmaNamesCollect :: ([Identifier])
-                        _lhsOruleInfos :: ([RuleInfo])
-                        _lhsOsigInfos :: ([SigInfo])
-                        -- "Transform.ag"(line 1072, column 16)
-                        _lhsOuniqueInfos =
-                            ({-# LINE 1072 "Transform.ag" #-}
-                             [ (ident_, ref_) ]
-                             {-# LINE 6913 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1003, column 40)
-                        _lhsOaroundInfos =
-                            ({-# LINE 1003 "Transform.ag" #-}
-                             []
-                             {-# LINE 6919 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1002, column 40)
-                        _lhsOaugmentInfos =
-                            ({-# LINE 1002 "Transform.ag" #-}
-                             []
-                             {-# LINE 6925 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1084, column 55)
-                        _lhsOdefinedInsts =
-                            ({-# LINE 1084 "Transform.ag" #-}
-                             []
-                             {-# LINE 6931 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 43, column 19)
-                        _lhsOerrors =
-                            ({-# LINE 43 "Transform.ag" #-}
-                             Seq.empty
-                             {-# LINE 6937 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1004, column 40)
-                        _lhsOmergeInfos =
-                            ({-# LINE 1004 "Transform.ag" #-}
-                             []
-                             {-# LINE 6943 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 834, column 44)
-                        _lhsOorderDepsCollect =
-                            ({-# LINE 834 "Transform.ag" #-}
-                             Set.empty
-                             {-# LINE 6949 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 803, column 46)
-                        _lhsOpragmaNamesCollect =
-                            ({-# LINE 803 "Transform.ag" #-}
-                             []
-                             {-# LINE 6955 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 999, column 40)
-                        _lhsOruleInfos =
-                            ({-# LINE 999 "Transform.ag" #-}
-                             []
-                             {-# LINE 6961 "Transform.hs" #-}
-                             )
-                        -- use rule "Transform.ag"(line 1000, column 40)
-                        _lhsOsigInfos =
-                            ({-# LINE 1000 "Transform.ag" #-}
-                             []
-                             {-# LINE 6967 "Transform.hs" #-}
-                             )
-                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
--- SemDefs -----------------------------------------------------
-{-
-   visit 0:
-      inherited attribute:
-         options              : Options
-      synthesized attributes:
-         aroundInfos          : [AroundInfo]
-         augmentInfos         : [AugmentInfo]
-         definedInsts         : [Identifier]
-         errors               : Seq Error
-         mergeInfos           : [MergeInfo]
-         orderDepsCollect     : Set Dependency
-         pragmaNamesCollect   : [Identifier]
-         ruleInfos            : [RuleInfo]
-         sigInfos             : [SigInfo]
-         uniqueInfos          : [UniqueInfo]
-   alternatives:
-      alternative Cons:
-         child hd             : SemDef 
-         child tl             : SemDefs 
-      alternative Nil:
--}
--- cata
-sem_SemDefs :: SemDefs  ->
-               T_SemDefs 
-sem_SemDefs list  =
-    (Prelude.foldr sem_SemDefs_Cons sem_SemDefs_Nil (Prelude.map sem_SemDef list) )
--- semantic domain
-newtype T_SemDefs  = T_SemDefs (Options ->
-                                ( ([AroundInfo]),([AugmentInfo]),([Identifier]),(Seq Error),([MergeInfo]),(Set Dependency),([Identifier]),([RuleInfo]),([SigInfo]),([UniqueInfo])))
-data Inh_SemDefs  = Inh_SemDefs {options_Inh_SemDefs :: !(Options)}
-data Syn_SemDefs  = Syn_SemDefs {aroundInfos_Syn_SemDefs :: !(([AroundInfo])),augmentInfos_Syn_SemDefs :: !(([AugmentInfo])),definedInsts_Syn_SemDefs :: !(([Identifier])),errors_Syn_SemDefs :: !((Seq Error)),mergeInfos_Syn_SemDefs :: !(([MergeInfo])),orderDepsCollect_Syn_SemDefs :: !((Set Dependency)),pragmaNamesCollect_Syn_SemDefs :: !(([Identifier])),ruleInfos_Syn_SemDefs :: !(([RuleInfo])),sigInfos_Syn_SemDefs :: !(([SigInfo])),uniqueInfos_Syn_SemDefs :: !(([UniqueInfo]))}
-wrap_SemDefs :: T_SemDefs  ->
-                Inh_SemDefs  ->
-                Syn_SemDefs 
-wrap_SemDefs (T_SemDefs sem ) (Inh_SemDefs _lhsIoptions )  =
-    (let ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos) = sem _lhsIoptions 
-     in  (Syn_SemDefs _lhsOaroundInfos _lhsOaugmentInfos _lhsOdefinedInsts _lhsOerrors _lhsOmergeInfos _lhsOorderDepsCollect _lhsOpragmaNamesCollect _lhsOruleInfos _lhsOsigInfos _lhsOuniqueInfos ))
-sem_SemDefs_Cons :: T_SemDef  ->
-                    T_SemDefs  ->
-                    T_SemDefs 
-sem_SemDefs_Cons (T_SemDef hd_ ) (T_SemDefs tl_ )  =
-    (T_SemDefs (\ _lhsIoptions ->
-                    (let _lhsOaroundInfos :: ([AroundInfo])
-                         _lhsOaugmentInfos :: ([AugmentInfo])
-                         _lhsOdefinedInsts :: ([Identifier])
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOmergeInfos :: ([MergeInfo])
-                         _lhsOorderDepsCollect :: (Set Dependency)
-                         _lhsOpragmaNamesCollect :: ([Identifier])
-                         _lhsOruleInfos :: ([RuleInfo])
-                         _lhsOsigInfos :: ([SigInfo])
-                         _lhsOuniqueInfos :: ([UniqueInfo])
-                         _hdOoptions :: Options
-                         _tlOoptions :: Options
-                         _hdIaroundInfos :: ([AroundInfo])
-                         _hdIaugmentInfos :: ([AugmentInfo])
-                         _hdIdefinedInsts :: ([Identifier])
-                         _hdIerrors :: (Seq Error)
-                         _hdImergeInfos :: ([MergeInfo])
-                         _hdIorderDepsCollect :: (Set Dependency)
-                         _hdIpragmaNamesCollect :: ([Identifier])
-                         _hdIruleInfos :: ([RuleInfo])
-                         _hdIsigInfos :: ([SigInfo])
-                         _hdIuniqueInfos :: ([UniqueInfo])
-                         _tlIaroundInfos :: ([AroundInfo])
-                         _tlIaugmentInfos :: ([AugmentInfo])
-                         _tlIdefinedInsts :: ([Identifier])
-                         _tlIerrors :: (Seq Error)
-                         _tlImergeInfos :: ([MergeInfo])
-                         _tlIorderDepsCollect :: (Set Dependency)
-                         _tlIpragmaNamesCollect :: ([Identifier])
-                         _tlIruleInfos :: ([RuleInfo])
-                         _tlIsigInfos :: ([SigInfo])
-                         _tlIuniqueInfos :: ([UniqueInfo])
-                         -- use rule "Transform.ag"(line 1003, column 40)
-                         _lhsOaroundInfos =
-                             ({-# LINE 1003 "Transform.ag" #-}
-                              _hdIaroundInfos ++ _tlIaroundInfos
-                              {-# LINE 7049 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1002, column 40)
-                         _lhsOaugmentInfos =
-                             ({-# LINE 1002 "Transform.ag" #-}
-                              _hdIaugmentInfos ++ _tlIaugmentInfos
-                              {-# LINE 7055 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1084, column 55)
-                         _lhsOdefinedInsts =
-                             ({-# LINE 1084 "Transform.ag" #-}
-                              _hdIdefinedInsts ++ _tlIdefinedInsts
-                              {-# LINE 7061 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              _hdIerrors Seq.>< _tlIerrors
-                              {-# LINE 7067 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1004, column 40)
-                         _lhsOmergeInfos =
-                             ({-# LINE 1004 "Transform.ag" #-}
-                              _hdImergeInfos ++ _tlImergeInfos
-                              {-# LINE 7073 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 834, column 44)
-                         _lhsOorderDepsCollect =
-                             ({-# LINE 834 "Transform.ag" #-}
-                              _hdIorderDepsCollect `Set.union` _tlIorderDepsCollect
-                              {-# LINE 7079 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 803, column 46)
-                         _lhsOpragmaNamesCollect =
-                             ({-# LINE 803 "Transform.ag" #-}
-                              _hdIpragmaNamesCollect ++ _tlIpragmaNamesCollect
-                              {-# LINE 7085 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 999, column 40)
-                         _lhsOruleInfos =
-                             ({-# LINE 999 "Transform.ag" #-}
-                              _hdIruleInfos ++ _tlIruleInfos
-                              {-# LINE 7091 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1000, column 40)
-                         _lhsOsigInfos =
-                             ({-# LINE 1000 "Transform.ag" #-}
-                              _hdIsigInfos ++ _tlIsigInfos
-                              {-# LINE 7097 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1001, column 40)
-                         _lhsOuniqueInfos =
-                             ({-# LINE 1001 "Transform.ag" #-}
-                              _hdIuniqueInfos ++ _tlIuniqueInfos
-                              {-# LINE 7103 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _hdOoptions =
-                             ({-# LINE 39 "Transform.ag" #-}
-                              _lhsIoptions
-                              {-# LINE 7109 "Transform.hs" #-}
-                              )
-                         -- copy rule (down)
-                         _tlOoptions =
-                             ({-# LINE 39 "Transform.ag" #-}
-                              _lhsIoptions
-                              {-# LINE 7115 "Transform.hs" #-}
-                              )
-                         ( _hdIaroundInfos,_hdIaugmentInfos,_hdIdefinedInsts,_hdIerrors,_hdImergeInfos,_hdIorderDepsCollect,_hdIpragmaNamesCollect,_hdIruleInfos,_hdIsigInfos,_hdIuniqueInfos) =
-                             hd_ _hdOoptions 
-                         ( _tlIaroundInfos,_tlIaugmentInfos,_tlIdefinedInsts,_tlIerrors,_tlImergeInfos,_tlIorderDepsCollect,_tlIpragmaNamesCollect,_tlIruleInfos,_tlIsigInfos,_tlIuniqueInfos) =
-                             tl_ _tlOoptions 
-                     in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
-sem_SemDefs_Nil :: T_SemDefs 
-sem_SemDefs_Nil  =
-    (T_SemDefs (\ _lhsIoptions ->
-                    (let _lhsOaroundInfos :: ([AroundInfo])
-                         _lhsOaugmentInfos :: ([AugmentInfo])
-                         _lhsOdefinedInsts :: ([Identifier])
-                         _lhsOerrors :: (Seq Error)
-                         _lhsOmergeInfos :: ([MergeInfo])
-                         _lhsOorderDepsCollect :: (Set Dependency)
-                         _lhsOpragmaNamesCollect :: ([Identifier])
-                         _lhsOruleInfos :: ([RuleInfo])
-                         _lhsOsigInfos :: ([SigInfo])
-                         _lhsOuniqueInfos :: ([UniqueInfo])
-                         -- use rule "Transform.ag"(line 1003, column 40)
-                         _lhsOaroundInfos =
-                             ({-# LINE 1003 "Transform.ag" #-}
-                              []
-                              {-# LINE 7139 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1002, column 40)
-                         _lhsOaugmentInfos =
-                             ({-# LINE 1002 "Transform.ag" #-}
-                              []
-                              {-# LINE 7145 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1084, column 55)
-                         _lhsOdefinedInsts =
-                             ({-# LINE 1084 "Transform.ag" #-}
-                              []
-                              {-# LINE 7151 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 43, column 19)
-                         _lhsOerrors =
-                             ({-# LINE 43 "Transform.ag" #-}
-                              Seq.empty
-                              {-# LINE 7157 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1004, column 40)
-                         _lhsOmergeInfos =
-                             ({-# LINE 1004 "Transform.ag" #-}
-                              []
-                              {-# LINE 7163 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 834, column 44)
-                         _lhsOorderDepsCollect =
-                             ({-# LINE 834 "Transform.ag" #-}
-                              Set.empty
-                              {-# LINE 7169 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 803, column 46)
-                         _lhsOpragmaNamesCollect =
-                             ({-# LINE 803 "Transform.ag" #-}
-                              []
-                              {-# LINE 7175 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 999, column 40)
-                         _lhsOruleInfos =
-                             ({-# LINE 999 "Transform.ag" #-}
-                              []
-                              {-# LINE 7181 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1000, column 40)
-                         _lhsOsigInfos =
-                             ({-# LINE 1000 "Transform.ag" #-}
-                              []
-                              {-# LINE 7187 "Transform.hs" #-}
-                              )
-                         -- use rule "Transform.ag"(line 1001, column 40)
-                         _lhsOuniqueInfos =
-                             ({-# LINE 1001 "Transform.ag" #-}
-                              []
-                              {-# LINE 7193 "Transform.hs" #-}
+-- UUAGC 0.9.38.6 (Transform.ag)
+module Transform where
+{-# LINE 8 "Transform.ag" #-}
+
+import Control.Monad(mplus,mzero)
+import List (partition, elem, nub,intersperse)
+import Data.Maybe
+import qualified Data.Map as Map
+import Data.Map (Map)
+import Data.Set as Set (Set, member, union, toList, fromList, empty, singleton, member, unions, size, fold, intersection, difference, insert)
+import qualified Data.Sequence as Seq
+import Data.Sequence(Seq, empty, (><),fromList)
+import Data.Foldable(toList)
+import UU.Scanner.Position(noPos)
+
+import ConcreteSyntax
+import AbstractSyntax
+import ErrorMessages
+import Patterns (Patterns(..),Pattern(..))
+import Expression (Expression(..))
+import HsToken
+
+import Options
+import CommonTypes
+import RhsCheck
+{-# LINE 29 "../src-derived/Transform.hs" #-}
+
+{-# LINE 2 "./ConcreteSyntax.ag" #-}
+
+import UU.Scanner.Position (Pos)
+import Patterns   (Pattern)
+import Expression (Expression)
+import CommonTypes
+{-# LINE 37 "../src-derived/Transform.hs" #-}
+
+{-# LINE 2 "./Patterns.ag" #-}
+
+-- Patterns.ag imports
+import UU.Scanner.Position(Pos)
+import CommonTypes (ConstructorIdent,Identifier)
+{-# LINE 44 "../src-derived/Transform.hs" #-}
+{-# LINE 102 "Transform.ag" #-}
+type DefinedSets = Map Identifier (Set NontermIdent) 
+{-# LINE 47 "../src-derived/Transform.hs" #-}
+
+{-# LINE 122 "Transform.ag" #-}
+type FieldMap  = [(Identifier, Type)] 
+{-# LINE 51 "../src-derived/Transform.hs" #-}
+
+{-# LINE 123 "Transform.ag" #-}
+type DataTypes = Map.Map NontermIdent (Map.Map ConstructorIdent FieldMap) 
+{-# LINE 55 "../src-derived/Transform.hs" #-}
+
+{-# LINE 143 "Transform.ag" #-}
+type AttrName   = (Identifier,Identifier) 
+{-# LINE 59 "../src-derived/Transform.hs" #-}
+
+{-# LINE 144 "Transform.ag" #-}
+type RuleInfo   = (Maybe Identifier, [AttrName]->Pattern, Expression, [AttrName], Bool, String) 
+{-# LINE 63 "../src-derived/Transform.hs" #-}
+
+{-# LINE 145 "Transform.ag" #-}
+type SigInfo    = (Identifier,Type) 
+{-# LINE 67 "../src-derived/Transform.hs" #-}
+
+{-# LINE 146 "Transform.ag" #-}
+type UniqueInfo = (Identifier,Identifier) 
+{-# LINE 71 "../src-derived/Transform.hs" #-}
+
+{-# LINE 147 "Transform.ag" #-}
+type AugmentInfo = (Identifier,Expression)
+{-# LINE 75 "../src-derived/Transform.hs" #-}
+
+{-# LINE 148 "Transform.ag" #-}
+type AroundInfo  = (Identifier,Expression)
+{-# LINE 79 "../src-derived/Transform.hs" #-}
+
+{-# LINE 149 "Transform.ag" #-}
+type MergeInfo   = (Identifier, Identifier, [Identifier], Expression)
+{-# LINE 83 "../src-derived/Transform.hs" #-}
+
+{-# LINE 203 "Transform.ag" #-}
+
+
+checkDuplicate :: (Identifier -> Identifier -> Error)
+               -> Identifier -> val -> Map Identifier val -> (Map Identifier val,Seq Error)
+checkDuplicate dupError key val m
+  = case Map.lookupIndex key m of
+     Just ix -> let (key',_) = Map.elemAt ix m
+                in  (m,Seq.singleton (dupError key key'))
+     Nothing -> (Map.insert key val m,Seq.empty)
+
+checkDuplicates :: (Identifier -> Identifier -> Error)
+                -> [(Identifier, val)] -> Map Identifier val -> (Map Identifier val,Seq Error)
+checkDuplicates dupError new m = foldErrors check m new
+ where  check = uncurry (checkDuplicate dupError)
+
+foldErrors f e xs = foldl g (e,Seq.empty) xs
+  where g ~(e,es) x = let (e',es') = f x e
+                      in (e', es >< es')
+
+
+checkForDuplicates :: (Identifier -> Identifier -> Error)  ->  [Identifier]  ->  [Error]
+checkForDuplicates err [] = []
+checkForDuplicates err (x:xs) = let (same,other) = List.partition (equalId x) xs
+                                in  map (err x) same ++ checkForDuplicates err other
+
+equalId :: Identifier -> Identifier -> Bool
+equalId x y = getName x == getName y
+
+{-# LINE 114 "../src-derived/Transform.hs" #-}
+
+{-# LINE 339 "Transform.ag" #-}
+
+type RulesAndErrors = ([Rule], Seq Error)
+type SigsAndErrors  = ([TypeSig], Seq Error)
+type InstsAndErrors = ([(Identifier, Type)], Seq Error)
+type UniquesAndErrors = (Map Identifier Identifier, Seq Error)
+type AugmentsAndErrors = (Map Identifier [Expression], Seq Error)
+type AroundsAndErrors = (Map Identifier [Expression], Seq Error)
+type MergesAndErrors  = (Map Identifier (Identifier, [Identifier], Expression), Seq Error)
+type AttrOverwrite  = Map AttrName Bool
+type AccumRuleCheck = (RulesAndErrors, AttrOverwrite)
+type AccumDefiCheck = (Seq Error, AttrOverwrite, [AttrName], [AttrName])
+
+checkRules :: Map NontermIdent (Attributes, Attributes) -> Map NontermIdent (Map ConstructorIdent FieldMap) ->
+              Map NontermIdent (Map ConstructorIdent [Identifier]) -> Map NontermIdent (Map ConstructorIdent [SigInfo]) ->
+              Map NontermIdent (Map ConstructorIdent [MergeInfo]) ->
+              NontermIdent -> ConstructorIdent -> [RuleInfo] -> RulesAndErrors
+checkRules attributes fields allinsts allsigs allmerges nt con rs
+  = let fieldmap :: FieldMap
+        fieldmap = (_LHS,NT nt undefined) : (_LOC,NT undefined undefined) : (_INST, NT undefined undefined) : (_FIRST, NT undefined undefined) : (_LAST, NT undefined undefined)
+                 : Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fields)
+                 ++ mapMaybe (\instNm -> lookup instNm sigs >>= \tp -> return (instNm, tp)) (Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allinsts))
+                 --   merged children are not allowed to have any inherited attrs defined: do not include
+
+        sigs = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allsigs)
+
+        hasAttrib f tp attr  = Map.member attr (f (Map.findWithDefault (Map.empty,Map.empty) tp attributes))
+
+        checkRule :: RuleInfo -> AccumRuleCheck -> AccumRuleCheck
+        checkRule (mbNm, pat,exp,as,owrt,str) ((r1,e1),m1)
+          = let (e2,m2,u2,b2) = foldr (checkDefi owrt) (e1,m1,[],[]) as
+            in  ( (Rule mbNm (pat u2) exp owrt str True : r1, e2), m2)
+
+        checkDefi :: Bool -> AttrName -> AccumDefiCheck -> AccumDefiCheck
+        checkDefi owrt fa@(field,attr) (e,m,u,bs)
+         = case lookup field fieldmap
+            of  Just (NT tp _) ->
+                  let tp' = maybe tp id (deforestedNt tp)
+                  in              if field == _LOC || field == _INST || field == _FIRST || field == _LAST
+                                     || hasAttrib (if getName field==getName _LHS then snd else fst) tp' attr
+                                  then case Map.lookupIndex fa m of
+                                           Just ix -> let ((_,attr2),b) = Map.elemAt ix m
+                                                       in  if b && not (fa `elem` bs)
+                                                           then (                                             e, Map.insert fa owrt m, fa:u, fa:bs)
+                                                           else (((Seq.<|)) (DupRule nt con field attr2 attr)   e,                    m, fa:u,    bs)
+                                           Nothing ->           (                                             e, Map.insert fa owrt m,    u, fa:bs)
+                                  else                          (((Seq.<|)) (SuperfluousRule nt con field attr) e,                    m, fa:u,    bs)
+                _              ->                               (((Seq.<|)) (UndefChild nt con field)           e,                    m, fa:u,    bs )
+
+    in  fst (foldr checkRule (([],Seq.empty),Map.empty) rs)
+
+checkRuleNames :: NontermIdent -> ConstructorIdent -> [RuleInfo] -> Seq Error
+checkRuleNames nt con
+  = fst . foldr checkRule (Seq.empty, Set.empty)
+  where
+    checkRule (Just nm,_,_,_,_,_) (errs, nms)
+      | nm `Set.member` nms = (DupRuleName nt con nm Seq.<| errs, nms)
+      | otherwise           = (errs, Set.insert nm nms)
+    checkRule (Nothing,_,_,_,_,_) inp = inp
+
+checkSigs :: NontermIdent -> ConstructorIdent -> [SigInfo] -> SigsAndErrors
+checkSigs nt con sis
+  = let checkSig (ide,typ) (sigs,errs)
+         = if   ide `elem` map (\(TypeSig n t)-> n) sigs
+           then (sigs, ((Seq.<|)) (DupSig nt con ide) errs)
+           -- else if not (ide `elem` locattrdefs)
+           -- then (sigs, ((Seq.<|)) (SupSig nt con ide) errs)
+           else (TypeSig ide typ:sigs, errs)
+    in  foldr checkSig ([],Seq.empty) sis
+
+checkInsts :: Set NontermIdent -> Map NontermIdent (Map ConstructorIdent [SigInfo]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [Identifier] -> InstsAndErrors
+checkInsts allNts sigMap fieldMap nt con
+  = foldr (\inst (insts, errs) ->
+              maybe (insts, Seq.singleton (MissingInstSig nt con inst) >< errs)
+                    (\info@(k, NT nm _) ->
+                      case findInst k insts of
+                        Just k' -> (insts, Seq.singleton (DupChild nt con k k') >< errs)
+                        Nothing -> case nm `Set.member` allNts of
+                                             True  -> (info : insts, errs)
+                                             False | take 2 (getName nm) == "T_" -> let nm' = Ident (drop 2 (getName nm)) (getPos nm)
+                                                                                    in case nm' `Set.member` allNts of
+                                                                                         True  -> (info : insts, errs)
+                                                                                         False -> (insts, Seq.singleton (UndefNont nm') >< errs)
+                                                   | otherwise                   -> (insts, Seq.singleton (UndefNont nm) >< errs)
+                    )
+                  $ findSig inst
+          ) ([], Seq.empty)
+  where
+    sigs = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt sigMap)
+
+    findSig name
+      = do tp@(NT _ _) <- lookup name sigs
+           return (name, tp)
+
+    findInst _ [] = Nothing
+    findInst k ((k', _): r)
+      | k == k'   = Just k'
+      | otherwise = findInst k r
+
+checkUniques :: Map NontermIdent (Attributes, Attributes) -> NontermIdent -> ConstructorIdent -> [UniqueInfo] -> UniquesAndErrors
+checkUniques allAttrs nt con uniques
+  = let checkUnique (ident,ref) (us,errs)
+          = if ident `Map.member` us
+            then (us, ((Seq.<|)) (DupUnique nt con ident) errs)
+            else if Map.member ref inhs && Map.member ref syns
+                 then (Map.insert ident ref us, errs)
+                 else (us, ((Seq.<|)) (MissingUnique nt ref) errs)
+
+        (inhs,syns) = Map.findWithDefault (Map.empty,Map.empty) nt allAttrs
+    in foldr checkUnique (Map.empty, Seq.empty) uniques
+
+checkAugments :: Map NontermIdent (Attributes, Attributes) -> NontermIdent -> ConstructorIdent -> [AugmentInfo] -> AugmentsAndErrors
+checkAugments allAttrs nt con augments
+  = let checkAugment (ident,expr) (as,errs)
+          = if ident `Map.member` as
+            then (Map.update (\vs -> Just (vs ++ [expr])) ident as, errs)
+            else if Map.member ident syns
+                 then (Map.insert ident [expr] as, errs)
+                 else (as, ((Seq.<|)) (MissingSyn nt ident) errs)
+
+        (inhs,syns) = Map.findWithDefault (Map.empty,Map.empty) nt allAttrs
+    in foldr checkAugment (Map.empty, Seq.empty) augments
+
+checkArounds :: Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [AroundInfo] -> AroundsAndErrors
+checkArounds fieldMap nt con arounds
+  = let checkAround (ident,expr) (as,errs)
+          = if ident `Map.member` as
+            then (Map.update (\vs -> Just (vs ++ [expr])) ident as, errs)
+            else case lookup ident fields of
+                   Just (NT _ _) -> (Map.insert ident [expr] as, errs)
+                   _             -> (as, ((Seq.<|)) (UndefChild nt con ident) errs)
+        fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fieldMap)
+    in foldr checkAround (Map.empty, Seq.empty) arounds
+
+checkMerges :: Set NontermIdent -> Map NontermIdent (Map ConstructorIdent [Identifier]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> NontermIdent -> ConstructorIdent -> [MergeInfo] -> MergesAndErrors
+checkMerges allNts allInsts fieldMap nt con merges
+  = let checkMerge (target,nt,sources,expr) (m,errs)
+          = let fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt fieldMap)
+                insts  = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allInsts)
+                allFields = insts ++ map fst fields   -- note: sources of merge may not contain a target (for simplicity)
+            in if target `Map.member` m   -- check for duplicate with self
+               then (m, DupChild nt con target (fst $ Map.elemAt (Map.findIndex target m) m) Seq.<| errs)
+               else if target `elem` allFields
+                     then (m, DupChild nt con target (head $ filter (== target) allFields) Seq.<| errs)
+                     else let missing = filter (\s -> not (s `elem` allFields)) sources
+                          in if null missing
+                             then if nt `Set.member` allNts   -- check if the nonterm is defined
+                                  then (Map.insert target (nt, sources, expr) m, errs) -- all ok..
+                                  else (m, UndefNont nt Seq.<| errs)
+                             else (m, (Seq.fromList $ map (UndefChild nt con) missing) Seq.>< errs)
+    in foldr checkMerge (Map.empty, Seq.empty) merges
+
+unionunionplusplus = Map.unionWith (Map.unionWith (++))
+{-# LINE 269 "../src-derived/Transform.hs" #-}
+
+{-# LINE 494 "Transform.ag" #-}
+
+mkUniqueRules :: Options -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)]) -> Map NontermIdent (Attributes,Attributes) -> NontermIdent -> ConstructorIdent -> Map Identifier Identifier -> [Rule]
+mkUniqueRules opts allFields allInsts allAttrDecls nt con usMap
+  = map apply groups
+  where
+    fields = Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allFields)
+             ++ Map.findWithDefault [] con (Map.findWithDefault Map.empty nt allInsts)
+             -- may have duplicates
+
+    groups = Map.assocs $ Map.foldrWithKey (\i r m -> Map.insertWith (++) r [i] m) Map.empty usMap
+    apply (ref,us) = mkRule ref (findOutField ref) us
+    findOutField ref = case [ chld | (chld,NT tp _) <- fields, tp `hasSyn` ref] of
+                         []    -> _LHS
+                         (x:_) -> x
+    hasSyn tp ref = Map.member ref $ snd $ Map.findWithDefault (Map.empty,Map.empty) tp allAttrDecls
+    mkRule ref outFld locAttrs
+      = let pat = Product noPos (attr outFld ref : [attr _LOC u | u <- locAttrs ])
+            rhs = Expression noPos $ wrap ref $ foldr gencase (finalout locAttrs) locAttrs
+                     -- [HsToken ("mkUniques" ++ show (length locAttrs) ++ " ") noPos, AGField _LHS ref noPos Nothing]
+        in Rule Nothing pat rhs False "-- generated by the unique rule mechanism." False
+    attr fld a = Alias fld a (Underscore noPos) []
+    gencase nm outp
+      = h ("case " ++ uniqueDispenser opts ++ " __cont of { (__cont, " ++ getName nm ++ ") -> ") ++ outp ++ h "}"
+    h s = [HsToken s noPos]
+    finalout us = h ("(__cont, " ++ concat (intersperse "," (map getName us)) ++ ")")
+    wrap ref inp = h "let __cont = " ++ [AGField _LHS ref noPos Nothing] ++ h " in seq __cont ( " ++ inp ++ h " )"
+{-# LINE 298 "../src-derived/Transform.hs" #-}
+
+{-# LINE 692 "Transform.ag" #-}
+
+flattenDatas :: DataTypes -> Map NontermIdent (Set NontermIdent)
+flattenDatas ds = Map.map flatten ds
+  where flatten cs =  Set.fromList [ nt | (_,NT nt _) <- concatMap snd (Map.toList cs)]
+
+reachableFrom :: Map NontermIdent (Set NontermIdent) -> Set NontermIdent -> Set NontermIdent
+reachableFrom table nts = reach nts
+  where reach nts = let nts' = Set.unions (nts : [ ns  | nt <- Set.toList nts
+                                                 , let ns = Map.findWithDefault Set.empty nt table ])
+                    in if Set.size nts' > Set.size nts
+                          then reach nts'
+                          else nts
+invert :: Map NontermIdent (Set NontermIdent) -> Map NontermIdent (Set NontermIdent)
+invert m = foldr inv Map.empty (Map.toList m)
+  where inv (x,ns) m = fold (\n m -> Map.insertWith Set.union n (Set.singleton x) m) m ns
+
+path :: Map NontermIdent (Set NontermIdent) -> NontermIdent -> NontermIdent -> Set NontermIdent
+path table from to = let children = Map.findWithDefault Set.empty from table
+                         forward  = reachableFrom table children
+                         backward = reachableFrom (invert table)
+                                                  (Set.singleton to)
+                     in  Set.intersection forward backward
+{-# LINE 323 "../src-derived/Transform.hs" #-}
+
+{-# LINE 812 "Transform.ag" #-}
+
+pragmaMapUnion :: PragmaMap -> PragmaMap -> PragmaMap
+pragmaMapUnion = Map.unionWith (Map.unionWith Set.union)
+
+pragmaMapSingle :: NontermIdent -> ConstructorIdent -> Set Identifier -> PragmaMap
+pragmaMapSingle nt con nms = Map.singleton nt (Map.singleton con nms)
+{-# LINE 332 "../src-derived/Transform.hs" #-}
+
+{-# LINE 844 "Transform.ag" #-}
+
+orderMapUnion :: AttrOrderMap -> AttrOrderMap -> AttrOrderMap
+orderMapUnion = Map.unionWith (Map.unionWith Set.union)
+
+orderMapSingle :: NontermIdent -> ConstructorIdent -> Set Dependency -> AttrOrderMap
+orderMapSingle nt con deps = Map.singleton nt (Map.singleton con deps)
+{-# LINE 341 "../src-derived/Transform.hs" #-}
+
+{-# LINE 870 "Transform.ag" #-}
+
+mergeParams :: ParamMap -> ParamMap -> ParamMap
+mergeParams = Map.unionWith (++)
+{-# LINE 347 "../src-derived/Transform.hs" #-}
+
+{-# LINE 893 "Transform.ag" #-}
+
+mergeCtx :: ContextMap -> ContextMap -> ContextMap
+mergeCtx
+  = Map.unionWith nubconcat
+  where nubconcat a b = nub (a ++ b)
+{-# LINE 355 "../src-derived/Transform.hs" #-}
+
+{-# LINE 912 "Transform.ag" #-}
+
+mergeQuant :: QuantMap -> QuantMap -> QuantMap
+mergeQuant = Map.unionWith (++)
+{-# LINE 361 "../src-derived/Transform.hs" #-}
+
+{-# LINE 923 "Transform.ag" #-}
+
+mergeDerivings m1 m2 = foldr (\(n,cs) m -> Map.insertWith Set.union n cs m) m2 (Map.toList m1)
+{-# LINE 366 "../src-derived/Transform.hs" #-}
+
+{-# LINE 934 "Transform.ag" #-}
+
+merge x y = foldr f y (Map.toList x)
+ where f ~(k,v) m = Map.insertWith (Map.union) k v m
+{-# LINE 372 "../src-derived/Transform.hs" #-}
+
+{-# LINE 975 "Transform.ag" #-}
+
+checkAttrs allFields nts inherited synthesized decls = foldErrors check decls nts where
+  check nt decls | not (nt `Map.member` allFields) = (decls,Seq.singleton(UndefNont nt))
+                 | otherwise = let (inh,syn) = Map.findWithDefault (Map.empty,Map.empty) nt decls
+                                   (inh',einh) = checkDuplicates (DupInhAttr nt) inherited   inh
+                                   (syn',esyn) = checkDuplicates (DupSynAttr nt) synthesized syn
+                               in (Map.insert nt (inh',syn') decls,einh >< esyn)
+{-# LINE 382 "../src-derived/Transform.hs" #-}
+
+{-# LINE 986 "Transform.ag" #-}
+
+addSelf name atMap = let (eInh,eSyn) = Map.findWithDefault(Map.empty,Map.empty) name atMap
+                     in  Map.insert name (eInh, Map.insert (Ident "self" noPos) (NT _SELF []) eSyn)atMap
+{-# LINE 388 "../src-derived/Transform.hs" #-}
+
+{-# LINE 1127 "Transform.ag" #-}
+
+makeType :: Set NontermIdent -> Type -> Type
+makeType nts tp@(NT x _) | x == _SELF       = tp
+                         | Set.member x nts = tp
+                         | otherwise        = Haskell (typeToHaskellString Nothing [] tp)
+makeType _   tp                             = tp
+{-# LINE 397 "../src-derived/Transform.hs" #-}
+
+{-# LINE 1134 "Transform.ag" #-}
+
+constructGrammar ::    Set NontermIdent
+                    -> ParamMap
+                    -> DataTypes
+                    -> Map NontermIdent (Attributes, Attributes)
+                    -> Map NontermIdent (Map Identifier (String, String, String))
+                    -> Derivings
+                    -> Set NontermIdent
+                    -> Map NontermIdent (Map ConstructorIdent [Rule])
+                    -> Map NontermIdent (Map ConstructorIdent [TypeSig])
+                    -> Map NontermIdent (Map ConstructorIdent [(Identifier, Type)])
+                    -> TypeSyns
+                    -> PragmaMap
+                    -> AttrOrderMap
+                    -> ContextMap
+                    -> QuantMap
+                    -> UniqueMap
+                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
+                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))
+                    -> Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))
+                    -> Grammar
+
+constructGrammar nts ntParams gram attrs uses derivings wrappers allrules tsigs allinsts tsyns pragmaMap orderMap contextMap quantMap uniqueMap augmentsMap aroundsMap mergeMap =
+   let gr = [ (nt,Map.toList alts) | (nt,alts) <- Map.toList gram]
+       nonts = map nont gr
+       nont (nt,alts) =  let (inh,syn) = Map.findWithDefault (Map.empty,Map.empty) nt attrs
+                             rmap      = Map.findWithDefault Map.empty             nt allrules
+                             tsmap     = Map.findWithDefault Map.empty             nt tsigs
+                             instsmap  = Map.findWithDefault Map.empty             nt allinsts
+                             params    = Map.findWithDefault []                    nt ntParams
+                             mergemap  = Map.findWithDefault Map.empty             nt mergeMap
+                             alt (con,flds) =
+                                   let rules = maybe [] id (Map.lookup con rmap)
+                                       tsigs = maybe [] id (Map.lookup con tsmap)
+                                       insts = maybe [] id (Map.lookup con instsmap)
+                                       merges = [ (n, NT t []) | (n, (t, _, _)) <- Map.assocs $ maybe Map.empty id (Map.lookup con mergemap) ]
+
+                                       -- important: keep order of children
+                                       cldrn = map child (flds ++ filter (not . existsAsField) insts ++ merges)
+                                       child (nm, tp) =
+                                          let tpI = if existsAsInst nm
+                                                    then fromJust $ lookup nm insts
+                                                    else tp
+                                              (inh,syn) = case tpI of
+                                                 NT nt _ -> let nt' = maybe nt id (deforestedNt nt)
+                                                            in Map.findWithDefault (Map.empty,Map.empty) nt' attrs
+                                                 _       -> (Map.empty,Map.empty)
+                                              virt = if existsAsInst nm
+                                                     then case lookup nm flds of
+                                                            Just tp' -> Just (Just tp')
+                                                            Nothing  -> Just Nothing
+                                                     else if existsAsMerge nm
+                                                          then (Just Nothing)
+                                                          else Nothing
+                                          in Child nm tpI inh syn virt
+                                       existsAsInst nm = maybe False (const True) (lookup nm insts)
+                                       existsAsField (nm,_) = maybe False (const True) (lookup nm flds)
+                                       existsAsMerge nm = maybe False (const True) (lookup nm merges)
+                                   in Production con cldrn rules tsigs
+                            in Nonterminal nt params inh syn (map alt alts)
+   in Grammar tsyns uses derivings wrappers nonts pragmaMap orderMap ntParams contextMap quantMap uniqueMap augmentsMap aroundsMap mergeMap
+{-# LINE 461 "../src-derived/Transform.hs" #-}
+
+{-# LINE 1197 "Transform.ag" #-}
+
+mapUnionWithSetUnion = Map.unionWith Set.union
+mapUnionWithPlusPlus = Map.unionWith (++)
+{-# LINE 467 "../src-derived/Transform.hs" #-}
+-- AG ----------------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         options              : Options
+      synthesized attributes:
+         blocks               : Blocks
+         errors               : Seq Error
+         moduleDecl           : Maybe (String,String,String)
+         output               : Grammar
+         pragmas              : Options -> Options
+   alternatives:
+      alternative AG:
+         child elems          : Elems 
+         visit 0:
+            local allFields   : _
+            local allConstrs  : _
+            local allRules    : _
+            local allSigs     : _
+            local allInsts    : _
+            local allUniques  : _
+            local allAugments : _
+            local allArounds  : _
+            local allMerges   : _
+            local augmentSigs : _
+            local allRulesErrs : _
+            local allNamesErrs : _
+            local allSigsErrs : _
+            local allInstsErrs : _
+            local allUniquesErrs : _
+            local allAugmentErrs : _
+            local allAroundsErrs : _
+            local allMergesErrs : _
+            local checkedRulesPre : _
+            local checkedSigs : _
+            local checkedInsts : _
+            local checkedUniques : _
+            local checkedAugments : _
+            local checkedArounds : _
+            local checkedRules : _
+            local checkedMerges : _
+            local errs1       : _
+            local errs2       : _
+            local errs3       : _
+            local errs4       : _
+            local errs5       : _
+            local errs6       : _
+            local errs7       : _
+            local errs8       : _
+            local errs9       : _
+            local errs10      : _
+            local errs11      : _
+            local allNonterminals : _
+            local allAttrDecls : _
+-}
+-- cata
+sem_AG :: AG  ->
+          T_AG 
+sem_AG (AG _elems )  =
+    (sem_AG_AG (sem_Elems _elems ) )
+-- semantic domain
+newtype T_AG  = T_AG (Options ->
+                      ( Blocks,(Seq Error),(Maybe (String,String,String)),Grammar,(Options -> Options)))
+data Inh_AG  = Inh_AG {options_Inh_AG :: !(Options)}
+data Syn_AG  = Syn_AG {blocks_Syn_AG :: !(Blocks),errors_Syn_AG :: !((Seq Error)),moduleDecl_Syn_AG :: !((Maybe (String,String,String))),output_Syn_AG :: !(Grammar),pragmas_Syn_AG :: !((Options -> Options))}
+wrap_AG :: T_AG  ->
+           Inh_AG  ->
+           Syn_AG 
+wrap_AG (T_AG sem ) (Inh_AG _lhsIoptions )  =
+    (let ( _lhsOblocks,_lhsOerrors,_lhsOmoduleDecl,_lhsOoutput,_lhsOpragmas) = sem _lhsIoptions 
+     in  (Syn_AG _lhsOblocks _lhsOerrors _lhsOmoduleDecl _lhsOoutput _lhsOpragmas ))
+sem_AG_AG :: T_Elems  ->
+             T_AG 
+sem_AG_AG (T_Elems elems_ )  =
+    (T_AG (\ _lhsIoptions ->
+               (let _lhsOoutput :: Grammar
+                    _lhsOerrors :: (Seq Error)
+                    _elemsOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                    _elemsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                    _elemsOdefinedSets :: DefinedSets
+                    _elemsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                    _lhsOblocks :: Blocks
+                    _lhsOmoduleDecl :: (Maybe (String,String,String))
+                    _lhsOpragmas :: (Options -> Options)
+                    _elemsOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                    _elemsOallFields :: DataTypes
+                    _elemsOallNonterminals :: (Set NontermIdent)
+                    _elemsOoptions :: Options
+                    _elemsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                    _elemsIattrOrderCollect :: AttrOrderMap
+                    _elemsIblocks :: Blocks
+                    _elemsIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                    _elemsIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                    _elemsIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                    _elemsIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                    _elemsIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                    _elemsIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                    _elemsIcollectedNames :: (Set Identifier)
+                    _elemsIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                    _elemsIcollectedSetNames :: (Set Identifier)
+                    _elemsIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                    _elemsIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                    _elemsIctxCollect :: ContextMap
+                    _elemsIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                    _elemsIderivings :: Derivings
+                    _elemsIerrors :: (Seq Error)
+                    _elemsImoduleDecl :: (Maybe (String,String,String))
+                    _elemsIparamsCollect :: ParamMap
+                    _elemsIpragmas :: (Options -> Options)
+                    _elemsIquantCollect :: QuantMap
+                    _elemsIsemPragmasCollect :: PragmaMap
+                    _elemsItypeSyns :: TypeSyns
+                    _elemsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                    _elemsIwrappers :: (Set NontermIdent)
+                    -- "Transform.ag"(line 52, column 8)
+                    _lhsOoutput =
+                        ({-# LINE 52 "Transform.ag" #-}
+                         constructGrammar _allNonterminals
+                                          _elemsIparamsCollect
+                                          _allFields
+                                          _allAttrDecls
+                                          _elemsIuseMap
+                                          _elemsIderivings
+                                          (if wrappers _lhsIoptions then _allNonterminals     else _elemsIwrappers)
+                                          _checkedRules
+                                          _checkedSigs
+                                          _checkedInsts
+                                          _elemsItypeSyns
+                                          _elemsIsemPragmasCollect
+                                          _elemsIattrOrderCollect
+                                          _elemsIctxCollect
+                                          _elemsIquantCollect
+                                          _checkedUniques
+                                          _checkedAugments
+                                          _checkedArounds
+                                          _checkedMerges
+                         {-# LINE 604 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 254, column 10)
+                    _allFields =
+                        ({-# LINE 254 "Transform.ag" #-}
+                         let f (nt,con,fm) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con fm)
+                         in  foldr f (Map.empty) _elemsIcollectedFields
+                         {-# LINE 611 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 257, column 10)
+                    _allConstrs =
+                        ({-# LINE 257 "Transform.ag" #-}
+                         let f (nt,con,_) = Map.insertWith (++) nt [con]
+                         in  foldr f (Map.empty) _elemsIcollectedFields
+                         {-# LINE 618 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 260, column 10)
+                    _allRules =
+                        ({-# LINE 260 "Transform.ag" #-}
+                         let f (nt,con,r) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con [r])
+                         in  foldr f (Map.empty) _elemsIcollectedRules
+                         {-# LINE 625 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 263, column 10)
+                    _allSigs =
+                        ({-# LINE 263 "Transform.ag" #-}
+                         let f (nt,con,t) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con [t])
+                             typeof nt r = Map.findWithDefault (Haskell "<unknown>") r $ fst $ Map.findWithDefault (Map.empty,Map.empty) nt _allAttrDecls
+                         in  foldr f (Map.empty) ( _elemsIcollectedSigs
+                                                 ++ [ (nt, con, (ident,typeof nt ref))  | (nt, con, us) <- _elemsIcollectedUniques, (ident,ref) <- us ]
+                                                 )
+                         {-# LINE 635 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 269, column 10)
+                    _allInsts =
+                        ({-# LINE 269 "Transform.ag" #-}
+                         let f (nt,con,is) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con is)
+                         in  foldr f (Map.empty) _elemsIcollectedInsts
+                         {-# LINE 642 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 272, column 10)
+                    _allUniques =
+                        ({-# LINE 272 "Transform.ag" #-}
+                         let f (nt,con,us) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con us)
+                         in foldr f (Map.empty) _elemsIcollectedUniques
+                         {-# LINE 649 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 274, column 10)
+                    _allAugments =
+                        ({-# LINE 274 "Transform.ag" #-}
+                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
+                         in foldr f Map.empty _elemsIcollectedAugments
+                         {-# LINE 656 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 276, column 10)
+                    _allArounds =
+                        ({-# LINE 276 "Transform.ag" #-}
+                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
+                         in foldr f Map.empty _elemsIcollectedArounds
+                         {-# LINE 663 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 278, column 10)
+                    _allMerges =
+                        ({-# LINE 278 "Transform.ag" #-}
+                         let f (nt,con,as) = Map.insertWith (Map.unionWith (++)) nt (Map.singleton con as)
+                          in foldr f Map.empty _elemsIcollectedMerges
+                         {-# LINE 670 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 281, column 10)
+                    _augmentSigs =
+                        ({-# LINE 281 "Transform.ag" #-}
+                         let gen mp = []
+                         in Map.map (Map.map gen) _allAugments
+                         {-# LINE 677 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 284, column 10)
+                    _allRulesErrs =
+                        ({-# LINE 284 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkRules _allAttrDecls _allFields _allInsts _allSigs     _allMerges    )) _allRules
+                         {-# LINE 683 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 285, column 10)
+                    _allNamesErrs =
+                        ({-# LINE 285 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . checkRuleNames) _allRules
+                         {-# LINE 689 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 286, column 10)
+                    _allSigsErrs =
+                        ({-# LINE 286 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkSigs                                                 )) _allSigs
+                         {-# LINE 695 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 287, column 10)
+                    _allInstsErrs =
+                        ({-# LINE 287 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkInsts _allNonterminals     _allSigs     _allFields   )) _allInsts
+                         {-# LINE 701 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 288, column 10)
+                    _allUniquesErrs =
+                        ({-# LINE 288 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkUniques _allAttrDecls                                )) _allUniques
+                         {-# LINE 707 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 289, column 10)
+                    _allAugmentErrs =
+                        ({-# LINE 289 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkAugments _allAttrDecls                               )) _allAugments
+                         {-# LINE 713 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 290, column 10)
+                    _allAroundsErrs =
+                        ({-# LINE 290 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkArounds _allFields    )) _allArounds
+                         {-# LINE 719 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 291, column 10)
+                    _allMergesErrs =
+                        ({-# LINE 291 "Transform.ag" #-}
+                         Map.mapWithKey (Map.mapWithKey . (checkMerges _allNonterminals     _allInsts     _allFields    )) _allMerges
+                         {-# LINE 725 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 293, column 10)
+                    _checkedRulesPre =
+                        ({-# LINE 293 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allRulesErrs
+                         {-# LINE 731 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 294, column 10)
+                    _checkedSigs =
+                        ({-# LINE 294 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allSigsErrs     `unionunionplusplus` _augmentSigs
+                         {-# LINE 737 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 295, column 10)
+                    _checkedInsts =
+                        ({-# LINE 295 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allInstsErrs
+                         {-# LINE 743 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 296, column 10)
+                    _checkedUniques =
+                        ({-# LINE 296 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allUniquesErrs
+                         {-# LINE 749 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 297, column 10)
+                    _checkedAugments =
+                        ({-# LINE 297 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allAugmentErrs
+                         {-# LINE 755 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 298, column 10)
+                    _checkedArounds =
+                        ({-# LINE 298 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allAroundsErrs
+                         {-# LINE 761 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 299, column 10)
+                    _checkedRules =
+                        ({-# LINE 299 "Transform.ag" #-}
+                         Map.unionWith (Map.unionWith (++)) _checkedRulesPre     (Map.mapWithKey (Map.mapWithKey . (mkUniqueRules _lhsIoptions _allFields     _checkedInsts     _allAttrDecls    )) _checkedUniques    )
+                         {-# LINE 767 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 300, column 10)
+                    _checkedMerges =
+                        ({-# LINE 300 "Transform.ag" #-}
+                         Map.map (Map.map fst) _allMergesErrs
+                         {-# LINE 773 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 302, column 10)
+                    _errs1 =
+                        ({-# LINE 302 "Transform.ag" #-}
+                         let f = checkForDuplicates (DupSynonym)
+                         in  Seq.fromList . f . map fst $ _elemsItypeSyns
+                         {-# LINE 780 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 305, column 10)
+                    _errs2 =
+                        ({-# LINE 305 "Transform.ag" #-}
+                         let g nt (con,fm) = checkForDuplicates (DupChild nt con) (map fst fm)
+                             f (nt,cfm)    = concat . map (g nt) . Map.toList $ cfm
+                         in  Seq.fromList . concat . map f . Map.toList $ _allFields
+                         {-# LINE 788 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 309, column 10)
+                    _errs3 =
+                        ({-# LINE 309 "Transform.ag" #-}
+                         let f (nt,cons) = checkForDuplicates (DupAlt nt) cons
+                         in   Seq.empty
+                         {-# LINE 795 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 313, column 10)
+                    _errs4 =
+                        ({-# LINE 313 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allRulesErrs
+                         {-# LINE 802 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 316, column 10)
+                    _errs5 =
+                        ({-# LINE 316 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allSigsErrs
+                         {-# LINE 809 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 319, column 10)
+                    _errs6 =
+                        ({-# LINE 319 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allInstsErrs
+                         {-# LINE 816 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 322, column 10)
+                    _errs7 =
+                        ({-# LINE 322 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allUniquesErrs
+                         {-# LINE 823 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 325, column 10)
+                    _errs8 =
+                        ({-# LINE 325 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allAugmentErrs
+                         {-# LINE 830 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 328, column 10)
+                    _errs9 =
+                        ({-# LINE 328 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allAroundsErrs
+                         {-# LINE 837 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 331, column 10)
+                    _errs10 =
+                        ({-# LINE 331 "Transform.ag" #-}
+                         let  f m s = Map.fold ((><)) s m
+                         in Map.fold f Seq.empty _allNamesErrs
+                         {-# LINE 844 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 334, column 10)
+                    _errs11 =
+                        ({-# LINE 334 "Transform.ag" #-}
+                         let f m s = Map.fold ((><) . snd) s m
+                         in Map.fold f Seq.empty _allMergesErrs
+                         {-# LINE 851 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 337, column 10)
+                    _lhsOerrors =
+                        ({-# LINE 337 "Transform.ag" #-}
+                         _elemsIerrors >< _errs1 >< _errs2 >< _errs3 >< _errs4 >< _errs5 >< _errs6 >< _errs7 >< _errs8 >< _errs9 >< _errs10 >< _errs11
+                         {-# LINE 857 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 561, column 10)
+                    _allNonterminals =
+                        ({-# LINE 561 "Transform.ag" #-}
+                         _elemsIcollectedNames `Set.difference` _elemsIcollectedSetNames
+                         {-# LINE 863 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 581, column 8)
+                    _elemsOallConstructors =
+                        ({-# LINE 581 "Transform.ag" #-}
+                         _elemsIcollectedConstructorsMap
+                         {-# LINE 869 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 654, column 8)
+                    _elemsOdefSets =
+                        ({-# LINE 654 "Transform.ag" #-}
+                         Map.fromList (map (\x->(x,(Set.singleton x, Set.empty))) (Set.toList _allNonterminals    ))
+                         {-# LINE 875 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 655, column 8)
+                    _elemsOdefinedSets =
+                        ({-# LINE 655 "Transform.ag" #-}
+                         Map.map fst _elemsIdefSets
+                         {-# LINE 881 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 940, column 8)
+                    _elemsOattrDecls =
+                        ({-# LINE 940 "Transform.ag" #-}
+                         Map.empty
+                         {-# LINE 887 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 993, column 9)
+                    _allAttrDecls =
+                        ({-# LINE 993 "Transform.ag" #-}
+                         if withSelf _lhsIoptions
+                          then foldr addSelf _elemsIattrDecls (Set.toList _allNonterminals    )
+                          else               _elemsIattrDecls
+                         {-# LINE 895 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 45, column 19)
+                    _lhsOblocks =
+                        ({-# LINE 45 "Transform.ag" #-}
+                         _elemsIblocks
+                         {-# LINE 901 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1117, column 37)
+                    _lhsOmoduleDecl =
+                        ({-# LINE 1117 "Transform.ag" #-}
+                         _elemsImoduleDecl
+                         {-# LINE 907 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 747, column 34)
+                    _lhsOpragmas =
+                        ({-# LINE 747 "Transform.ag" #-}
+                         _elemsIpragmas
+                         {-# LINE 913 "Transform.hs" #-}
+                         )
+                    -- copy rule (from local)
+                    _elemsOallAttrDecls =
+                        ({-# LINE 825 "Transform.ag" #-}
+                         _allAttrDecls
+                         {-# LINE 919 "Transform.hs" #-}
+                         )
+                    -- copy rule (from local)
+                    _elemsOallFields =
+                        ({-# LINE 129 "Transform.ag" #-}
+                         _allFields
+                         {-# LINE 925 "Transform.hs" #-}
+                         )
+                    -- copy rule (from local)
+                    _elemsOallNonterminals =
+                        ({-# LINE 89 "Transform.ag" #-}
+                         _allNonterminals
+                         {-# LINE 931 "Transform.hs" #-}
+                         )
+                    -- copy rule (down)
+                    _elemsOoptions =
+                        ({-# LINE 39 "Transform.ag" #-}
+                         _lhsIoptions
+                         {-# LINE 937 "Transform.hs" #-}
+                         )
+                    ( _elemsIattrDecls,_elemsIattrOrderCollect,_elemsIblocks,_elemsIcollectedArounds,_elemsIcollectedAugments,_elemsIcollectedConstructorsMap,_elemsIcollectedFields,_elemsIcollectedInsts,_elemsIcollectedMerges,_elemsIcollectedNames,_elemsIcollectedRules,_elemsIcollectedSetNames,_elemsIcollectedSigs,_elemsIcollectedUniques,_elemsIctxCollect,_elemsIdefSets,_elemsIderivings,_elemsIerrors,_elemsImoduleDecl,_elemsIparamsCollect,_elemsIpragmas,_elemsIquantCollect,_elemsIsemPragmasCollect,_elemsItypeSyns,_elemsIuseMap,_elemsIwrappers) =
+                        elems_ _elemsOallAttrDecls _elemsOallConstructors _elemsOallFields _elemsOallNonterminals _elemsOattrDecls _elemsOdefSets _elemsOdefinedSets _elemsOoptions 
+                in  ( _lhsOblocks,_lhsOerrors,_lhsOmoduleDecl,_lhsOoutput,_lhsOpragmas))) )
+-- Alt ---------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allConstructors      : Map NontermIdent (Set ConstructorIdent)
+         allNonterminals      : Set NontermIdent
+         nts                  : Set NontermIdent
+      synthesized attributes:
+         collectedConstructorNames : Set ConstructorIdent
+         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
+   alternatives:
+      alternative Alt:
+         child pos            : {Pos}
+         child names          : ConstructorSet 
+         child fields         : {Fields}
+-}
+-- cata
+sem_Alt :: Alt  ->
+           T_Alt 
+sem_Alt (Alt _pos _names _fields )  =
+    (sem_Alt_Alt _pos (sem_ConstructorSet _names ) _fields )
+-- semantic domain
+newtype T_Alt  = T_Alt ((Map NontermIdent (Set ConstructorIdent)) ->
+                        (Set NontermIdent) ->
+                        (Set NontermIdent) ->
+                        ( (Set ConstructorIdent),([(NontermIdent, ConstructorIdent, FieldMap)])))
+data Inh_Alt  = Inh_Alt {allConstructors_Inh_Alt :: !((Map NontermIdent (Set ConstructorIdent))),allNonterminals_Inh_Alt :: !((Set NontermIdent)),nts_Inh_Alt :: !((Set NontermIdent))}
+data Syn_Alt  = Syn_Alt {collectedConstructorNames_Syn_Alt :: !((Set ConstructorIdent)),collectedFields_Syn_Alt :: !(([(NontermIdent, ConstructorIdent, FieldMap)]))}
+wrap_Alt :: T_Alt  ->
+            Inh_Alt  ->
+            Syn_Alt 
+wrap_Alt (T_Alt sem ) (Inh_Alt _lhsIallConstructors _lhsIallNonterminals _lhsInts )  =
+    (let ( _lhsOcollectedConstructorNames,_lhsOcollectedFields) = sem _lhsIallConstructors _lhsIallNonterminals _lhsInts 
+     in  (Syn_Alt _lhsOcollectedConstructorNames _lhsOcollectedFields ))
+sem_Alt_Alt :: Pos ->
+               T_ConstructorSet  ->
+               Fields ->
+               T_Alt 
+sem_Alt_Alt pos_ (T_ConstructorSet names_ ) fields_  =
+    (T_Alt (\ _lhsIallConstructors
+              _lhsIallNonterminals
+              _lhsInts ->
+                (let _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                     _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                     _namesIcollectedConstructorNames :: (Set ConstructorIdent)
+                     _namesIconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                     _namesIerrors :: (Seq Error)
+                     -- "Transform.ag"(line 239, column 10)
+                     _lhsOcollectedFields =
+                         ({-# LINE 239 "Transform.ag" #-}
+                          let fieldTable =
+                               [ (attr, makeType _lhsIallNonterminals tp)
+                               | (attr, tp) <- fields_
+                               ]
+                          in   [ (nt, con, fieldTable)
+                               | nt  <- Set.toList _lhsInts
+                               , con <- Set.toList (_namesIconstructors (Map.findWithDefault Set.empty nt _lhsIallConstructors))
+                               ]
+                          {-# LINE 1000 "Transform.hs" #-}
+                          )
+                     -- use rule "Transform.ag"(line 94, column 62)
+                     _lhsOcollectedConstructorNames =
+                         ({-# LINE 94 "Transform.ag" #-}
+                          _namesIcollectedConstructorNames
+                          {-# LINE 1006 "Transform.hs" #-}
+                          )
+                     ( _namesIcollectedConstructorNames,_namesIconstructors,_namesIerrors) =
+                         names_ 
+                 in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
+-- Alts --------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allConstructors      : Map NontermIdent (Set ConstructorIdent)
+         allNonterminals      : Set NontermIdent
+         nts                  : Set NontermIdent
+      synthesized attributes:
+         collectedConstructorNames : Set ConstructorIdent
+         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
+   alternatives:
+      alternative Cons:
+         child hd             : Alt 
+         child tl             : Alts 
+      alternative Nil:
+-}
+-- cata
+sem_Alts :: Alts  ->
+            T_Alts 
+sem_Alts list  =
+    (Prelude.foldr sem_Alts_Cons sem_Alts_Nil (Prelude.map sem_Alt list) )
+-- semantic domain
+newtype T_Alts  = T_Alts ((Map NontermIdent (Set ConstructorIdent)) ->
+                          (Set NontermIdent) ->
+                          (Set NontermIdent) ->
+                          ( (Set ConstructorIdent),([(NontermIdent, ConstructorIdent, FieldMap)])))
+data Inh_Alts  = Inh_Alts {allConstructors_Inh_Alts :: !((Map NontermIdent (Set ConstructorIdent))),allNonterminals_Inh_Alts :: !((Set NontermIdent)),nts_Inh_Alts :: !((Set NontermIdent))}
+data Syn_Alts  = Syn_Alts {collectedConstructorNames_Syn_Alts :: !((Set ConstructorIdent)),collectedFields_Syn_Alts :: !(([(NontermIdent, ConstructorIdent, FieldMap)]))}
+wrap_Alts :: T_Alts  ->
+             Inh_Alts  ->
+             Syn_Alts 
+wrap_Alts (T_Alts sem ) (Inh_Alts _lhsIallConstructors _lhsIallNonterminals _lhsInts )  =
+    (let ( _lhsOcollectedConstructorNames,_lhsOcollectedFields) = sem _lhsIallConstructors _lhsIallNonterminals _lhsInts 
+     in  (Syn_Alts _lhsOcollectedConstructorNames _lhsOcollectedFields ))
+sem_Alts_Cons :: T_Alt  ->
+                 T_Alts  ->
+                 T_Alts 
+sem_Alts_Cons (T_Alt hd_ ) (T_Alts tl_ )  =
+    (T_Alts (\ _lhsIallConstructors
+               _lhsIallNonterminals
+               _lhsInts ->
+                 (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _hdOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                      _hdOallNonterminals :: (Set NontermIdent)
+                      _hdOnts :: (Set NontermIdent)
+                      _tlOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                      _tlOallNonterminals :: (Set NontermIdent)
+                      _tlOnts :: (Set NontermIdent)
+                      _hdIcollectedConstructorNames :: (Set ConstructorIdent)
+                      _hdIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _tlIcollectedConstructorNames :: (Set ConstructorIdent)
+                      _tlIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      -- use rule "Transform.ag"(line 94, column 62)
+                      _lhsOcollectedConstructorNames =
+                          ({-# LINE 94 "Transform.ag" #-}
+                           _hdIcollectedConstructorNames `Set.union` _tlIcollectedConstructorNames
+                           {-# LINE 1068 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           _hdIcollectedFields ++ _tlIcollectedFields
+                           {-# LINE 1074 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _hdOallConstructors =
+                          ({-# LINE 97 "Transform.ag" #-}
+                           _lhsIallConstructors
+                           {-# LINE 1080 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _hdOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 1086 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _hdOnts =
+                          ({-# LINE 168 "Transform.ag" #-}
+                           _lhsInts
+                           {-# LINE 1092 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _tlOallConstructors =
+                          ({-# LINE 97 "Transform.ag" #-}
+                           _lhsIallConstructors
+                           {-# LINE 1098 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _tlOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 1104 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _tlOnts =
+                          ({-# LINE 168 "Transform.ag" #-}
+                           _lhsInts
+                           {-# LINE 1110 "Transform.hs" #-}
+                           )
+                      ( _hdIcollectedConstructorNames,_hdIcollectedFields) =
+                          hd_ _hdOallConstructors _hdOallNonterminals _hdOnts 
+                      ( _tlIcollectedConstructorNames,_tlIcollectedFields) =
+                          tl_ _tlOallConstructors _tlOallNonterminals _tlOnts 
+                  in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
+sem_Alts_Nil :: T_Alts 
+sem_Alts_Nil  =
+    (T_Alts (\ _lhsIallConstructors
+               _lhsIallNonterminals
+               _lhsInts ->
+                 (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      -- use rule "Transform.ag"(line 94, column 62)
+                      _lhsOcollectedConstructorNames =
+                          ({-# LINE 94 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 1128 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 1134 "Transform.hs" #-}
+                           )
+                  in  ( _lhsOcollectedConstructorNames,_lhsOcollectedFields))) )
+-- Attrs -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allFields            : DataTypes
+         allNonterminals      : Set NontermIdent
+         nts                  : Set NontermIdent
+         options              : Options
+      chained attribute:
+         attrDecls            : Map NontermIdent (Attributes, Attributes)
+      synthesized attributes:
+         errors               : Seq Error
+         useMap               : Map NontermIdent (Map Identifier (String,String,String))
+   alternatives:
+      alternative Attrs:
+         child pos            : {Pos}
+         child inh            : {AttrNames}
+         child chn            : {AttrNames}
+         child syn            : {AttrNames}
+         visit 0:
+            local _tup1       : _
+            local attrDecls   : _
+            local errors      : _
+            local _tup2       : _
+            local inherited   : _
+            local synthesized : _
+            local useMap      : _
+            local errors1     : _
+-}
+-- cata
+sem_Attrs :: Attrs  ->
+             T_Attrs 
+sem_Attrs (Attrs _pos _inh _chn _syn )  =
+    (sem_Attrs_Attrs _pos _inh _chn _syn )
+-- semantic domain
+newtype T_Attrs  = T_Attrs (DataTypes ->
+                            (Set NontermIdent) ->
+                            (Map NontermIdent (Attributes, Attributes)) ->
+                            (Set NontermIdent) ->
+                            Options ->
+                            ( (Map NontermIdent (Attributes, Attributes)),(Seq Error),(Map NontermIdent (Map Identifier (String,String,String)))))
+data Inh_Attrs  = Inh_Attrs {allFields_Inh_Attrs :: !(DataTypes),allNonterminals_Inh_Attrs :: !((Set NontermIdent)),attrDecls_Inh_Attrs :: !((Map NontermIdent (Attributes, Attributes))),nts_Inh_Attrs :: !((Set NontermIdent)),options_Inh_Attrs :: !(Options)}
+data Syn_Attrs  = Syn_Attrs {attrDecls_Syn_Attrs :: !((Map NontermIdent (Attributes, Attributes))),errors_Syn_Attrs :: !((Seq Error)),useMap_Syn_Attrs :: !((Map NontermIdent (Map Identifier (String,String,String))))}
+wrap_Attrs :: T_Attrs  ->
+              Inh_Attrs  ->
+              Syn_Attrs 
+wrap_Attrs (T_Attrs sem ) (Inh_Attrs _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsInts _lhsIoptions )  =
+    (let ( _lhsOattrDecls,_lhsOerrors,_lhsOuseMap) = sem _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsInts _lhsIoptions 
+     in  (Syn_Attrs _lhsOattrDecls _lhsOerrors _lhsOuseMap ))
+sem_Attrs_Attrs :: Pos ->
+                   AttrNames ->
+                   AttrNames ->
+                   AttrNames ->
+                   T_Attrs 
+sem_Attrs_Attrs pos_ inh_ chn_ syn_  =
+    (T_Attrs (\ _lhsIallFields
+                _lhsIallNonterminals
+                _lhsIattrDecls
+                _lhsInts
+                _lhsIoptions ->
+                  (let _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       -- "Transform.ag"(line 948, column 15)
+                       __tup1 =
+                           ({-# LINE 948 "Transform.ag" #-}
+                            checkAttrs _lhsIallFields (Set.toList _lhsInts) _inherited _synthesized _lhsIattrDecls
+                            {-# LINE 1204 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 948, column 15)
+                       (_attrDecls,_) =
+                           ({-# LINE 948 "Transform.ag" #-}
+                            __tup1
+                            {-# LINE 1210 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 948, column 15)
+                       (_,_errors) =
+                           ({-# LINE 948 "Transform.ag" #-}
+                            __tup1
+                            {-# LINE 1216 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 950, column 15)
+                       __tup2 =
+                           ({-# LINE 950 "Transform.ag" #-}
+                            let splitAttrs xs = unzip [ ((n,makeType _lhsIallNonterminals t),(n,ud))
+                                                      | (n,t,ud) <- xs
+                                                      ]
+                                (inh,_)     = splitAttrs inh_
+                                (chn,uses1) = splitAttrs chn_
+                                (syn,uses2) = splitAttrs syn_
+                                isUse (n,(e1,e2,_)) = not (null e1 || null e2)
+                            in (inh++chn,chn++syn, Map.fromList (Prelude.filter isUse (uses1++uses2)))
+                            {-# LINE 1229 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 950, column 15)
+                       (_inherited,_,_) =
+                           ({-# LINE 950 "Transform.ag" #-}
+                            __tup2
+                            {-# LINE 1235 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 950, column 15)
+                       (_,_synthesized,_) =
+                           ({-# LINE 950 "Transform.ag" #-}
+                            __tup2
+                            {-# LINE 1241 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 950, column 15)
+                       (_,_,_useMap) =
+                           ({-# LINE 950 "Transform.ag" #-}
+                            __tup2
+                            {-# LINE 1247 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 958, column 11)
+                       _lhsOuseMap =
+                           ({-# LINE 958 "Transform.ag" #-}
+                            Map.fromList (zip (Set.toList _lhsInts) (repeat _useMap))
+                            {-# LINE 1253 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 960, column 11)
+                       _errors1 =
+                           ({-# LINE 960 "Transform.ag" #-}
+                            if checkParseTy _lhsIoptions
+                            then let attrs  = inh_ ++ syn_ ++ chn_
+                                     items = map (\(ident,tp,_) -> (getPos ident, tp)) attrs
+                                     errs  = map check items
+                                     check (pos,Haskell s) =
+                                       let exp = Expression pos tks
+                                           tks = [tk]
+                                           tk  = HsToken s pos
+                                       in Seq.fromList $ checkTy exp
+                                     check _ = Seq.empty
+                                 in foldr (Seq.><) Seq.empty errs
+                            else Seq.empty
+                            {-# LINE 1270 "Transform.hs" #-}
+                            )
+                       -- "Transform.ag"(line 972, column 11)
+                       _lhsOerrors =
+                           ({-# LINE 972 "Transform.ag" #-}
+                            _errors     Seq.>< _errors1
+                            {-# LINE 1276 "Transform.hs" #-}
+                            )
+                       -- copy rule (from local)
+                       _lhsOattrDecls =
+                           ({-# LINE 137 "Transform.ag" #-}
+                            _attrDecls
+                            {-# LINE 1282 "Transform.hs" #-}
+                            )
+                   in  ( _lhsOattrDecls,_lhsOerrors,_lhsOuseMap))) )
+-- ConstructorSet ----------------------------------------------
+{-
+   visit 0:
+      synthesized attributes:
+         collectedConstructorNames : Set ConstructorIdent
+         constructors         : (Set ConstructorIdent->Set ConstructorIdent)
+         errors               : Seq Error
+   alternatives:
+      alternative CAll:
+      alternative CDifference:
+         child set1           : ConstructorSet 
+         child set2           : ConstructorSet 
+      alternative CName:
+         child name           : {ConstructorIdent}
+      alternative CUnion:
+         child set1           : ConstructorSet 
+         child set2           : ConstructorSet 
+-}
+-- cata
+sem_ConstructorSet :: ConstructorSet  ->
+                      T_ConstructorSet 
+sem_ConstructorSet (CAll )  =
+    (sem_ConstructorSet_CAll )
+sem_ConstructorSet (CDifference _set1 _set2 )  =
+    (sem_ConstructorSet_CDifference (sem_ConstructorSet _set1 ) (sem_ConstructorSet _set2 ) )
+sem_ConstructorSet (CName _name )  =
+    (sem_ConstructorSet_CName _name )
+sem_ConstructorSet (CUnion _set1 _set2 )  =
+    (sem_ConstructorSet_CUnion (sem_ConstructorSet _set1 ) (sem_ConstructorSet _set2 ) )
+-- semantic domain
+newtype T_ConstructorSet  = T_ConstructorSet (( (Set ConstructorIdent),((Set ConstructorIdent->Set ConstructorIdent)),(Seq Error)))
+data Inh_ConstructorSet  = Inh_ConstructorSet {}
+data Syn_ConstructorSet  = Syn_ConstructorSet {collectedConstructorNames_Syn_ConstructorSet :: !((Set ConstructorIdent)),constructors_Syn_ConstructorSet :: !(((Set ConstructorIdent->Set ConstructorIdent))),errors_Syn_ConstructorSet :: !((Seq Error))}
+wrap_ConstructorSet :: T_ConstructorSet  ->
+                       Inh_ConstructorSet  ->
+                       Syn_ConstructorSet 
+wrap_ConstructorSet (T_ConstructorSet sem ) (Inh_ConstructorSet )  =
+    (let ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors) = sem 
+     in  (Syn_ConstructorSet _lhsOcollectedConstructorNames _lhsOconstructors _lhsOerrors ))
+sem_ConstructorSet_CAll :: T_ConstructorSet 
+sem_ConstructorSet_CAll  =
+    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                           _lhsOerrors :: (Seq Error)
+                           -- "Transform.ag"(line 725, column 17)
+                           _lhsOconstructors =
+                               ({-# LINE 725 "Transform.ag" #-}
+                                \ds -> ds
+                                {-# LINE 1333 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 94, column 62)
+                           _lhsOcollectedConstructorNames =
+                               ({-# LINE 94 "Transform.ag" #-}
+                                Set.empty
+                                {-# LINE 1339 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 43, column 19)
+                           _lhsOerrors =
+                               ({-# LINE 43 "Transform.ag" #-}
+                                Seq.empty
+                                {-# LINE 1345 "Transform.hs" #-}
+                                )
+                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
+sem_ConstructorSet_CDifference :: T_ConstructorSet  ->
+                                  T_ConstructorSet  ->
+                                  T_ConstructorSet 
+sem_ConstructorSet_CDifference (T_ConstructorSet set1_ ) (T_ConstructorSet set2_ )  =
+    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                           _lhsOerrors :: (Seq Error)
+                           _set1IcollectedConstructorNames :: (Set ConstructorIdent)
+                           _set1Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _set1Ierrors :: (Seq Error)
+                           _set2IcollectedConstructorNames :: (Set ConstructorIdent)
+                           _set2Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _set2Ierrors :: (Seq Error)
+                           -- "Transform.ag"(line 724, column 17)
+                           _lhsOconstructors =
+                               ({-# LINE 724 "Transform.ag" #-}
+                                \ds -> _set1Iconstructors ds `Set.difference` _set2Iconstructors ds
+                                {-# LINE 1365 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 94, column 62)
+                           _lhsOcollectedConstructorNames =
+                               ({-# LINE 94 "Transform.ag" #-}
+                                _set1IcollectedConstructorNames `Set.union` _set2IcollectedConstructorNames
+                                {-# LINE 1371 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 43, column 19)
+                           _lhsOerrors =
+                               ({-# LINE 43 "Transform.ag" #-}
+                                _set1Ierrors Seq.>< _set2Ierrors
+                                {-# LINE 1377 "Transform.hs" #-}
+                                )
+                           ( _set1IcollectedConstructorNames,_set1Iconstructors,_set1Ierrors) =
+                               set1_ 
+                           ( _set2IcollectedConstructorNames,_set2Iconstructors,_set2Ierrors) =
+                               set2_ 
+                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
+sem_ConstructorSet_CName :: ConstructorIdent ->
+                            T_ConstructorSet 
+sem_ConstructorSet_CName name_  =
+    (T_ConstructorSet (let _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                           _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _lhsOerrors :: (Seq Error)
+                           -- "Transform.ag"(line 569, column 11)
+                           _lhsOcollectedConstructorNames =
+                               ({-# LINE 569 "Transform.ag" #-}
+                                Set.singleton name_
+                                {-# LINE 1394 "Transform.hs" #-}
+                                )
+                           -- "Transform.ag"(line 722, column 17)
+                           _lhsOconstructors =
+                               ({-# LINE 722 "Transform.ag" #-}
+                                \ds -> Set.singleton name_
+                                {-# LINE 1400 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 43, column 19)
+                           _lhsOerrors =
+                               ({-# LINE 43 "Transform.ag" #-}
+                                Seq.empty
+                                {-# LINE 1406 "Transform.hs" #-}
+                                )
+                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
+sem_ConstructorSet_CUnion :: T_ConstructorSet  ->
+                             T_ConstructorSet  ->
+                             T_ConstructorSet 
+sem_ConstructorSet_CUnion (T_ConstructorSet set1_ ) (T_ConstructorSet set2_ )  =
+    (T_ConstructorSet (let _lhsOconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _lhsOcollectedConstructorNames :: (Set ConstructorIdent)
+                           _lhsOerrors :: (Seq Error)
+                           _set1IcollectedConstructorNames :: (Set ConstructorIdent)
+                           _set1Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _set1Ierrors :: (Seq Error)
+                           _set2IcollectedConstructorNames :: (Set ConstructorIdent)
+                           _set2Iconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                           _set2Ierrors :: (Seq Error)
+                           -- "Transform.ag"(line 723, column 17)
+                           _lhsOconstructors =
+                               ({-# LINE 723 "Transform.ag" #-}
+                                \ds -> _set1Iconstructors ds `Set.union`      _set2Iconstructors ds
+                                {-# LINE 1426 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 94, column 62)
+                           _lhsOcollectedConstructorNames =
+                               ({-# LINE 94 "Transform.ag" #-}
+                                _set1IcollectedConstructorNames `Set.union` _set2IcollectedConstructorNames
+                                {-# LINE 1432 "Transform.hs" #-}
+                                )
+                           -- use rule "Transform.ag"(line 43, column 19)
+                           _lhsOerrors =
+                               ({-# LINE 43 "Transform.ag" #-}
+                                _set1Ierrors Seq.>< _set2Ierrors
+                                {-# LINE 1438 "Transform.hs" #-}
+                                )
+                           ( _set1IcollectedConstructorNames,_set1Iconstructors,_set1Ierrors) =
+                               set1_ 
+                           ( _set2IcollectedConstructorNames,_set2Iconstructors,_set2Ierrors) =
+                               set2_ 
+                       in  ( _lhsOcollectedConstructorNames,_lhsOconstructors,_lhsOerrors)) )
+-- Elem --------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
+         allConstructors      : Map NontermIdent (Set ConstructorIdent)
+         allFields            : DataTypes
+         allNonterminals      : Set NontermIdent
+         definedSets          : DefinedSets
+         options              : Options
+      chained attributes:
+         attrDecls            : Map NontermIdent (Attributes, Attributes)
+         defSets              : Map Identifier (Set NontermIdent,Set Identifier)
+      synthesized attributes:
+         attrOrderCollect     : AttrOrderMap
+         blocks               : Blocks
+         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
+         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
+         collectedConstructorsMap : Map NontermIdent (Set ConstructorIdent)
+         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
+         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
+         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
+         collectedNames       : Set Identifier
+         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
+         collectedSetNames    : Set Identifier
+         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
+         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
+         ctxCollect           : ContextMap
+         derivings            : Derivings
+         errors               : Seq Error
+         moduleDecl           : Maybe (String,String,String)
+         paramsCollect        : ParamMap
+         pragmas              : Options -> Options
+         quantCollect         : QuantMap
+         semPragmasCollect    : PragmaMap
+         typeSyns             : TypeSyns
+         useMap               : Map NontermIdent (Map Identifier (String,String,String))
+         wrappers             : Set NontermIdent
+   alternatives:
+      alternative Attr:
+         child pos            : {Pos}
+         child ctx            : {ClassContext}
+         child names          : NontSet 
+         child quants         : {[String]}
+         child attrs          : Attrs 
+      alternative Data:
+         child pos            : {Pos}
+         child ctx            : {ClassContext}
+         child names          : NontSet 
+         child params         : {[Identifier]}
+         child attrs          : Attrs 
+         child alts           : Alts 
+         child ext            : {Bool}
+      alternative Deriving:
+         child pos            : {Pos}
+         child set            : NontSet 
+         child classes        : {[NontermIdent]}
+      alternative Module:
+         child pos            : {Pos}
+         child name           : {String}
+         child exports        : {String}
+         child imports        : {String}
+      alternative Nocatas:
+         child pos            : {Pos}
+         child set            : NontSet 
+      alternative Pragma:
+         child pos            : {Pos}
+         child names          : {[NontermIdent]}
+      alternative Sem:
+         child pos            : {Pos}
+         child ctx            : {ClassContext}
+         child names          : NontSet 
+         child attrs          : Attrs 
+         child quants         : {[String]}
+         child alts           : SemAlts 
+      alternative Set:
+         child pos            : {Pos}
+         child name           : {NontermIdent}
+         child merge          : {Bool}
+         child set            : NontSet 
+         visit 0:
+            local _tup3       : _
+            local defSets2    : _
+            local errs        : _
+      alternative Txt:
+         child pos            : {Pos}
+         child name           : {Identifier}
+         child mbNt           : {Maybe NontermIdent}
+         child lines          : {[String]}
+         visit 0:
+            local blockInfo   : _
+            local blockValue  : _
+      alternative Type:
+         child pos            : {Pos}
+         child ctx            : {ClassContext}
+         child name           : {NontermIdent}
+         child params         : {[Identifier]}
+         child type           : {ComplexType}
+         visit 0:
+            local expanded    : _
+            local argType     : _
+      alternative Wrapper:
+         child pos            : {Pos}
+         child set            : NontSet 
+-}
+-- cata
+sem_Elem :: Elem  ->
+            T_Elem 
+sem_Elem (Attr _pos _ctx _names _quants _attrs )  =
+    (sem_Elem_Attr _pos _ctx (sem_NontSet _names ) _quants (sem_Attrs _attrs ) )
+sem_Elem (Data _pos _ctx _names _params _attrs _alts _ext )  =
+    (sem_Elem_Data _pos _ctx (sem_NontSet _names ) _params (sem_Attrs _attrs ) (sem_Alts _alts ) _ext )
+sem_Elem (Deriving _pos _set _classes )  =
+    (sem_Elem_Deriving _pos (sem_NontSet _set ) _classes )
+sem_Elem (Module _pos _name _exports _imports )  =
+    (sem_Elem_Module _pos _name _exports _imports )
+sem_Elem (Nocatas _pos _set )  =
+    (sem_Elem_Nocatas _pos (sem_NontSet _set ) )
+sem_Elem (Pragma _pos _names )  =
+    (sem_Elem_Pragma _pos _names )
+sem_Elem (Sem _pos _ctx _names _attrs _quants _alts )  =
+    (sem_Elem_Sem _pos _ctx (sem_NontSet _names ) (sem_Attrs _attrs ) _quants (sem_SemAlts _alts ) )
+sem_Elem (Set _pos _name _merge _set )  =
+    (sem_Elem_Set _pos _name _merge (sem_NontSet _set ) )
+sem_Elem (Txt _pos _name _mbNt _lines )  =
+    (sem_Elem_Txt _pos _name _mbNt _lines )
+sem_Elem (Type _pos _ctx _name _params _type )  =
+    (sem_Elem_Type _pos _ctx _name _params _type )
+sem_Elem (Wrapper _pos _set )  =
+    (sem_Elem_Wrapper _pos (sem_NontSet _set ) )
+-- semantic domain
+newtype T_Elem  = T_Elem ((Map NontermIdent (Attributes, Attributes)) ->
+                          (Map NontermIdent (Set ConstructorIdent)) ->
+                          DataTypes ->
+                          (Set NontermIdent) ->
+                          (Map NontermIdent (Attributes, Attributes)) ->
+                          (Map Identifier (Set NontermIdent,Set Identifier)) ->
+                          DefinedSets ->
+                          Options ->
+                          ( (Map NontermIdent (Attributes, Attributes)),AttrOrderMap,Blocks,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),(Map NontermIdent (Set ConstructorIdent)),([(NontermIdent, ConstructorIdent, FieldMap)]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),(Set Identifier),([ (NontermIdent, ConstructorIdent, RuleInfo)]),(Set Identifier),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),ContextMap,(Map Identifier (Set NontermIdent,Set Identifier)),Derivings,(Seq Error),(Maybe (String,String,String)),ParamMap,(Options -> Options),QuantMap,PragmaMap,TypeSyns,(Map NontermIdent (Map Identifier (String,String,String))),(Set NontermIdent)))
+data Inh_Elem  = Inh_Elem {allAttrDecls_Inh_Elem :: !((Map NontermIdent (Attributes, Attributes))),allConstructors_Inh_Elem :: !((Map NontermIdent (Set ConstructorIdent))),allFields_Inh_Elem :: !(DataTypes),allNonterminals_Inh_Elem :: !((Set NontermIdent)),attrDecls_Inh_Elem :: !((Map NontermIdent (Attributes, Attributes))),defSets_Inh_Elem :: !((Map Identifier (Set NontermIdent,Set Identifier))),definedSets_Inh_Elem :: !(DefinedSets),options_Inh_Elem :: !(Options)}
+data Syn_Elem  = Syn_Elem {attrDecls_Syn_Elem :: !((Map NontermIdent (Attributes, Attributes))),attrOrderCollect_Syn_Elem :: !(AttrOrderMap),blocks_Syn_Elem :: !(Blocks),collectedArounds_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedConstructorsMap_Syn_Elem :: !((Map NontermIdent (Set ConstructorIdent))),collectedFields_Syn_Elem :: !(([(NontermIdent, ConstructorIdent, FieldMap)])),collectedInsts_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedNames_Syn_Elem :: !((Set Identifier)),collectedRules_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSetNames_Syn_Elem :: !((Set Identifier)),collectedSigs_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_Elem :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),ctxCollect_Syn_Elem :: !(ContextMap),defSets_Syn_Elem :: !((Map Identifier (Set NontermIdent,Set Identifier))),derivings_Syn_Elem :: !(Derivings),errors_Syn_Elem :: !((Seq Error)),moduleDecl_Syn_Elem :: !((Maybe (String,String,String))),paramsCollect_Syn_Elem :: !(ParamMap),pragmas_Syn_Elem :: !((Options -> Options)),quantCollect_Syn_Elem :: !(QuantMap),semPragmasCollect_Syn_Elem :: !(PragmaMap),typeSyns_Syn_Elem :: !(TypeSyns),useMap_Syn_Elem :: !((Map NontermIdent (Map Identifier (String,String,String)))),wrappers_Syn_Elem :: !((Set NontermIdent))}
+wrap_Elem :: T_Elem  ->
+             Inh_Elem  ->
+             Syn_Elem 
+wrap_Elem (T_Elem sem ) (Inh_Elem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions )  =
+    (let ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers) = sem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions 
+     in  (Syn_Elem _lhsOattrDecls _lhsOattrOrderCollect _lhsOblocks _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedConstructorsMap _lhsOcollectedFields _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedNames _lhsOcollectedRules _lhsOcollectedSetNames _lhsOcollectedSigs _lhsOcollectedUniques _lhsOctxCollect _lhsOdefSets _lhsOderivings _lhsOerrors _lhsOmoduleDecl _lhsOparamsCollect _lhsOpragmas _lhsOquantCollect _lhsOsemPragmasCollect _lhsOtypeSyns _lhsOuseMap _lhsOwrappers ))
+sem_Elem_Attr :: Pos ->
+                 ClassContext ->
+                 T_NontSet  ->
+                 ([String]) ->
+                 T_Attrs  ->
+                 T_Elem 
+sem_Elem_Attr pos_ ctx_ (T_NontSet names_ ) quants_ (T_Attrs attrs_ )  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOctxCollect :: ContextMap
+                      _lhsOquantCollect :: QuantMap
+                      _attrsOnts :: (Set NontermIdent)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _namesOallFields :: DataTypes
+                      _namesOallNonterminals :: (Set NontermIdent)
+                      _namesOdefinedSets :: DefinedSets
+                      _attrsOallFields :: DataTypes
+                      _attrsOallNonterminals :: (Set NontermIdent)
+                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsOoptions :: Options
+                      _namesIcollectedNames :: (Set Identifier)
+                      _namesIerrors :: (Seq Error)
+                      _namesInontSet :: (Set NontermIdent)
+                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsIerrors :: (Seq Error)
+                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      -- "Transform.ag"(line 883, column 7)
+                      _lhsOctxCollect =
+                          ({-# LINE 883 "Transform.ag" #-}
+                           if null ctx_
+                           then Map.empty
+                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 1654 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 908, column 7)
+                      _lhsOquantCollect =
+                          ({-# LINE 908 "Transform.ag" #-}
+                           if null quants_
+                           then Map.empty
+                           else Map.fromList [(nt, quants_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 1662 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 944, column 10)
+                      _attrsOnts =
+                          ({-# LINE 944 "Transform.ag" #-}
+                           _namesInontSet
+                           {-# LINE 1668 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1674 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1680 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 1686 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 1692 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1698 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 1704 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 1710 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 1716 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _namesIcollectedNames
+                           {-# LINE 1722 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 1728 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 1734 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 1740 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 1746 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1752 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _namesIerrors Seq.>< _attrsIerrors
+                           {-# LINE 1758 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 1764 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1770 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 1776 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1782 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 1788 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           _attrsIuseMap
+                           {-# LINE 1794 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 1800 "Transform.hs" #-}
+                           )
+                      -- copy rule (up)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _attrsIattrDecls
+                           {-# LINE 1806 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 1812 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 1818 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 1824 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 1830 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 1836 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 1842 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 1848 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOoptions =
+                          ({-# LINE 39 "Transform.ag" #-}
+                           _lhsIoptions
+                           {-# LINE 1854 "Transform.hs" #-}
+                           )
+                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
+                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
+                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
+                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Data :: Pos ->
+                 ClassContext ->
+                 T_NontSet  ->
+                 ([Identifier]) ->
+                 T_Attrs  ->
+                 T_Alts  ->
+                 Bool ->
+                 T_Elem 
+sem_Elem_Data pos_ ctx_ (T_NontSet names_ ) params_ (T_Attrs attrs_ ) (T_Alts alts_ ) ext_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _altsOnts :: (Set NontermIdent)
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOctxCollect :: ContextMap
+                      _attrsOnts :: (Set NontermIdent)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _namesOallFields :: DataTypes
+                      _namesOallNonterminals :: (Set NontermIdent)
+                      _namesOdefinedSets :: DefinedSets
+                      _attrsOallFields :: DataTypes
+                      _attrsOallNonterminals :: (Set NontermIdent)
+                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsOoptions :: Options
+                      _altsOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                      _altsOallNonterminals :: (Set NontermIdent)
+                      _namesIcollectedNames :: (Set Identifier)
+                      _namesIerrors :: (Seq Error)
+                      _namesInontSet :: (Set NontermIdent)
+                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsIerrors :: (Seq Error)
+                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _altsIcollectedConstructorNames :: (Set ConstructorIdent)
+                      _altsIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      -- "Transform.ag"(line 171, column 10)
+                      _altsOnts =
+                          ({-# LINE 171 "Transform.ag" #-}
+                           _namesInontSet
+                           {-# LINE 1927 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 575, column 11)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 575 "Transform.ag" #-}
+                           Map.fromList
+                           [ (n, _altsIcollectedConstructorNames)
+                           | n <- Set.toList _namesInontSet
+                           ]
+                           {-# LINE 1936 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 860, column 7)
+                      _lhsOparamsCollect =
+                          ({-# LINE 860 "Transform.ag" #-}
+                           if null params_
+                           then Map.empty
+                           else Map.fromList [(nt, params_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 1944 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 883, column 7)
+                      _lhsOctxCollect =
+                          ({-# LINE 883 "Transform.ag" #-}
+                           if null ctx_
+                           then Map.empty
+                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 1952 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 943, column 10)
+                      _attrsOnts =
+                          ({-# LINE 943 "Transform.ag" #-}
+                           _namesInontSet
+                           {-# LINE 1958 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1964 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 1970 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 1976 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 1982 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           _altsIcollectedFields
+                           {-# LINE 1988 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 1994 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 2000 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _namesIcollectedNames
+                           {-# LINE 2006 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 2012 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2018 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 2024 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 2030 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2036 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _namesIerrors Seq.>< _attrsIerrors
+                           {-# LINE 2042 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 2048 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 2054 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2060 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2066 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 2072 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           _attrsIuseMap
+                           {-# LINE 2078 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2084 "Transform.hs" #-}
+                           )
+                      -- copy rule (up)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _attrsIattrDecls
+                           {-# LINE 2090 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 2096 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 2102 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 2108 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 2114 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 2120 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 2126 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 2132 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOoptions =
+                          ({-# LINE 39 "Transform.ag" #-}
+                           _lhsIoptions
+                           {-# LINE 2138 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _altsOallConstructors =
+                          ({-# LINE 97 "Transform.ag" #-}
+                           _lhsIallConstructors
+                           {-# LINE 2144 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _altsOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 2150 "Transform.hs" #-}
+                           )
+                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
+                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
+                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
+                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
+                      ( _altsIcollectedConstructorNames,_altsIcollectedFields) =
+                          alts_ _altsOallConstructors _altsOallNonterminals _altsOnts 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Deriving :: Pos ->
+                     T_NontSet  ->
+                     ([NontermIdent]) ->
+                     T_Elem 
+sem_Elem_Deriving pos_ (T_NontSet set_ ) classes_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOderivings :: Derivings
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _setOallFields :: DataTypes
+                      _setOallNonterminals :: (Set NontermIdent)
+                      _setOdefinedSets :: DefinedSets
+                      _setIcollectedNames :: (Set Identifier)
+                      _setIerrors :: (Seq Error)
+                      _setInontSet :: (Set NontermIdent)
+                      -- "Transform.ag"(line 928, column 14)
+                      _lhsOderivings =
+                          ({-# LINE 928 "Transform.ag" #-}
+                           Map.fromList [(nt,Set.fromList classes_) | nt <- Set.toList _setInontSet]
+                           {-# LINE 2208 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2214 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2220 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 2226 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 2232 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2238 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 2244 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 2250 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 2256 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _setIcollectedNames
+                           {-# LINE 2262 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 2268 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2274 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 2280 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 2286 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2292 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _setIerrors
+                           {-# LINE 2298 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 2304 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2310 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 2316 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2322 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2328 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 2334 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2340 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2346 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 2352 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 2358 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 2364 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 2370 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 2376 "Transform.hs" #-}
+                           )
+                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
+                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Module :: Pos ->
+                   String ->
+                   String ->
+                   String ->
+                   T_Elem 
+sem_Elem_Module pos_ name_ exports_ imports_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      -- "Transform.ag"(line 1121, column 7)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1121 "Transform.ag" #-}
+                           Just (name_, exports_, imports_)
+                           {-# LINE 2425 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2431 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2437 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 2443 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 2449 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2455 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 2461 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 2467 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 2473 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2479 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 2485 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2491 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 2497 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 2503 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2509 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2515 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           Seq.empty
+                           {-# LINE 2521 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2527 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 2533 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2539 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2545 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 2551 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2557 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2563 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 2569 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 2575 "Transform.hs" #-}
+                           )
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Nocatas :: Pos ->
+                    T_NontSet  ->
+                    T_Elem 
+sem_Elem_Nocatas pos_ (T_NontSet set_ )  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOpragmas :: (Options -> Options)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _setOallFields :: DataTypes
+                      _setOallNonterminals :: (Set NontermIdent)
+                      _setOdefinedSets :: DefinedSets
+                      _setIcollectedNames :: (Set Identifier)
+                      _setIerrors :: (Seq Error)
+                      _setInontSet :: (Set NontermIdent)
+                      -- "Transform.ag"(line 741, column 14)
+                      _lhsOpragmas =
+                          ({-# LINE 741 "Transform.ag" #-}
+                           \o -> o { nocatas = _setInontSet `Set.union` nocatas o }
+                           {-# LINE 2626 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2632 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2638 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 2644 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 2650 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2656 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 2662 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 2668 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 2674 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _setIcollectedNames
+                           {-# LINE 2680 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 2686 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2692 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 2698 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 2704 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2710 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2716 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _setIerrors
+                           {-# LINE 2722 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 2728 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2734 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2740 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2746 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 2752 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2758 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2764 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 2770 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 2776 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 2782 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 2788 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 2794 "Transform.hs" #-}
+                           )
+                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
+                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Pragma :: Pos ->
+                   ([NontermIdent]) ->
+                   T_Elem 
+sem_Elem_Pragma pos_ names_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOpragmas :: (Options -> Options)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      -- "Transform.ag"(line 750, column 13)
+                      _lhsOpragmas =
+                          ({-# LINE 750 "Transform.ag" #-}
+                           let mk n o = case getName n of
+                                          "gencatas"     -> o { folds       = True  }
+                                          "nogencatas"   -> o { folds       = False }
+                                          "gendatas"     -> o { dataTypes   = True  }
+                                          "nogendatas"   -> o { dataTypes   = False }
+                                          "gensems"      -> o { semfuns     = True  }
+                                          "nogensems"    -> o { semfuns     = False }
+                                          "gentypesigs"  -> o { typeSigs    = True  }
+                                          "nogentypesigs"-> o { typeSigs    = False }
+                                          "nocycle"      -> o { withCycle   = False }
+                                          "cycle"        -> o { withCycle   = True  }
+                                          "nostrictdata" -> o { strictData  = False }
+                                          "strictdata"   -> o { strictData  = True  }
+                                          "nostrictcase" -> o { strictCases = False }
+                                          "strictcase"   -> o { strictCases = True  }
+                                          "strictercase" -> o { strictCases = True, stricterCases = True }
+                                          "nostrictwrap" -> o { strictWrap  = False }
+                                          "strictwrap"   -> o { strictWrap  = True  }
+                                          "novisit"      -> o { visit       = False }
+                                          "visit"        -> o { visit       = True  }
+                                          "nocase"       -> o { cases       = False }
+                                          "case"         -> o { cases       = True  }
+                                          "noseq"        -> o { withSeq     = False }
+                                          "seq"          -> o { withSeq     = True  }
+                                          "nounbox"      -> o { unbox       = False }
+                                          "unbox"        -> o { unbox       = True  }
+                                          "bangpats"     -> o { bangpats    = True  }
+                                          "breadthfirst" -> o { breadthFirst = True }
+                                          "breadthfirstStrict" -> o { breadthFirstStrict = True }
+                                          "nooptimize"   -> o { cases = False , visit = False }
+                                          "optimize"     -> o { cases = True  , visit = True  }
+                                          "strictsem"    -> o { strictSems = True }
+                                          "gentraces"    -> o { genTraces = True }
+                                          "genusetraces" -> o { genUseTraces = True }
+                                          "splitsems"    -> o { splitSems = True }
+                                          "gencostcentres" -> o { genCostCentres = True }
+                                          "sepsemmods"   -> o { sepSemMods = True }
+                                          "genlinepragmas" -> o { genLinePragmas = True }
+                                          "newtypes"       -> o { newtypes = True }
+                                          "nonewtypes"     -> o { newtypes = False }
+                                          "nooptimizations" -> o { noOptimizations = True }
+                                          "kennedywarren"   -> o { kennedyWarren = True }
+                                          "rename"          -> o { rename = True }
+                                          _              -> o
+                           in \o -> foldr mk o names_
+                           {-# LINE 2885 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2891 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2897 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 2903 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 2909 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2915 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 2921 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 2927 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 2933 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2939 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 2945 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 2951 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 2957 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 2963 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2969 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2975 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           Seq.empty
+                           {-# LINE 2981 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 2987 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2993 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 2999 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3005 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 3011 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3017 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3023 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 3029 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 3035 "Transform.hs" #-}
+                           )
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Sem :: Pos ->
+                ClassContext ->
+                T_NontSet  ->
+                T_Attrs  ->
+                ([String]) ->
+                T_SemAlts  ->
+                T_Elem 
+sem_Elem_Sem pos_ ctx_ (T_NontSet names_ ) (T_Attrs attrs_ ) quants_ (T_SemAlts alts_ )  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _altsOnts :: (Set NontermIdent)
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOquantCollect :: QuantMap
+                      _attrsOnts :: (Set NontermIdent)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _namesOallFields :: DataTypes
+                      _namesOallNonterminals :: (Set NontermIdent)
+                      _namesOdefinedSets :: DefinedSets
+                      _attrsOallFields :: DataTypes
+                      _attrsOallNonterminals :: (Set NontermIdent)
+                      _attrsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsOoptions :: Options
+                      _altsOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _altsOallFields :: DataTypes
+                      _altsOoptions :: Options
+                      _namesIcollectedNames :: (Set Identifier)
+                      _namesIerrors :: (Seq Error)
+                      _namesInontSet :: (Set NontermIdent)
+                      _attrsIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _attrsIerrors :: (Seq Error)
+                      _attrsIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _altsIattrOrderCollect :: AttrOrderMap
+                      _altsIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _altsIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _altsIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _altsIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _altsIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _altsIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _altsIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _altsIerrors :: (Seq Error)
+                      _altsIsemPragmasCollect :: PragmaMap
+                      -- "Transform.ag"(line 172, column 10)
+                      _altsOnts =
+                          ({-# LINE 172 "Transform.ag" #-}
+                           _namesInontSet
+                           {-# LINE 3112 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 883, column 7)
+                      _lhsOctxCollect =
+                          ({-# LINE 883 "Transform.ag" #-}
+                           if null ctx_
+                           then Map.empty
+                           else Map.fromList [(nt, ctx_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 3120 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 908, column 7)
+                      _lhsOquantCollect =
+                          ({-# LINE 908 "Transform.ag" #-}
+                           if null quants_
+                           then Map.empty
+                           else Map.fromList [(nt, quants_) | nt <- Set.toList _namesInontSet]
+                           {-# LINE 3128 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 945, column 10)
+                      _attrsOnts =
+                          ({-# LINE 945 "Transform.ag" #-}
+                           _namesInontSet
+                           {-# LINE 3134 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           _altsIattrOrderCollect
+                           {-# LINE 3140 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3146 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           _altsIcollectedArounds
+                           {-# LINE 3152 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           _altsIcollectedAugments
+                           {-# LINE 3158 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3164 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 3170 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           _altsIcollectedInsts
+                           {-# LINE 3176 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           _altsIcollectedMerges
+                           {-# LINE 3182 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _namesIcollectedNames
+                           {-# LINE 3188 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           _altsIcollectedRules
+                           {-# LINE 3194 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3200 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           _altsIcollectedSigs
+                           {-# LINE 3206 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           _altsIcollectedUniques
+                           {-# LINE 3212 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3218 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _namesIerrors Seq.>< _attrsIerrors Seq.>< _altsIerrors
+                           {-# LINE 3224 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 3230 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3236 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 3242 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           _altsIsemPragmasCollect
+                           {-# LINE 3248 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 3254 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           _attrsIuseMap
+                           {-# LINE 3260 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3266 "Transform.hs" #-}
+                           )
+                      -- copy rule (up)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _attrsIattrDecls
+                           {-# LINE 3272 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 3278 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 3284 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 3290 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _namesOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 3296 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 3302 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 3308 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 3314 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _attrsOoptions =
+                          ({-# LINE 39 "Transform.ag" #-}
+                           _lhsIoptions
+                           {-# LINE 3320 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _altsOallAttrDecls =
+                          ({-# LINE 825 "Transform.ag" #-}
+                           _lhsIallAttrDecls
+                           {-# LINE 3326 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _altsOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 3332 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _altsOoptions =
+                          ({-# LINE 39 "Transform.ag" #-}
+                           _lhsIoptions
+                           {-# LINE 3338 "Transform.hs" #-}
+                           )
+                      ( _namesIcollectedNames,_namesIerrors,_namesInontSet) =
+                          names_ _namesOallFields _namesOallNonterminals _namesOdefinedSets 
+                      ( _attrsIattrDecls,_attrsIerrors,_attrsIuseMap) =
+                          attrs_ _attrsOallFields _attrsOallNonterminals _attrsOattrDecls _attrsOnts _attrsOoptions 
+                      ( _altsIattrOrderCollect,_altsIcollectedArounds,_altsIcollectedAugments,_altsIcollectedInsts,_altsIcollectedMerges,_altsIcollectedRules,_altsIcollectedSigs,_altsIcollectedUniques,_altsIerrors,_altsIsemPragmasCollect) =
+                          alts_ _altsOallAttrDecls _altsOallFields _altsOnts _altsOoptions 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Set :: Pos ->
+                NontermIdent ->
+                Bool ->
+                T_NontSet  ->
+                T_Elem 
+sem_Elem_Set pos_ name_ merge_ (T_NontSet set_ )  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _setOallFields :: DataTypes
+                      _setOallNonterminals :: (Set NontermIdent)
+                      _setOdefinedSets :: DefinedSets
+                      _setIcollectedNames :: (Set Identifier)
+                      _setIerrors :: (Seq Error)
+                      _setInontSet :: (Set NontermIdent)
+                      -- "Transform.ag"(line 552, column 10)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 552 "Transform.ag" #-}
+                           Set.singleton name_
+                           {-# LINE 3397 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 659, column 13)
+                      __tup3 =
+                          ({-# LINE 659 "Transform.ag" #-}
+                           let allUsedNames = Set.unions [ maybe (Set.singleton n)
+                                                                 snd
+                                                                 (Map.lookup n _lhsIdefSets)
+                                                         | n <- Set.toList _setIcollectedNames
+                                                         ]
+                               (nontSet,e1) | Set.member name_ allUsedNames
+                                                        = (Set.empty, Seq.singleton(CyclicSet name_))
+                                            | otherwise = (_setInontSet, Seq.empty)
+                               (res, e2) = let toAdd = (nontSet,Set.insert name_ allUsedNames)
+                                               union (a,b) (c,d) = (a `Set.union` c, b `Set.union` d)
+                                           in if Set.member name_ _lhsIallNonterminals || not merge_
+                                              then checkDuplicate DupSet name_ toAdd _lhsIdefSets
+                                              else (Map.insertWith union name_ toAdd _lhsIdefSets, Seq.empty)
+                           in (res, e1 Seq.>< e2)
+                           {-# LINE 3416 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 659, column 13)
+                      (_defSets2,_) =
+                          ({-# LINE 659 "Transform.ag" #-}
+                           __tup3
+                           {-# LINE 3422 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 659, column 13)
+                      (_,_errs) =
+                          ({-# LINE 659 "Transform.ag" #-}
+                           __tup3
+                           {-# LINE 3428 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 673, column 9)
+                      _lhsOdefSets =
+                          ({-# LINE 673 "Transform.ag" #-}
+                           _defSets2
+                           {-# LINE 3434 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 673, column 9)
+                      _lhsOerrors =
+                          ({-# LINE 674 "Transform.ag" #-}
+                           _errs >< _setIerrors
+                           {-# LINE 3440 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3446 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3452 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 3458 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 3464 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3470 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 3476 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 3482 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 3488 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _setIcollectedNames
+                           {-# LINE 3494 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 3500 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 3506 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 3512 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3518 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3524 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 3530 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3536 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 3542 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3548 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3554 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 3560 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3566 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3572 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 3578 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 3584 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 3590 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 3596 "Transform.hs" #-}
+                           )
+                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
+                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Txt :: Pos ->
+                Identifier ->
+                (Maybe NontermIdent) ->
+                ([String]) ->
+                T_Elem 
+sem_Elem_Txt pos_ name_ mbNt_ lines_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOblocks :: Blocks
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      -- "Transform.ag"(line 181, column 10)
+                      _blockInfo =
+                          ({-# LINE 181 "Transform.ag" #-}
+                           ( let nm = getName name_
+                             in if nm == "imports"
+                                then BlockImport
+                                else if nm == "optpragmas"
+                                     then BlockPragma
+                                     else BlockOther
+                           , mbNt_
+                           )
+                           {-# LINE 3652 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 189, column 10)
+                      _blockValue =
+                          ({-# LINE 189 "Transform.ag" #-}
+                           [(lines_, pos_)]
+                           {-# LINE 3658 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 190, column 10)
+                      _lhsOblocks =
+                          ({-# LINE 190 "Transform.ag" #-}
+                           Map.singleton _blockInfo     _blockValue
+                           {-# LINE 3664 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 191, column 10)
+                      _lhsOerrors =
+                          ({-# LINE 191 "Transform.ag" #-}
+                           if checkParseBlock _lhsIoptions
+                           then let exp = Expression pos_ tks
+                                    tks = [tk]
+                                    tk  = HsToken (unlines lines_) pos_
+                                in Seq.fromList $ checkBlock $ exp
+                           else Seq.empty
+                           {-# LINE 3675 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3681 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 3687 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 3693 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3699 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 3705 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 3711 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 3717 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3723 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 3729 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3735 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 3741 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 3747 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3753 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3759 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 3765 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3771 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 3777 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3783 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3789 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 3795 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3801 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3807 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 3813 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 3819 "Transform.hs" #-}
+                           )
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Type :: Pos ->
+                 ClassContext ->
+                 NontermIdent ->
+                 ([Identifier]) ->
+                 ComplexType ->
+                 T_Elem 
+sem_Elem_Type pos_ ctx_ name_ params_ type_  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      -- "Transform.ag"(line 249, column 10)
+                      _lhsOcollectedFields =
+                          ({-# LINE 249 "Transform.ag" #-}
+                           map (\(x,y)->(name_, x, y)) _expanded
+                           {-# LINE 3867 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 555, column 11)
+                      _lhsOcollectedNames =
+                          ({-# LINE 555 "Transform.ag" #-}
+                           Set.singleton name_
+                           {-# LINE 3873 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 609, column 11)
+                      _expanded =
+                          ({-# LINE 609 "Transform.ag" #-}
+                           case _argType of
+                                   List tp -> [(Ident "Cons" pos_, [(Ident "hd" pos_, tp)
+                                                                   ,(Ident "tl" pos_, NT name_ (map getName params_))
+                                                                   ]
+                                               )
+                                              ,(Ident "Nil" pos_,  [])
+                                              ]
+                                   Maybe tp -> [(Ident "Just" pos_, [(Ident "just" pos_, tp)
+                                                                   ]
+                                               )
+                                              ,(Ident "Nothing" pos_,  [])
+                                              ]
+                                   Either tp1 tp2 -> [
+                                                (Ident "Left"    pos_,  [(Ident "left"  pos_, tp1) ])
+                                              , (Ident "Right"   pos_,  [(Ident "right" pos_, tp2) ])
+                                              ]
+                                   Map tp1 tp2 -> [ (Ident "Entry" pos_, [ (Ident "key" pos_, tp1)
+                                                                         , (Ident "val" pos_, tp2)
+                                                                         , (Ident "tl" pos_, NT name_ (map getName params_))
+                                                                         ])
+                                                  , (Ident "Nil" pos_, [])
+                                                  ]
+                                   IntMap tp   -> [ (Ident "Entry" pos_, [ (Ident "key" pos_, Haskell "Int")
+                                                                         , (Ident "val" pos_, tp)
+                                                                         , (Ident "tl" pos_, NT name_ (map getName params_))
+                                                                         ])
+                                                  , (Ident "Nil" pos_, [])
+                                                  ]
+                                   Tuple xs -> [(Ident "Tuple" pos_, xs)]
+                           {-# LINE 3907 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 638, column 11)
+                      _argType =
+                          ({-# LINE 638 "Transform.ag" #-}
+                           case type_ of
+                            Maybe tp       -> Maybe  (  makeType _lhsIallNonterminals tp)
+                            Either tp1 tp2 -> Either (  makeType _lhsIallNonterminals tp1) (makeType _lhsIallNonterminals tp2)
+                            List tp        -> List   (  makeType _lhsIallNonterminals tp)
+                            Tuple xs       -> Tuple [(f,makeType _lhsIallNonterminals tp) | (f,tp) <- xs]
+                            Map tp1 tp2    -> Map    (  makeType _lhsIallNonterminals tp1) (makeType _lhsIallNonterminals tp2)
+                            IntMap tp      -> IntMap (  makeType _lhsIallNonterminals tp)
+                           {-# LINE 3919 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 645, column 11)
+                      _lhsOtypeSyns =
+                          ({-# LINE 645 "Transform.ag" #-}
+                           [(name_,_argType)]
+                           {-# LINE 3925 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 866, column 7)
+                      _lhsOparamsCollect =
+                          ({-# LINE 866 "Transform.ag" #-}
+                           if null params_
+                           then Map.empty
+                           else Map.singleton name_ params_
+                           {-# LINE 3933 "Transform.hs" #-}
+                           )
+                      -- "Transform.ag"(line 889, column 7)
+                      _lhsOctxCollect =
+                          ({-# LINE 889 "Transform.ag" #-}
+                           if null ctx_
+                           then Map.empty
+                           else Map.singleton name_ ctx_
+                           {-# LINE 3941 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3947 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3953 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 3959 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 3965 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 3971 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 3977 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 3983 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 3989 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 3995 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 4001 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 4007 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4013 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           Seq.empty
+                           {-# LINE 4019 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 4025 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 4031 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4037 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4043 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4049 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 731, column 32)
+                      _lhsOwrappers =
+                          ({-# LINE 731 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 4055 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 4061 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 4067 "Transform.hs" #-}
+                           )
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elem_Wrapper :: Pos ->
+                    T_NontSet  ->
+                    T_Elem 
+sem_Elem_Wrapper pos_ (T_NontSet set_ )  =
+    (T_Elem (\ _lhsIallAttrDecls
+               _lhsIallConstructors
+               _lhsIallFields
+               _lhsIallNonterminals
+               _lhsIattrDecls
+               _lhsIdefSets
+               _lhsIdefinedSets
+               _lhsIoptions ->
+                 (let _lhsOwrappers :: (Set NontermIdent)
+                      _lhsOattrOrderCollect :: AttrOrderMap
+                      _lhsOblocks :: Blocks
+                      _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                      _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                      _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                      _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                      _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                      _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                      _lhsOcollectedNames :: (Set Identifier)
+                      _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                      _lhsOcollectedSetNames :: (Set Identifier)
+                      _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                      _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                      _lhsOctxCollect :: ContextMap
+                      _lhsOderivings :: Derivings
+                      _lhsOerrors :: (Seq Error)
+                      _lhsOmoduleDecl :: (Maybe (String,String,String))
+                      _lhsOparamsCollect :: ParamMap
+                      _lhsOpragmas :: (Options -> Options)
+                      _lhsOquantCollect :: QuantMap
+                      _lhsOsemPragmasCollect :: PragmaMap
+                      _lhsOtypeSyns :: TypeSyns
+                      _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                      _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                      _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                      _setOallFields :: DataTypes
+                      _setOallNonterminals :: (Set NontermIdent)
+                      _setOdefinedSets :: DefinedSets
+                      _setIcollectedNames :: (Set Identifier)
+                      _setIerrors :: (Seq Error)
+                      _setInontSet :: (Set NontermIdent)
+                      -- "Transform.ag"(line 734, column 13)
+                      _lhsOwrappers =
+                          ({-# LINE 734 "Transform.ag" #-}
+                           _setInontSet
+                           {-# LINE 4118 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 824, column 55)
+                      _lhsOattrOrderCollect =
+                          ({-# LINE 824 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4124 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 45, column 19)
+                      _lhsOblocks =
+                          ({-# LINE 45 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4130 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 157, column 32)
+                      _lhsOcollectedArounds =
+                          ({-# LINE 157 "Transform.ag" #-}
+                           []
+                           {-# LINE 4136 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 156, column 32)
+                      _lhsOcollectedAugments =
+                          ({-# LINE 156 "Transform.ag" #-}
+                           []
+                           {-# LINE 4142 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 95, column 48)
+                      _lhsOcollectedConstructorsMap =
+                          ({-# LINE 95 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4148 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 126, column 28)
+                      _lhsOcollectedFields =
+                          ({-# LINE 126 "Transform.ag" #-}
+                           []
+                           {-# LINE 4154 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 154, column 32)
+                      _lhsOcollectedInsts =
+                          ({-# LINE 154 "Transform.ag" #-}
+                           []
+                           {-# LINE 4160 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 158, column 32)
+                      _lhsOcollectedMerges =
+                          ({-# LINE 158 "Transform.ag" #-}
+                           []
+                           {-# LINE 4166 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 87, column 50)
+                      _lhsOcollectedNames =
+                          ({-# LINE 87 "Transform.ag" #-}
+                           _setIcollectedNames
+                           {-# LINE 4172 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 152, column 32)
+                      _lhsOcollectedRules =
+                          ({-# LINE 152 "Transform.ag" #-}
+                           []
+                           {-# LINE 4178 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 86, column 50)
+                      _lhsOcollectedSetNames =
+                          ({-# LINE 86 "Transform.ag" #-}
+                           Set.empty
+                           {-# LINE 4184 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 153, column 32)
+                      _lhsOcollectedSigs =
+                          ({-# LINE 153 "Transform.ag" #-}
+                           []
+                           {-# LINE 4190 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 155, column 32)
+                      _lhsOcollectedUniques =
+                          ({-# LINE 155 "Transform.ag" #-}
+                           []
+                           {-# LINE 4196 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 879, column 34)
+                      _lhsOctxCollect =
+                          ({-# LINE 879 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4202 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 921, column 33)
+                      _lhsOderivings =
+                          ({-# LINE 921 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4208 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 43, column 19)
+                      _lhsOerrors =
+                          ({-# LINE 43 "Transform.ag" #-}
+                           _setIerrors
+                           {-# LINE 4214 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 1117, column 37)
+                      _lhsOmoduleDecl =
+                          ({-# LINE 1117 "Transform.ag" #-}
+                           mzero
+                           {-# LINE 4220 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 856, column 37)
+                      _lhsOparamsCollect =
+                          ({-# LINE 856 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4226 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 747, column 34)
+                      _lhsOpragmas =
+                          ({-# LINE 747 "Transform.ag" #-}
+                           id
+                           {-# LINE 4232 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 904, column 36)
+                      _lhsOquantCollect =
+                          ({-# LINE 904 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4238 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 796, column 56)
+                      _lhsOsemPragmasCollect =
+                          ({-# LINE 796 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4244 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 596, column 32)
+                      _lhsOtypeSyns =
+                          ({-# LINE 596 "Transform.ag" #-}
+                           []
+                           {-# LINE 4250 "Transform.hs" #-}
+                           )
+                      -- use rule "Transform.ag"(line 138, column 15)
+                      _lhsOuseMap =
+                          ({-# LINE 138 "Transform.ag" #-}
+                           Map.empty
+                           {-# LINE 4256 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOattrDecls =
+                          ({-# LINE 137 "Transform.ag" #-}
+                           _lhsIattrDecls
+                           {-# LINE 4262 "Transform.hs" #-}
+                           )
+                      -- copy rule (chain)
+                      _lhsOdefSets =
+                          ({-# LINE 105 "Transform.ag" #-}
+                           _lhsIdefSets
+                           {-# LINE 4268 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallFields =
+                          ({-# LINE 129 "Transform.ag" #-}
+                           _lhsIallFields
+                           {-# LINE 4274 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOallNonterminals =
+                          ({-# LINE 89 "Transform.ag" #-}
+                           _lhsIallNonterminals
+                           {-# LINE 4280 "Transform.hs" #-}
+                           )
+                      -- copy rule (down)
+                      _setOdefinedSets =
+                          ({-# LINE 108 "Transform.ag" #-}
+                           _lhsIdefinedSets
+                           {-# LINE 4286 "Transform.hs" #-}
+                           )
+                      ( _setIcollectedNames,_setIerrors,_setInontSet) =
+                          set_ _setOallFields _setOallNonterminals _setOdefinedSets 
+                  in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+-- Elems -------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
+         allConstructors      : Map NontermIdent (Set ConstructorIdent)
+         allFields            : DataTypes
+         allNonterminals      : Set NontermIdent
+         definedSets          : DefinedSets
+         options              : Options
+      chained attributes:
+         attrDecls            : Map NontermIdent (Attributes, Attributes)
+         defSets              : Map Identifier (Set NontermIdent,Set Identifier)
+      synthesized attributes:
+         attrOrderCollect     : AttrOrderMap
+         blocks               : Blocks
+         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
+         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
+         collectedConstructorsMap : Map NontermIdent (Set ConstructorIdent)
+         collectedFields      : [(NontermIdent, ConstructorIdent, FieldMap)]
+         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
+         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
+         collectedNames       : Set Identifier
+         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
+         collectedSetNames    : Set Identifier
+         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
+         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
+         ctxCollect           : ContextMap
+         derivings            : Derivings
+         errors               : Seq Error
+         moduleDecl           : Maybe (String,String,String)
+         paramsCollect        : ParamMap
+         pragmas              : Options -> Options
+         quantCollect         : QuantMap
+         semPragmasCollect    : PragmaMap
+         typeSyns             : TypeSyns
+         useMap               : Map NontermIdent (Map Identifier (String,String,String))
+         wrappers             : Set NontermIdent
+   alternatives:
+      alternative Cons:
+         child hd             : Elem 
+         child tl             : Elems 
+      alternative Nil:
+-}
+-- cata
+sem_Elems :: Elems  ->
+             T_Elems 
+sem_Elems list  =
+    (Prelude.foldr sem_Elems_Cons sem_Elems_Nil (Prelude.map sem_Elem list) )
+-- semantic domain
+newtype T_Elems  = T_Elems ((Map NontermIdent (Attributes, Attributes)) ->
+                            (Map NontermIdent (Set ConstructorIdent)) ->
+                            DataTypes ->
+                            (Set NontermIdent) ->
+                            (Map NontermIdent (Attributes, Attributes)) ->
+                            (Map Identifier (Set NontermIdent,Set Identifier)) ->
+                            DefinedSets ->
+                            Options ->
+                            ( (Map NontermIdent (Attributes, Attributes)),AttrOrderMap,Blocks,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),(Map NontermIdent (Set ConstructorIdent)),([(NontermIdent, ConstructorIdent, FieldMap)]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),(Set Identifier),([ (NontermIdent, ConstructorIdent, RuleInfo)]),(Set Identifier),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),ContextMap,(Map Identifier (Set NontermIdent,Set Identifier)),Derivings,(Seq Error),(Maybe (String,String,String)),ParamMap,(Options -> Options),QuantMap,PragmaMap,TypeSyns,(Map NontermIdent (Map Identifier (String,String,String))),(Set NontermIdent)))
+data Inh_Elems  = Inh_Elems {allAttrDecls_Inh_Elems :: !((Map NontermIdent (Attributes, Attributes))),allConstructors_Inh_Elems :: !((Map NontermIdent (Set ConstructorIdent))),allFields_Inh_Elems :: !(DataTypes),allNonterminals_Inh_Elems :: !((Set NontermIdent)),attrDecls_Inh_Elems :: !((Map NontermIdent (Attributes, Attributes))),defSets_Inh_Elems :: !((Map Identifier (Set NontermIdent,Set Identifier))),definedSets_Inh_Elems :: !(DefinedSets),options_Inh_Elems :: !(Options)}
+data Syn_Elems  = Syn_Elems {attrDecls_Syn_Elems :: !((Map NontermIdent (Attributes, Attributes))),attrOrderCollect_Syn_Elems :: !(AttrOrderMap),blocks_Syn_Elems :: !(Blocks),collectedArounds_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedConstructorsMap_Syn_Elems :: !((Map NontermIdent (Set ConstructorIdent))),collectedFields_Syn_Elems :: !(([(NontermIdent, ConstructorIdent, FieldMap)])),collectedInsts_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedNames_Syn_Elems :: !((Set Identifier)),collectedRules_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSetNames_Syn_Elems :: !((Set Identifier)),collectedSigs_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_Elems :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),ctxCollect_Syn_Elems :: !(ContextMap),defSets_Syn_Elems :: !((Map Identifier (Set NontermIdent,Set Identifier))),derivings_Syn_Elems :: !(Derivings),errors_Syn_Elems :: !((Seq Error)),moduleDecl_Syn_Elems :: !((Maybe (String,String,String))),paramsCollect_Syn_Elems :: !(ParamMap),pragmas_Syn_Elems :: !((Options -> Options)),quantCollect_Syn_Elems :: !(QuantMap),semPragmasCollect_Syn_Elems :: !(PragmaMap),typeSyns_Syn_Elems :: !(TypeSyns),useMap_Syn_Elems :: !((Map NontermIdent (Map Identifier (String,String,String)))),wrappers_Syn_Elems :: !((Set NontermIdent))}
+wrap_Elems :: T_Elems  ->
+              Inh_Elems  ->
+              Syn_Elems 
+wrap_Elems (T_Elems sem ) (Inh_Elems _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions )  =
+    (let ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers) = sem _lhsIallAttrDecls _lhsIallConstructors _lhsIallFields _lhsIallNonterminals _lhsIattrDecls _lhsIdefSets _lhsIdefinedSets _lhsIoptions 
+     in  (Syn_Elems _lhsOattrDecls _lhsOattrOrderCollect _lhsOblocks _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedConstructorsMap _lhsOcollectedFields _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedNames _lhsOcollectedRules _lhsOcollectedSetNames _lhsOcollectedSigs _lhsOcollectedUniques _lhsOctxCollect _lhsOdefSets _lhsOderivings _lhsOerrors _lhsOmoduleDecl _lhsOparamsCollect _lhsOpragmas _lhsOquantCollect _lhsOsemPragmasCollect _lhsOtypeSyns _lhsOuseMap _lhsOwrappers ))
+sem_Elems_Cons :: T_Elem  ->
+                  T_Elems  ->
+                  T_Elems 
+sem_Elems_Cons (T_Elem hd_ ) (T_Elems tl_ )  =
+    (T_Elems (\ _lhsIallAttrDecls
+                _lhsIallConstructors
+                _lhsIallFields
+                _lhsIallNonterminals
+                _lhsIattrDecls
+                _lhsIdefSets
+                _lhsIdefinedSets
+                _lhsIoptions ->
+                  (let _lhsOattrOrderCollect :: AttrOrderMap
+                       _lhsOblocks :: Blocks
+                       _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                       _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                       _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                       _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                       _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                       _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                       _lhsOcollectedNames :: (Set Identifier)
+                       _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                       _lhsOcollectedSetNames :: (Set Identifier)
+                       _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                       _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                       _lhsOctxCollect :: ContextMap
+                       _lhsOderivings :: Derivings
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOmoduleDecl :: (Maybe (String,String,String))
+                       _lhsOparamsCollect :: ParamMap
+                       _lhsOpragmas :: (Options -> Options)
+                       _lhsOquantCollect :: QuantMap
+                       _lhsOsemPragmasCollect :: PragmaMap
+                       _lhsOtypeSyns :: TypeSyns
+                       _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                       _lhsOwrappers :: (Set NontermIdent)
+                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       _hdOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _hdOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                       _hdOallFields :: DataTypes
+                       _hdOallNonterminals :: (Set NontermIdent)
+                       _hdOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _hdOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       _hdOdefinedSets :: DefinedSets
+                       _hdOoptions :: Options
+                       _tlOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _tlOallConstructors :: (Map NontermIdent (Set ConstructorIdent))
+                       _tlOallFields :: DataTypes
+                       _tlOallNonterminals :: (Set NontermIdent)
+                       _tlOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _tlOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       _tlOdefinedSets :: DefinedSets
+                       _tlOoptions :: Options
+                       _hdIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _hdIattrOrderCollect :: AttrOrderMap
+                       _hdIblocks :: Blocks
+                       _hdIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                       _hdIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                       _hdIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                       _hdIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                       _hdIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                       _hdIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                       _hdIcollectedNames :: (Set Identifier)
+                       _hdIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                       _hdIcollectedSetNames :: (Set Identifier)
+                       _hdIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                       _hdIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                       _hdIctxCollect :: ContextMap
+                       _hdIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       _hdIderivings :: Derivings
+                       _hdIerrors :: (Seq Error)
+                       _hdImoduleDecl :: (Maybe (String,String,String))
+                       _hdIparamsCollect :: ParamMap
+                       _hdIpragmas :: (Options -> Options)
+                       _hdIquantCollect :: QuantMap
+                       _hdIsemPragmasCollect :: PragmaMap
+                       _hdItypeSyns :: TypeSyns
+                       _hdIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                       _hdIwrappers :: (Set NontermIdent)
+                       _tlIattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _tlIattrOrderCollect :: AttrOrderMap
+                       _tlIblocks :: Blocks
+                       _tlIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                       _tlIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                       _tlIcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                       _tlIcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                       _tlIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                       _tlIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                       _tlIcollectedNames :: (Set Identifier)
+                       _tlIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                       _tlIcollectedSetNames :: (Set Identifier)
+                       _tlIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                       _tlIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                       _tlIctxCollect :: ContextMap
+                       _tlIdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       _tlIderivings :: Derivings
+                       _tlIerrors :: (Seq Error)
+                       _tlImoduleDecl :: (Maybe (String,String,String))
+                       _tlIparamsCollect :: ParamMap
+                       _tlIpragmas :: (Options -> Options)
+                       _tlIquantCollect :: QuantMap
+                       _tlIsemPragmasCollect :: PragmaMap
+                       _tlItypeSyns :: TypeSyns
+                       _tlIuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                       _tlIwrappers :: (Set NontermIdent)
+                       -- use rule "Transform.ag"(line 824, column 55)
+                       _lhsOattrOrderCollect =
+                           ({-# LINE 824 "Transform.ag" #-}
+                            _hdIattrOrderCollect `orderMapUnion` _tlIattrOrderCollect
+                            {-# LINE 4468 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 45, column 19)
+                       _lhsOblocks =
+                           ({-# LINE 45 "Transform.ag" #-}
+                            _hdIblocks `mapUnionWithPlusPlus` _tlIblocks
+                            {-# LINE 4474 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 157, column 32)
+                       _lhsOcollectedArounds =
+                           ({-# LINE 157 "Transform.ag" #-}
+                            _hdIcollectedArounds ++ _tlIcollectedArounds
+                            {-# LINE 4480 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 156, column 32)
+                       _lhsOcollectedAugments =
+                           ({-# LINE 156 "Transform.ag" #-}
+                            _hdIcollectedAugments ++ _tlIcollectedAugments
+                            {-# LINE 4486 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 95, column 48)
+                       _lhsOcollectedConstructorsMap =
+                           ({-# LINE 95 "Transform.ag" #-}
+                            _hdIcollectedConstructorsMap `mapUnionWithSetUnion` _tlIcollectedConstructorsMap
+                            {-# LINE 4492 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 126, column 28)
+                       _lhsOcollectedFields =
+                           ({-# LINE 126 "Transform.ag" #-}
+                            _hdIcollectedFields ++ _tlIcollectedFields
+                            {-# LINE 4498 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 154, column 32)
+                       _lhsOcollectedInsts =
+                           ({-# LINE 154 "Transform.ag" #-}
+                            _hdIcollectedInsts ++ _tlIcollectedInsts
+                            {-# LINE 4504 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 158, column 32)
+                       _lhsOcollectedMerges =
+                           ({-# LINE 158 "Transform.ag" #-}
+                            _hdIcollectedMerges ++ _tlIcollectedMerges
+                            {-# LINE 4510 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 87, column 50)
+                       _lhsOcollectedNames =
+                           ({-# LINE 87 "Transform.ag" #-}
+                            _hdIcollectedNames `Set.union` _tlIcollectedNames
+                            {-# LINE 4516 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 152, column 32)
+                       _lhsOcollectedRules =
+                           ({-# LINE 152 "Transform.ag" #-}
+                            _hdIcollectedRules ++ _tlIcollectedRules
+                            {-# LINE 4522 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 86, column 50)
+                       _lhsOcollectedSetNames =
+                           ({-# LINE 86 "Transform.ag" #-}
+                            _hdIcollectedSetNames `Set.union` _tlIcollectedSetNames
+                            {-# LINE 4528 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 153, column 32)
+                       _lhsOcollectedSigs =
+                           ({-# LINE 153 "Transform.ag" #-}
+                            _hdIcollectedSigs ++ _tlIcollectedSigs
+                            {-# LINE 4534 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 155, column 32)
+                       _lhsOcollectedUniques =
+                           ({-# LINE 155 "Transform.ag" #-}
+                            _hdIcollectedUniques ++ _tlIcollectedUniques
+                            {-# LINE 4540 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 879, column 34)
+                       _lhsOctxCollect =
+                           ({-# LINE 879 "Transform.ag" #-}
+                            _hdIctxCollect `mergeCtx` _tlIctxCollect
+                            {-# LINE 4546 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 921, column 33)
+                       _lhsOderivings =
+                           ({-# LINE 921 "Transform.ag" #-}
+                            _hdIderivings `mergeDerivings` _tlIderivings
+                            {-# LINE 4552 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 43, column 19)
+                       _lhsOerrors =
+                           ({-# LINE 43 "Transform.ag" #-}
+                            _hdIerrors Seq.>< _tlIerrors
+                            {-# LINE 4558 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 1117, column 37)
+                       _lhsOmoduleDecl =
+                           ({-# LINE 1117 "Transform.ag" #-}
+                            _hdImoduleDecl `mplus` _tlImoduleDecl
+                            {-# LINE 4564 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 856, column 37)
+                       _lhsOparamsCollect =
+                           ({-# LINE 856 "Transform.ag" #-}
+                            _hdIparamsCollect `mergeParams` _tlIparamsCollect
+                            {-# LINE 4570 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 747, column 34)
+                       _lhsOpragmas =
+                           ({-# LINE 747 "Transform.ag" #-}
+                            _hdIpragmas . _tlIpragmas
+                            {-# LINE 4576 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 904, column 36)
+                       _lhsOquantCollect =
+                           ({-# LINE 904 "Transform.ag" #-}
+                            _hdIquantCollect `mergeQuant` _tlIquantCollect
+                            {-# LINE 4582 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 796, column 56)
+                       _lhsOsemPragmasCollect =
+                           ({-# LINE 796 "Transform.ag" #-}
+                            _hdIsemPragmasCollect `pragmaMapUnion` _tlIsemPragmasCollect
+                            {-# LINE 4588 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 596, column 32)
+                       _lhsOtypeSyns =
+                           ({-# LINE 596 "Transform.ag" #-}
+                            _hdItypeSyns ++ _tlItypeSyns
+                            {-# LINE 4594 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 138, column 15)
+                       _lhsOuseMap =
+                           ({-# LINE 138 "Transform.ag" #-}
+                            _hdIuseMap `merge` _tlIuseMap
+                            {-# LINE 4600 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 731, column 32)
+                       _lhsOwrappers =
+                           ({-# LINE 731 "Transform.ag" #-}
+                            _hdIwrappers `Set.union` _tlIwrappers
+                            {-# LINE 4606 "Transform.hs" #-}
+                            )
+                       -- copy rule (up)
+                       _lhsOattrDecls =
+                           ({-# LINE 137 "Transform.ag" #-}
+                            _tlIattrDecls
+                            {-# LINE 4612 "Transform.hs" #-}
+                            )
+                       -- copy rule (up)
+                       _lhsOdefSets =
+                           ({-# LINE 105 "Transform.ag" #-}
+                            _tlIdefSets
+                            {-# LINE 4618 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallAttrDecls =
+                           ({-# LINE 825 "Transform.ag" #-}
+                            _lhsIallAttrDecls
+                            {-# LINE 4624 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallConstructors =
+                           ({-# LINE 97 "Transform.ag" #-}
+                            _lhsIallConstructors
+                            {-# LINE 4630 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallFields =
+                           ({-# LINE 129 "Transform.ag" #-}
+                            _lhsIallFields
+                            {-# LINE 4636 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOallNonterminals =
+                           ({-# LINE 89 "Transform.ag" #-}
+                            _lhsIallNonterminals
+                            {-# LINE 4642 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOattrDecls =
+                           ({-# LINE 137 "Transform.ag" #-}
+                            _lhsIattrDecls
+                            {-# LINE 4648 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOdefSets =
+                           ({-# LINE 105 "Transform.ag" #-}
+                            _lhsIdefSets
+                            {-# LINE 4654 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOdefinedSets =
+                           ({-# LINE 108 "Transform.ag" #-}
+                            _lhsIdefinedSets
+                            {-# LINE 4660 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _hdOoptions =
+                           ({-# LINE 39 "Transform.ag" #-}
+                            _lhsIoptions
+                            {-# LINE 4666 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallAttrDecls =
+                           ({-# LINE 825 "Transform.ag" #-}
+                            _lhsIallAttrDecls
+                            {-# LINE 4672 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallConstructors =
+                           ({-# LINE 97 "Transform.ag" #-}
+                            _lhsIallConstructors
+                            {-# LINE 4678 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallFields =
+                           ({-# LINE 129 "Transform.ag" #-}
+                            _lhsIallFields
+                            {-# LINE 4684 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOallNonterminals =
+                           ({-# LINE 89 "Transform.ag" #-}
+                            _lhsIallNonterminals
+                            {-# LINE 4690 "Transform.hs" #-}
+                            )
+                       -- copy rule (chain)
+                       _tlOattrDecls =
+                           ({-# LINE 137 "Transform.ag" #-}
+                            _hdIattrDecls
+                            {-# LINE 4696 "Transform.hs" #-}
+                            )
+                       -- copy rule (chain)
+                       _tlOdefSets =
+                           ({-# LINE 105 "Transform.ag" #-}
+                            _hdIdefSets
+                            {-# LINE 4702 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOdefinedSets =
+                           ({-# LINE 108 "Transform.ag" #-}
+                            _lhsIdefinedSets
+                            {-# LINE 4708 "Transform.hs" #-}
+                            )
+                       -- copy rule (down)
+                       _tlOoptions =
+                           ({-# LINE 39 "Transform.ag" #-}
+                            _lhsIoptions
+                            {-# LINE 4714 "Transform.hs" #-}
+                            )
+                       ( _hdIattrDecls,_hdIattrOrderCollect,_hdIblocks,_hdIcollectedArounds,_hdIcollectedAugments,_hdIcollectedConstructorsMap,_hdIcollectedFields,_hdIcollectedInsts,_hdIcollectedMerges,_hdIcollectedNames,_hdIcollectedRules,_hdIcollectedSetNames,_hdIcollectedSigs,_hdIcollectedUniques,_hdIctxCollect,_hdIdefSets,_hdIderivings,_hdIerrors,_hdImoduleDecl,_hdIparamsCollect,_hdIpragmas,_hdIquantCollect,_hdIsemPragmasCollect,_hdItypeSyns,_hdIuseMap,_hdIwrappers) =
+                           hd_ _hdOallAttrDecls _hdOallConstructors _hdOallFields _hdOallNonterminals _hdOattrDecls _hdOdefSets _hdOdefinedSets _hdOoptions 
+                       ( _tlIattrDecls,_tlIattrOrderCollect,_tlIblocks,_tlIcollectedArounds,_tlIcollectedAugments,_tlIcollectedConstructorsMap,_tlIcollectedFields,_tlIcollectedInsts,_tlIcollectedMerges,_tlIcollectedNames,_tlIcollectedRules,_tlIcollectedSetNames,_tlIcollectedSigs,_tlIcollectedUniques,_tlIctxCollect,_tlIdefSets,_tlIderivings,_tlIerrors,_tlImoduleDecl,_tlIparamsCollect,_tlIpragmas,_tlIquantCollect,_tlIsemPragmasCollect,_tlItypeSyns,_tlIuseMap,_tlIwrappers) =
+                           tl_ _tlOallAttrDecls _tlOallConstructors _tlOallFields _tlOallNonterminals _tlOattrDecls _tlOdefSets _tlOdefinedSets _tlOoptions 
+                   in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+sem_Elems_Nil :: T_Elems 
+sem_Elems_Nil  =
+    (T_Elems (\ _lhsIallAttrDecls
+                _lhsIallConstructors
+                _lhsIallFields
+                _lhsIallNonterminals
+                _lhsIattrDecls
+                _lhsIdefSets
+                _lhsIdefinedSets
+                _lhsIoptions ->
+                  (let _lhsOattrOrderCollect :: AttrOrderMap
+                       _lhsOblocks :: Blocks
+                       _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                       _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                       _lhsOcollectedConstructorsMap :: (Map NontermIdent (Set ConstructorIdent))
+                       _lhsOcollectedFields :: ([(NontermIdent, ConstructorIdent, FieldMap)])
+                       _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                       _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                       _lhsOcollectedNames :: (Set Identifier)
+                       _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                       _lhsOcollectedSetNames :: (Set Identifier)
+                       _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                       _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                       _lhsOctxCollect :: ContextMap
+                       _lhsOderivings :: Derivings
+                       _lhsOerrors :: (Seq Error)
+                       _lhsOmoduleDecl :: (Maybe (String,String,String))
+                       _lhsOparamsCollect :: ParamMap
+                       _lhsOpragmas :: (Options -> Options)
+                       _lhsOquantCollect :: QuantMap
+                       _lhsOsemPragmasCollect :: PragmaMap
+                       _lhsOtypeSyns :: TypeSyns
+                       _lhsOuseMap :: (Map NontermIdent (Map Identifier (String,String,String)))
+                       _lhsOwrappers :: (Set NontermIdent)
+                       _lhsOattrDecls :: (Map NontermIdent (Attributes, Attributes))
+                       _lhsOdefSets :: (Map Identifier (Set NontermIdent,Set Identifier))
+                       -- use rule "Transform.ag"(line 824, column 55)
+                       _lhsOattrOrderCollect =
+                           ({-# LINE 824 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4761 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 45, column 19)
+                       _lhsOblocks =
+                           ({-# LINE 45 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4767 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 157, column 32)
+                       _lhsOcollectedArounds =
+                           ({-# LINE 157 "Transform.ag" #-}
+                            []
+                            {-# LINE 4773 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 156, column 32)
+                       _lhsOcollectedAugments =
+                           ({-# LINE 156 "Transform.ag" #-}
+                            []
+                            {-# LINE 4779 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 95, column 48)
+                       _lhsOcollectedConstructorsMap =
+                           ({-# LINE 95 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4785 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 126, column 28)
+                       _lhsOcollectedFields =
+                           ({-# LINE 126 "Transform.ag" #-}
+                            []
+                            {-# LINE 4791 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 154, column 32)
+                       _lhsOcollectedInsts =
+                           ({-# LINE 154 "Transform.ag" #-}
+                            []
+                            {-# LINE 4797 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 158, column 32)
+                       _lhsOcollectedMerges =
+                           ({-# LINE 158 "Transform.ag" #-}
+                            []
+                            {-# LINE 4803 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 87, column 50)
+                       _lhsOcollectedNames =
+                           ({-# LINE 87 "Transform.ag" #-}
+                            Set.empty
+                            {-# LINE 4809 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 152, column 32)
+                       _lhsOcollectedRules =
+                           ({-# LINE 152 "Transform.ag" #-}
+                            []
+                            {-# LINE 4815 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 86, column 50)
+                       _lhsOcollectedSetNames =
+                           ({-# LINE 86 "Transform.ag" #-}
+                            Set.empty
+                            {-# LINE 4821 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 153, column 32)
+                       _lhsOcollectedSigs =
+                           ({-# LINE 153 "Transform.ag" #-}
+                            []
+                            {-# LINE 4827 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 155, column 32)
+                       _lhsOcollectedUniques =
+                           ({-# LINE 155 "Transform.ag" #-}
+                            []
+                            {-# LINE 4833 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 879, column 34)
+                       _lhsOctxCollect =
+                           ({-# LINE 879 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4839 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 921, column 33)
+                       _lhsOderivings =
+                           ({-# LINE 921 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4845 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 43, column 19)
+                       _lhsOerrors =
+                           ({-# LINE 43 "Transform.ag" #-}
+                            Seq.empty
+                            {-# LINE 4851 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 1117, column 37)
+                       _lhsOmoduleDecl =
+                           ({-# LINE 1117 "Transform.ag" #-}
+                            mzero
+                            {-# LINE 4857 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 856, column 37)
+                       _lhsOparamsCollect =
+                           ({-# LINE 856 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4863 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 747, column 34)
+                       _lhsOpragmas =
+                           ({-# LINE 747 "Transform.ag" #-}
+                            id
+                            {-# LINE 4869 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 904, column 36)
+                       _lhsOquantCollect =
+                           ({-# LINE 904 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4875 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 796, column 56)
+                       _lhsOsemPragmasCollect =
+                           ({-# LINE 796 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4881 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 596, column 32)
+                       _lhsOtypeSyns =
+                           ({-# LINE 596 "Transform.ag" #-}
+                            []
+                            {-# LINE 4887 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 138, column 15)
+                       _lhsOuseMap =
+                           ({-# LINE 138 "Transform.ag" #-}
+                            Map.empty
+                            {-# LINE 4893 "Transform.hs" #-}
+                            )
+                       -- use rule "Transform.ag"(line 731, column 32)
+                       _lhsOwrappers =
+                           ({-# LINE 731 "Transform.ag" #-}
+                            Set.empty
+                            {-# LINE 4899 "Transform.hs" #-}
+                            )
+                       -- copy rule (chain)
+                       _lhsOattrDecls =
+                           ({-# LINE 137 "Transform.ag" #-}
+                            _lhsIattrDecls
+                            {-# LINE 4905 "Transform.hs" #-}
+                            )
+                       -- copy rule (chain)
+                       _lhsOdefSets =
+                           ({-# LINE 105 "Transform.ag" #-}
+                            _lhsIdefSets
+                            {-# LINE 4911 "Transform.hs" #-}
+                            )
+                   in  ( _lhsOattrDecls,_lhsOattrOrderCollect,_lhsOblocks,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedConstructorsMap,_lhsOcollectedFields,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedNames,_lhsOcollectedRules,_lhsOcollectedSetNames,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOctxCollect,_lhsOdefSets,_lhsOderivings,_lhsOerrors,_lhsOmoduleDecl,_lhsOparamsCollect,_lhsOpragmas,_lhsOquantCollect,_lhsOsemPragmasCollect,_lhsOtypeSyns,_lhsOuseMap,_lhsOwrappers))) )
+-- NontSet -----------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allFields            : DataTypes
+         allNonterminals      : Set NontermIdent
+         definedSets          : DefinedSets
+      synthesized attributes:
+         collectedNames       : Set Identifier
+         errors               : Seq Error
+         nontSet              : Set NontermIdent
+   alternatives:
+      alternative All:
+      alternative Difference:
+         child set1           : NontSet 
+         child set2           : NontSet 
+      alternative Intersect:
+         child set1           : NontSet 
+         child set2           : NontSet 
+      alternative NamedSet:
+         child name           : {NontermIdent}
+         visit 0:
+            local _tup4       : _
+            local nontSet     : _
+            local errors      : _
+      alternative Path:
+         child from           : {NontermIdent}
+         child to             : {NontermIdent}
+      alternative Union:
+         child set1           : NontSet 
+         child set2           : NontSet 
+-}
+-- cata
+sem_NontSet :: NontSet  ->
+               T_NontSet 
+sem_NontSet (All )  =
+    (sem_NontSet_All )
+sem_NontSet (Difference _set1 _set2 )  =
+    (sem_NontSet_Difference (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
+sem_NontSet (Intersect _set1 _set2 )  =
+    (sem_NontSet_Intersect (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
+sem_NontSet (NamedSet _name )  =
+    (sem_NontSet_NamedSet _name )
+sem_NontSet (Path _from _to )  =
+    (sem_NontSet_Path _from _to )
+sem_NontSet (Union _set1 _set2 )  =
+    (sem_NontSet_Union (sem_NontSet _set1 ) (sem_NontSet _set2 ) )
+-- semantic domain
+newtype T_NontSet  = T_NontSet (DataTypes ->
+                                (Set NontermIdent) ->
+                                DefinedSets ->
+                                ( (Set Identifier),(Seq Error),(Set NontermIdent)))
+data Inh_NontSet  = Inh_NontSet {allFields_Inh_NontSet :: !(DataTypes),allNonterminals_Inh_NontSet :: !((Set NontermIdent)),definedSets_Inh_NontSet :: !(DefinedSets)}
+data Syn_NontSet  = Syn_NontSet {collectedNames_Syn_NontSet :: !((Set Identifier)),errors_Syn_NontSet :: !((Seq Error)),nontSet_Syn_NontSet :: !((Set NontermIdent))}
+wrap_NontSet :: T_NontSet  ->
+                Inh_NontSet  ->
+                Syn_NontSet 
+wrap_NontSet (T_NontSet sem ) (Inh_NontSet _lhsIallFields _lhsIallNonterminals _lhsIdefinedSets )  =
+    (let ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet) = sem _lhsIallFields _lhsIallNonterminals _lhsIdefinedSets 
+     in  (Syn_NontSet _lhsOcollectedNames _lhsOerrors _lhsOnontSet ))
+sem_NontSet_All :: T_NontSet 
+sem_NontSet_All  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOnontSet :: (Set NontermIdent)
+                         _lhsOcollectedNames :: (Set Identifier)
+                         _lhsOerrors :: (Seq Error)
+                         -- "Transform.ag"(line 677, column 16)
+                         _lhsOnontSet =
+                             ({-# LINE 677 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 4986 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 87, column 50)
+                         _lhsOcollectedNames =
+                             ({-# LINE 87 "Transform.ag" #-}
+                              Set.empty
+                              {-# LINE 4992 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              Seq.empty
+                              {-# LINE 4998 "Transform.hs" #-}
+                              )
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+sem_NontSet_Difference :: T_NontSet  ->
+                          T_NontSet  ->
+                          T_NontSet 
+sem_NontSet_Difference (T_NontSet set1_ ) (T_NontSet set2_ )  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOnontSet :: (Set NontermIdent)
+                         _lhsOcollectedNames :: (Set Identifier)
+                         _lhsOerrors :: (Seq Error)
+                         _set1OallFields :: DataTypes
+                         _set1OallNonterminals :: (Set NontermIdent)
+                         _set1OdefinedSets :: DefinedSets
+                         _set2OallFields :: DataTypes
+                         _set2OallNonterminals :: (Set NontermIdent)
+                         _set2OdefinedSets :: DefinedSets
+                         _set1IcollectedNames :: (Set Identifier)
+                         _set1Ierrors :: (Seq Error)
+                         _set1InontSet :: (Set NontermIdent)
+                         _set2IcollectedNames :: (Set Identifier)
+                         _set2Ierrors :: (Seq Error)
+                         _set2InontSet :: (Set NontermIdent)
+                         -- "Transform.ag"(line 683, column 16)
+                         _lhsOnontSet =
+                             ({-# LINE 683 "Transform.ag" #-}
+                              Set.difference    _set1InontSet _set2InontSet
+                              {-# LINE 5027 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 87, column 50)
+                         _lhsOcollectedNames =
+                             ({-# LINE 87 "Transform.ag" #-}
+                              _set1IcollectedNames `Set.union` _set2IcollectedNames
+                              {-# LINE 5033 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _set1Ierrors Seq.>< _set2Ierrors
+                              {-# LINE 5039 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5045 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5051 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5057 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5063 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5069 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5075 "Transform.hs" #-}
+                              )
+                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
+                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
+                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
+                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+sem_NontSet_Intersect :: T_NontSet  ->
+                         T_NontSet  ->
+                         T_NontSet 
+sem_NontSet_Intersect (T_NontSet set1_ ) (T_NontSet set2_ )  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOnontSet :: (Set NontermIdent)
+                         _lhsOcollectedNames :: (Set Identifier)
+                         _lhsOerrors :: (Seq Error)
+                         _set1OallFields :: DataTypes
+                         _set1OallNonterminals :: (Set NontermIdent)
+                         _set1OdefinedSets :: DefinedSets
+                         _set2OallFields :: DataTypes
+                         _set2OallNonterminals :: (Set NontermIdent)
+                         _set2OdefinedSets :: DefinedSets
+                         _set1IcollectedNames :: (Set Identifier)
+                         _set1Ierrors :: (Seq Error)
+                         _set1InontSet :: (Set NontermIdent)
+                         _set2IcollectedNames :: (Set Identifier)
+                         _set2Ierrors :: (Seq Error)
+                         _set2InontSet :: (Set NontermIdent)
+                         -- "Transform.ag"(line 682, column 16)
+                         _lhsOnontSet =
+                             ({-# LINE 682 "Transform.ag" #-}
+                              Set.intersection  _set1InontSet _set2InontSet
+                              {-# LINE 5108 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 87, column 50)
+                         _lhsOcollectedNames =
+                             ({-# LINE 87 "Transform.ag" #-}
+                              _set1IcollectedNames `Set.union` _set2IcollectedNames
+                              {-# LINE 5114 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _set1Ierrors Seq.>< _set2Ierrors
+                              {-# LINE 5120 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5126 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5132 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5138 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5144 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5150 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5156 "Transform.hs" #-}
+                              )
+                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
+                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
+                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
+                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+sem_NontSet_NamedSet :: NontermIdent ->
+                        T_NontSet 
+sem_NontSet_NamedSet name_  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOcollectedNames :: (Set Identifier)
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOnontSet :: (Set NontermIdent)
+                         -- "Transform.ag"(line 558, column 14)
+                         _lhsOcollectedNames =
+                             ({-# LINE 558 "Transform.ag" #-}
+                              Set.singleton name_
+                              {-# LINE 5176 "Transform.hs" #-}
+                              )
+                         -- "Transform.ag"(line 678, column 20)
+                         __tup4 =
+                             ({-# LINE 678 "Transform.ag" #-}
+                              case Map.lookup name_ _lhsIdefinedSets of
+                                           Nothing  -> (Set.empty, Seq.singleton (UndefNont name_))
+                                           Just set -> (set, Seq.empty)
+                              {-# LINE 5184 "Transform.hs" #-}
+                              )
+                         -- "Transform.ag"(line 678, column 20)
+                         (_nontSet,_) =
+                             ({-# LINE 678 "Transform.ag" #-}
+                              __tup4
+                              {-# LINE 5190 "Transform.hs" #-}
+                              )
+                         -- "Transform.ag"(line 678, column 20)
+                         (_,_errors) =
+                             ({-# LINE 678 "Transform.ag" #-}
+                              __tup4
+                              {-# LINE 5196 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _errors
+                              {-# LINE 5202 "Transform.hs" #-}
+                              )
+                         -- copy rule (from local)
+                         _lhsOnontSet =
+                             ({-# LINE 113 "Transform.ag" #-}
+                              _nontSet
+                              {-# LINE 5208 "Transform.hs" #-}
+                              )
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+sem_NontSet_Path :: NontermIdent ->
+                    NontermIdent ->
+                    T_NontSet 
+sem_NontSet_Path from_ to_  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOnontSet :: (Set NontermIdent)
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOcollectedNames :: (Set Identifier)
+                         -- "Transform.ag"(line 684, column 16)
+                         _lhsOnontSet =
+                             ({-# LINE 684 "Transform.ag" #-}
+                              let table = flattenDatas _lhsIallFields
+                              in path table from_ to_
+                              {-# LINE 5226 "Transform.hs" #-}
+                              )
+                         -- "Transform.ag"(line 686, column 16)
+                         _lhsOerrors =
+                             ({-# LINE 686 "Transform.ag" #-}
+                              let check name | Set.member name _lhsIallNonterminals
+                                                         = Seq.empty
+                                             | otherwise = Seq.singleton (UndefNont name)
+                              in check from_ >< check to_
+                              {-# LINE 5235 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 87, column 50)
+                         _lhsOcollectedNames =
+                             ({-# LINE 87 "Transform.ag" #-}
+                              Set.empty
+                              {-# LINE 5241 "Transform.hs" #-}
+                              )
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+sem_NontSet_Union :: T_NontSet  ->
+                     T_NontSet  ->
+                     T_NontSet 
+sem_NontSet_Union (T_NontSet set1_ ) (T_NontSet set2_ )  =
+    (T_NontSet (\ _lhsIallFields
+                  _lhsIallNonterminals
+                  _lhsIdefinedSets ->
+                    (let _lhsOnontSet :: (Set NontermIdent)
+                         _lhsOcollectedNames :: (Set Identifier)
+                         _lhsOerrors :: (Seq Error)
+                         _set1OallFields :: DataTypes
+                         _set1OallNonterminals :: (Set NontermIdent)
+                         _set1OdefinedSets :: DefinedSets
+                         _set2OallFields :: DataTypes
+                         _set2OallNonterminals :: (Set NontermIdent)
+                         _set2OdefinedSets :: DefinedSets
+                         _set1IcollectedNames :: (Set Identifier)
+                         _set1Ierrors :: (Seq Error)
+                         _set1InontSet :: (Set NontermIdent)
+                         _set2IcollectedNames :: (Set Identifier)
+                         _set2Ierrors :: (Seq Error)
+                         _set2InontSet :: (Set NontermIdent)
+                         -- "Transform.ag"(line 681, column 16)
+                         _lhsOnontSet =
+                             ({-# LINE 681 "Transform.ag" #-}
+                              Set.union         _set1InontSet _set2InontSet
+                              {-# LINE 5270 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 87, column 50)
+                         _lhsOcollectedNames =
+                             ({-# LINE 87 "Transform.ag" #-}
+                              _set1IcollectedNames `Set.union` _set2IcollectedNames
+                              {-# LINE 5276 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _set1Ierrors Seq.>< _set2Ierrors
+                              {-# LINE 5282 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5288 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5294 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set1OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5300 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 5306 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OallNonterminals =
+                             ({-# LINE 89 "Transform.ag" #-}
+                              _lhsIallNonterminals
+                              {-# LINE 5312 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _set2OdefinedSets =
+                             ({-# LINE 108 "Transform.ag" #-}
+                              _lhsIdefinedSets
+                              {-# LINE 5318 "Transform.hs" #-}
+                              )
+                         ( _set1IcollectedNames,_set1Ierrors,_set1InontSet) =
+                             set1_ _set1OallFields _set1OallNonterminals _set1OdefinedSets 
+                         ( _set2IcollectedNames,_set2Ierrors,_set2InontSet) =
+                             set2_ _set2OallFields _set2OallNonterminals _set2OdefinedSets 
+                     in  ( _lhsOcollectedNames,_lhsOerrors,_lhsOnontSet))) )
+-- Pattern -----------------------------------------------------
+{-
+   visit 0:
+      synthesized attributes:
+         copy                 : SELF 
+         definedAttrs         : [AttrName]
+         definedInsts         : [Identifier]
+         patunder             : [AttrName]->Pattern
+         stpos                : Pos
+   alternatives:
+      alternative Alias:
+         child field          : {Identifier}
+         child attr           : {Identifier}
+         child pat            : Pattern 
+         child parts          : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Constr:
+         child name           : {ConstructorIdent}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Irrefutable:
+         child pat            : Pattern 
+         visit 0:
+            local copy        : _
+      alternative Product:
+         child pos            : {Pos}
+         child pats           : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Underscore:
+         child pos            : {Pos}
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Pattern :: Pattern  ->
+               T_Pattern 
+sem_Pattern (Alias _field _attr _pat _parts )  =
+    (sem_Pattern_Alias _field _attr (sem_Pattern _pat ) (sem_Patterns _parts ) )
+sem_Pattern (Constr _name _pats )  =
+    (sem_Pattern_Constr _name (sem_Patterns _pats ) )
+sem_Pattern (Irrefutable _pat )  =
+    (sem_Pattern_Irrefutable (sem_Pattern _pat ) )
+sem_Pattern (Product _pos _pats )  =
+    (sem_Pattern_Product _pos (sem_Patterns _pats ) )
+sem_Pattern (Underscore _pos )  =
+    (sem_Pattern_Underscore _pos )
+-- semantic domain
+newtype T_Pattern  = T_Pattern (( Pattern ,([AttrName]),([Identifier]),([AttrName]->Pattern),Pos))
+data Inh_Pattern  = Inh_Pattern {}
+data Syn_Pattern  = Syn_Pattern {copy_Syn_Pattern :: !(Pattern ),definedAttrs_Syn_Pattern :: !(([AttrName])),definedInsts_Syn_Pattern :: !(([Identifier])),patunder_Syn_Pattern :: !(([AttrName]->Pattern)),stpos_Syn_Pattern :: !(Pos)}
+wrap_Pattern :: T_Pattern  ->
+                Inh_Pattern  ->
+                Syn_Pattern 
+wrap_Pattern (T_Pattern sem ) (Inh_Pattern )  =
+    (let ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos) = sem 
+     in  (Syn_Pattern _lhsOcopy _lhsOdefinedAttrs _lhsOdefinedInsts _lhsOpatunder _lhsOstpos ))
+sem_Pattern_Alias :: Identifier ->
+                     Identifier ->
+                     T_Pattern  ->
+                     T_Patterns  ->
+                     T_Pattern 
+sem_Pattern_Alias field_ attr_ (T_Pattern pat_ ) (T_Patterns parts_ )  =
+    (T_Pattern (let _lhsOdefinedAttrs :: ([AttrName])
+                    _lhsOpatunder :: ([AttrName]->Pattern)
+                    _lhsOdefinedInsts :: ([Identifier])
+                    _lhsOstpos :: Pos
+                    _lhsOcopy :: Pattern 
+                    _patIcopy :: Pattern 
+                    _patIdefinedAttrs :: ([AttrName])
+                    _patIdefinedInsts :: ([Identifier])
+                    _patIpatunder :: ([AttrName]->Pattern)
+                    _patIstpos :: Pos
+                    _partsIcopy :: Patterns 
+                    _partsIdefinedAttrs :: ([AttrName])
+                    _partsIdefinedInsts :: ([Identifier])
+                    _partsIpatunder :: ([AttrName]->Patterns)
+                    -- "Transform.ag"(line 1093, column 11)
+                    _lhsOdefinedAttrs =
+                        ({-# LINE 1093 "Transform.ag" #-}
+                         (field_, attr_) : _patIdefinedAttrs
+                         {-# LINE 5408 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1094, column 11)
+                    _lhsOpatunder =
+                        ({-# LINE 1094 "Transform.ag" #-}
+                         \us -> if ((field_,attr_) `elem` us) then Underscore noPos else _copy
+                         {-# LINE 5414 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1095, column 11)
+                    _lhsOdefinedInsts =
+                        ({-# LINE 1095 "Transform.ag" #-}
+                         (if field_ == _INST then [attr_] else []) ++ _patIdefinedInsts
+                         {-# LINE 5420 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1110, column 16)
+                    _lhsOstpos =
+                        ({-# LINE 1110 "Transform.ag" #-}
+                         getPos field_
+                         {-# LINE 5426 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _copy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         Alias field_ attr_ _patIcopy _partsIcopy
+                         {-# LINE 5432 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _lhsOcopy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         _copy
+                         {-# LINE 5438 "Transform.hs" #-}
+                         )
+                    ( _patIcopy,_patIdefinedAttrs,_patIdefinedInsts,_patIpatunder,_patIstpos) =
+                        pat_ 
+                    ( _partsIcopy,_partsIdefinedAttrs,_partsIdefinedInsts,_partsIpatunder) =
+                        parts_ 
+                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
+sem_Pattern_Constr :: ConstructorIdent ->
+                      T_Patterns  ->
+                      T_Pattern 
+sem_Pattern_Constr name_ (T_Patterns pats_ )  =
+    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
+                    _lhsOstpos :: Pos
+                    _lhsOdefinedAttrs :: ([AttrName])
+                    _lhsOdefinedInsts :: ([Identifier])
+                    _lhsOcopy :: Pattern 
+                    _patsIcopy :: Patterns 
+                    _patsIdefinedAttrs :: ([AttrName])
+                    _patsIdefinedInsts :: ([Identifier])
+                    _patsIpatunder :: ([AttrName]->Patterns)
+                    -- "Transform.ag"(line 1097, column 12)
+                    _lhsOpatunder =
+                        ({-# LINE 1097 "Transform.ag" #-}
+                         \us -> Constr name_ (_patsIpatunder us)
+                         {-# LINE 5462 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1108, column 16)
+                    _lhsOstpos =
+                        ({-# LINE 1108 "Transform.ag" #-}
+                         getPos name_
+                         {-# LINE 5468 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1088, column 42)
+                    _lhsOdefinedAttrs =
+                        ({-# LINE 1088 "Transform.ag" #-}
+                         _patsIdefinedAttrs
+                         {-# LINE 5474 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1087, column 55)
+                    _lhsOdefinedInsts =
+                        ({-# LINE 1087 "Transform.ag" #-}
+                         _patsIdefinedInsts
+                         {-# LINE 5480 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _copy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         Constr name_ _patsIcopy
+                         {-# LINE 5486 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _lhsOcopy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         _copy
+                         {-# LINE 5492 "Transform.hs" #-}
+                         )
+                    ( _patsIcopy,_patsIdefinedAttrs,_patsIdefinedInsts,_patsIpatunder) =
+                        pats_ 
+                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
+sem_Pattern_Irrefutable :: T_Pattern  ->
+                           T_Pattern 
+sem_Pattern_Irrefutable (T_Pattern pat_ )  =
+    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
+                    _lhsOdefinedAttrs :: ([AttrName])
+                    _lhsOdefinedInsts :: ([Identifier])
+                    _lhsOcopy :: Pattern 
+                    _lhsOstpos :: Pos
+                    _patIcopy :: Pattern 
+                    _patIdefinedAttrs :: ([AttrName])
+                    _patIdefinedInsts :: ([Identifier])
+                    _patIpatunder :: ([AttrName]->Pattern)
+                    _patIstpos :: Pos
+                    -- "Transform.ag"(line 1099, column 17)
+                    _lhsOpatunder =
+                        ({-# LINE 1099 "Transform.ag" #-}
+                         \us -> Irrefutable (_patIpatunder us)
+                         {-# LINE 5514 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1088, column 42)
+                    _lhsOdefinedAttrs =
+                        ({-# LINE 1088 "Transform.ag" #-}
+                         _patIdefinedAttrs
+                         {-# LINE 5520 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1087, column 55)
+                    _lhsOdefinedInsts =
+                        ({-# LINE 1087 "Transform.ag" #-}
+                         _patIdefinedInsts
+                         {-# LINE 5526 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _copy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         Irrefutable _patIcopy
+                         {-# LINE 5532 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _lhsOcopy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         _copy
+                         {-# LINE 5538 "Transform.hs" #-}
+                         )
+                    -- copy rule (up)
+                    _lhsOstpos =
+                        ({-# LINE 1105 "Transform.ag" #-}
+                         _patIstpos
+                         {-# LINE 5544 "Transform.hs" #-}
+                         )
+                    ( _patIcopy,_patIdefinedAttrs,_patIdefinedInsts,_patIpatunder,_patIstpos) =
+                        pat_ 
+                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
+sem_Pattern_Product :: Pos ->
+                       T_Patterns  ->
+                       T_Pattern 
+sem_Pattern_Product pos_ (T_Patterns pats_ )  =
+    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
+                    _lhsOstpos :: Pos
+                    _lhsOdefinedAttrs :: ([AttrName])
+                    _lhsOdefinedInsts :: ([Identifier])
+                    _lhsOcopy :: Pattern 
+                    _patsIcopy :: Patterns 
+                    _patsIdefinedAttrs :: ([AttrName])
+                    _patsIdefinedInsts :: ([Identifier])
+                    _patsIpatunder :: ([AttrName]->Patterns)
+                    -- "Transform.ag"(line 1098, column 13)
+                    _lhsOpatunder =
+                        ({-# LINE 1098 "Transform.ag" #-}
+                         \us -> Product pos_ (_patsIpatunder us)
+                         {-# LINE 5566 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1109, column 16)
+                    _lhsOstpos =
+                        ({-# LINE 1109 "Transform.ag" #-}
+                         pos_
+                         {-# LINE 5572 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1088, column 42)
+                    _lhsOdefinedAttrs =
+                        ({-# LINE 1088 "Transform.ag" #-}
+                         _patsIdefinedAttrs
+                         {-# LINE 5578 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1087, column 55)
+                    _lhsOdefinedInsts =
+                        ({-# LINE 1087 "Transform.ag" #-}
+                         _patsIdefinedInsts
+                         {-# LINE 5584 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _copy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         Product pos_ _patsIcopy
+                         {-# LINE 5590 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _lhsOcopy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         _copy
+                         {-# LINE 5596 "Transform.hs" #-}
+                         )
+                    ( _patsIcopy,_patsIdefinedAttrs,_patsIdefinedInsts,_patsIpatunder) =
+                        pats_ 
+                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
+sem_Pattern_Underscore :: Pos ->
+                          T_Pattern 
+sem_Pattern_Underscore pos_  =
+    (T_Pattern (let _lhsOpatunder :: ([AttrName]->Pattern)
+                    _lhsOstpos :: Pos
+                    _lhsOdefinedAttrs :: ([AttrName])
+                    _lhsOdefinedInsts :: ([Identifier])
+                    _lhsOcopy :: Pattern 
+                    -- "Transform.ag"(line 1096, column 16)
+                    _lhsOpatunder =
+                        ({-# LINE 1096 "Transform.ag" #-}
+                         \us -> _copy
+                         {-# LINE 5613 "Transform.hs" #-}
+                         )
+                    -- "Transform.ag"(line 1111, column 16)
+                    _lhsOstpos =
+                        ({-# LINE 1111 "Transform.ag" #-}
+                         pos_
+                         {-# LINE 5619 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1088, column 42)
+                    _lhsOdefinedAttrs =
+                        ({-# LINE 1088 "Transform.ag" #-}
+                         []
+                         {-# LINE 5625 "Transform.hs" #-}
+                         )
+                    -- use rule "Transform.ag"(line 1087, column 55)
+                    _lhsOdefinedInsts =
+                        ({-# LINE 1087 "Transform.ag" #-}
+                         []
+                         {-# LINE 5631 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _copy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         Underscore pos_
+                         {-# LINE 5637 "Transform.hs" #-}
+                         )
+                    -- self rule
+                    _lhsOcopy =
+                        ({-# LINE 23 "./Patterns.ag" #-}
+                         _copy
+                         {-# LINE 5643 "Transform.hs" #-}
+                         )
+                in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder,_lhsOstpos)) )
+-- Patterns ----------------------------------------------------
+{-
+   visit 0:
+      synthesized attributes:
+         copy                 : SELF 
+         definedAttrs         : [AttrName]
+         definedInsts         : [Identifier]
+         patunder             : [AttrName]->Patterns
+   alternatives:
+      alternative Cons:
+         child hd             : Pattern 
+         child tl             : Patterns 
+         visit 0:
+            local copy        : _
+      alternative Nil:
+         visit 0:
+            local copy        : _
+-}
+-- cata
+sem_Patterns :: Patterns  ->
+                T_Patterns 
+sem_Patterns list  =
+    (Prelude.foldr sem_Patterns_Cons sem_Patterns_Nil (Prelude.map sem_Pattern list) )
+-- semantic domain
+newtype T_Patterns  = T_Patterns (( Patterns ,([AttrName]),([Identifier]),([AttrName]->Patterns)))
+data Inh_Patterns  = Inh_Patterns {}
+data Syn_Patterns  = Syn_Patterns {copy_Syn_Patterns :: !(Patterns ),definedAttrs_Syn_Patterns :: !(([AttrName])),definedInsts_Syn_Patterns :: !(([Identifier])),patunder_Syn_Patterns :: !(([AttrName]->Patterns))}
+wrap_Patterns :: T_Patterns  ->
+                 Inh_Patterns  ->
+                 Syn_Patterns 
+wrap_Patterns (T_Patterns sem ) (Inh_Patterns )  =
+    (let ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder) = sem 
+     in  (Syn_Patterns _lhsOcopy _lhsOdefinedAttrs _lhsOdefinedInsts _lhsOpatunder ))
+sem_Patterns_Cons :: T_Pattern  ->
+                     T_Patterns  ->
+                     T_Patterns 
+sem_Patterns_Cons (T_Pattern hd_ ) (T_Patterns tl_ )  =
+    (T_Patterns (let _lhsOpatunder :: ([AttrName]->Patterns)
+                     _lhsOdefinedAttrs :: ([AttrName])
+                     _lhsOdefinedInsts :: ([Identifier])
+                     _lhsOcopy :: Patterns 
+                     _hdIcopy :: Pattern 
+                     _hdIdefinedAttrs :: ([AttrName])
+                     _hdIdefinedInsts :: ([Identifier])
+                     _hdIpatunder :: ([AttrName]->Pattern)
+                     _hdIstpos :: Pos
+                     _tlIcopy :: Patterns 
+                     _tlIdefinedAttrs :: ([AttrName])
+                     _tlIdefinedInsts :: ([Identifier])
+                     _tlIpatunder :: ([AttrName]->Patterns)
+                     -- "Transform.ag"(line 1103, column 10)
+                     _lhsOpatunder =
+                         ({-# LINE 1103 "Transform.ag" #-}
+                          \us -> (_hdIpatunder us) : (_tlIpatunder us)
+                          {-# LINE 5700 "Transform.hs" #-}
+                          )
+                     -- use rule "Transform.ag"(line 1088, column 42)
+                     _lhsOdefinedAttrs =
+                         ({-# LINE 1088 "Transform.ag" #-}
+                          _hdIdefinedAttrs ++ _tlIdefinedAttrs
+                          {-# LINE 5706 "Transform.hs" #-}
+                          )
+                     -- use rule "Transform.ag"(line 1087, column 55)
+                     _lhsOdefinedInsts =
+                         ({-# LINE 1087 "Transform.ag" #-}
+                          _hdIdefinedInsts ++ _tlIdefinedInsts
+                          {-# LINE 5712 "Transform.hs" #-}
+                          )
+                     -- self rule
+                     _copy =
+                         ({-# LINE 23 "./Patterns.ag" #-}
+                          (:) _hdIcopy _tlIcopy
+                          {-# LINE 5718 "Transform.hs" #-}
+                          )
+                     -- self rule
+                     _lhsOcopy =
+                         ({-# LINE 23 "./Patterns.ag" #-}
+                          _copy
+                          {-# LINE 5724 "Transform.hs" #-}
+                          )
+                     ( _hdIcopy,_hdIdefinedAttrs,_hdIdefinedInsts,_hdIpatunder,_hdIstpos) =
+                         hd_ 
+                     ( _tlIcopy,_tlIdefinedAttrs,_tlIdefinedInsts,_tlIpatunder) =
+                         tl_ 
+                 in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder)) )
+sem_Patterns_Nil :: T_Patterns 
+sem_Patterns_Nil  =
+    (T_Patterns (let _lhsOpatunder :: ([AttrName]->Patterns)
+                     _lhsOdefinedAttrs :: ([AttrName])
+                     _lhsOdefinedInsts :: ([Identifier])
+                     _lhsOcopy :: Patterns 
+                     -- "Transform.ag"(line 1102, column 9)
+                     _lhsOpatunder =
+                         ({-# LINE 1102 "Transform.ag" #-}
+                          \us ->  []
+                          {-# LINE 5741 "Transform.hs" #-}
+                          )
+                     -- use rule "Transform.ag"(line 1088, column 42)
+                     _lhsOdefinedAttrs =
+                         ({-# LINE 1088 "Transform.ag" #-}
+                          []
+                          {-# LINE 5747 "Transform.hs" #-}
+                          )
+                     -- use rule "Transform.ag"(line 1087, column 55)
+                     _lhsOdefinedInsts =
+                         ({-# LINE 1087 "Transform.ag" #-}
+                          []
+                          {-# LINE 5753 "Transform.hs" #-}
+                          )
+                     -- self rule
+                     _copy =
+                         ({-# LINE 23 "./Patterns.ag" #-}
+                          []
+                          {-# LINE 5759 "Transform.hs" #-}
+                          )
+                     -- self rule
+                     _lhsOcopy =
+                         ({-# LINE 23 "./Patterns.ag" #-}
+                          _copy
+                          {-# LINE 5765 "Transform.hs" #-}
+                          )
+                 in  ( _lhsOcopy,_lhsOdefinedAttrs,_lhsOdefinedInsts,_lhsOpatunder)) )
+-- SemAlt ------------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
+         allFields            : DataTypes
+         nts                  : Set NontermIdent
+         options              : Options
+      synthesized attributes:
+         attrOrderCollect     : AttrOrderMap
+         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
+         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
+         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
+         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
+         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
+         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
+         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
+         errors               : Seq Error
+         semPragmasCollect    : PragmaMap
+   alternatives:
+      alternative SemAlt:
+         child pos            : {Pos}
+         child constructorSet : ConstructorSet 
+         child rules          : SemDefs 
+         visit 0:
+            local pragmaNames : _
+            local attrOrders  : _
+            local coninfo     : _
+-}
+-- cata
+sem_SemAlt :: SemAlt  ->
+              T_SemAlt 
+sem_SemAlt (SemAlt _pos _constructorSet _rules )  =
+    (sem_SemAlt_SemAlt _pos (sem_ConstructorSet _constructorSet ) (sem_SemDefs _rules ) )
+-- semantic domain
+newtype T_SemAlt  = T_SemAlt ((Map NontermIdent (Attributes, Attributes)) ->
+                              DataTypes ->
+                              (Set NontermIdent) ->
+                              Options ->
+                              ( AttrOrderMap,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),([ (NontermIdent, ConstructorIdent, RuleInfo)]),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),(Seq Error),PragmaMap))
+data Inh_SemAlt  = Inh_SemAlt {allAttrDecls_Inh_SemAlt :: !((Map NontermIdent (Attributes, Attributes))),allFields_Inh_SemAlt :: !(DataTypes),nts_Inh_SemAlt :: !((Set NontermIdent)),options_Inh_SemAlt :: !(Options)}
+data Syn_SemAlt  = Syn_SemAlt {attrOrderCollect_Syn_SemAlt :: !(AttrOrderMap),collectedArounds_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedInsts_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedRules_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSigs_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_SemAlt :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),errors_Syn_SemAlt :: !((Seq Error)),semPragmasCollect_Syn_SemAlt :: !(PragmaMap)}
+wrap_SemAlt :: T_SemAlt  ->
+               Inh_SemAlt  ->
+               Syn_SemAlt 
+wrap_SemAlt (T_SemAlt sem ) (Inh_SemAlt _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions )  =
+    (let ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect) = sem _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions 
+     in  (Syn_SemAlt _lhsOattrOrderCollect _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedRules _lhsOcollectedSigs _lhsOcollectedUniques _lhsOerrors _lhsOsemPragmasCollect ))
+sem_SemAlt_SemAlt :: Pos ->
+                     T_ConstructorSet  ->
+                     T_SemDefs  ->
+                     T_SemAlt 
+sem_SemAlt_SemAlt pos_ (T_ConstructorSet constructorSet_ ) (T_SemDefs rules_ )  =
+    (T_SemAlt (\ _lhsIallAttrDecls
+                 _lhsIallFields
+                 _lhsInts
+                 _lhsIoptions ->
+                   (let _lhsOsemPragmasCollect :: PragmaMap
+                        _lhsOattrOrderCollect :: AttrOrderMap
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                        _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                        _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                        _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                        _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                        _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                        _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                        _rulesOoptions :: Options
+                        _constructorSetIcollectedConstructorNames :: (Set ConstructorIdent)
+                        _constructorSetIconstructors :: ((Set ConstructorIdent->Set ConstructorIdent))
+                        _constructorSetIerrors :: (Seq Error)
+                        _rulesIaroundInfos :: ([AroundInfo])
+                        _rulesIaugmentInfos :: ([AugmentInfo])
+                        _rulesIdefinedInsts :: ([Identifier])
+                        _rulesIerrors :: (Seq Error)
+                        _rulesImergeInfos :: ([MergeInfo])
+                        _rulesIorderDepsCollect :: (Set Dependency)
+                        _rulesIpragmaNamesCollect :: ([Identifier])
+                        _rulesIruleInfos :: ([RuleInfo])
+                        _rulesIsigInfos :: ([SigInfo])
+                        _rulesIuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 800, column 7)
+                        _pragmaNames =
+                            ({-# LINE 800 "Transform.ag" #-}
+                             Set.fromList _rulesIpragmaNamesCollect
+                             {-# LINE 5853 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 801, column 7)
+                        _lhsOsemPragmasCollect =
+                            ({-# LINE 801 "Transform.ag" #-}
+                             foldr pragmaMapUnion Map.empty [ pragmaMapSingle nt con _pragmaNames
+                                                            | (nt, conset, _) <- _coninfo
+                                                            , con <- Set.toList conset
+                                                            ]
+                             {-# LINE 5862 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 829, column 7)
+                        _attrOrders =
+                            ({-# LINE 829 "Transform.ag" #-}
+                             [ orderMapSingle nt con _rulesIorderDepsCollect
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5871 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 835, column 7)
+                        _lhsOattrOrderCollect =
+                            ({-# LINE 835 "Transform.ag" #-}
+                             foldr orderMapUnion Map.empty _attrOrders
+                             {-# LINE 5877 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1012, column 12)
+                        _coninfo =
+                            ({-# LINE 1012 "Transform.ag" #-}
+                             [ (nt, conset, conkeys)
+                             | nt  <- Set.toList _lhsInts
+                             , let conmap = Map.findWithDefault Map.empty nt _lhsIallFields
+                             , let conkeys = Set.fromList (Map.keys conmap)
+                             , let conset  = _constructorSetIconstructors conkeys
+                             ]
+                             {-# LINE 5888 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1019, column 12)
+                        _lhsOerrors =
+                            ({-# LINE 1019 "Transform.ag" #-}
+                             Seq.fromList
+                                [ UndefAlt nt con
+                                | (nt, conset, conkeys) <- _coninfo
+                                , con <- Set.toList (Set.difference conset conkeys)
+                                ]
+                             Seq.>< _rulesIerrors
+                             {-# LINE 5899 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1025, column 12)
+                        _lhsOcollectedRules =
+                            ({-# LINE 1025 "Transform.ag" #-}
+                             [ (nt,con,r)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             , r <- _rulesIruleInfos
+                             ]
+                             {-# LINE 5909 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1031, column 12)
+                        _lhsOcollectedSigs =
+                            ({-# LINE 1031 "Transform.ag" #-}
+                             [ (nt,con,ts)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             , ts <- _rulesIsigInfos
+                             ]
+                             {-# LINE 5919 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1038, column 12)
+                        _lhsOcollectedInsts =
+                            ({-# LINE 1038 "Transform.ag" #-}
+                             [ (nt,con,_rulesIdefinedInsts)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5928 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1044, column 12)
+                        _lhsOcollectedUniques =
+                            ({-# LINE 1044 "Transform.ag" #-}
+                             [ (nt,con,_rulesIuniqueInfos)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5937 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1050, column 12)
+                        _lhsOcollectedAugments =
+                            ({-# LINE 1050 "Transform.ag" #-}
+                             [ (nt, con, _rulesIaugmentInfos)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5946 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1056, column 12)
+                        _lhsOcollectedArounds =
+                            ({-# LINE 1056 "Transform.ag" #-}
+                             [ (nt, con, _rulesIaroundInfos)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5955 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1062, column 12)
+                        _lhsOcollectedMerges =
+                            ({-# LINE 1062 "Transform.ag" #-}
+                             [ (nt, con, _rulesImergeInfos)
+                             | (nt, conset, _) <- _coninfo
+                             , con <- Set.toList conset
+                             ]
+                             {-# LINE 5964 "Transform.hs" #-}
+                             )
+                        -- copy rule (down)
+                        _rulesOoptions =
+                            ({-# LINE 39 "Transform.ag" #-}
+                             _lhsIoptions
+                             {-# LINE 5970 "Transform.hs" #-}
+                             )
+                        ( _constructorSetIcollectedConstructorNames,_constructorSetIconstructors,_constructorSetIerrors) =
+                            constructorSet_ 
+                        ( _rulesIaroundInfos,_rulesIaugmentInfos,_rulesIdefinedInsts,_rulesIerrors,_rulesImergeInfos,_rulesIorderDepsCollect,_rulesIpragmaNamesCollect,_rulesIruleInfos,_rulesIsigInfos,_rulesIuniqueInfos) =
+                            rules_ _rulesOoptions 
+                    in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
+-- SemAlts -----------------------------------------------------
+{-
+   visit 0:
+      inherited attributes:
+         allAttrDecls         : Map NontermIdent (Attributes, Attributes)
+         allFields            : DataTypes
+         nts                  : Set NontermIdent
+         options              : Options
+      synthesized attributes:
+         attrOrderCollect     : AttrOrderMap
+         collectedArounds     : [ (NontermIdent, ConstructorIdent, [AroundInfo])  ]
+         collectedAugments    : [ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]
+         collectedInsts       : [ (NontermIdent, ConstructorIdent, [Identifier]) ]
+         collectedMerges      : [ (NontermIdent, ConstructorIdent, [MergeInfo])   ]
+         collectedRules       : [ (NontermIdent, ConstructorIdent, RuleInfo)]
+         collectedSigs        : [ (NontermIdent, ConstructorIdent, SigInfo) ]
+         collectedUniques     : [ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]
+         errors               : Seq Error
+         semPragmasCollect    : PragmaMap
+   alternatives:
+      alternative Cons:
+         child hd             : SemAlt 
+         child tl             : SemAlts 
+      alternative Nil:
+-}
+-- cata
+sem_SemAlts :: SemAlts  ->
+               T_SemAlts 
+sem_SemAlts list  =
+    (Prelude.foldr sem_SemAlts_Cons sem_SemAlts_Nil (Prelude.map sem_SemAlt list) )
+-- semantic domain
+newtype T_SemAlts  = T_SemAlts ((Map NontermIdent (Attributes, Attributes)) ->
+                                DataTypes ->
+                                (Set NontermIdent) ->
+                                Options ->
+                                ( AttrOrderMap,([ (NontermIdent, ConstructorIdent, [AroundInfo])  ]),([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ]),([ (NontermIdent, ConstructorIdent, [Identifier]) ]),([ (NontermIdent, ConstructorIdent, [MergeInfo])   ]),([ (NontermIdent, ConstructorIdent, RuleInfo)]),([ (NontermIdent, ConstructorIdent, SigInfo) ]),([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ]),(Seq Error),PragmaMap))
+data Inh_SemAlts  = Inh_SemAlts {allAttrDecls_Inh_SemAlts :: !((Map NontermIdent (Attributes, Attributes))),allFields_Inh_SemAlts :: !(DataTypes),nts_Inh_SemAlts :: !((Set NontermIdent)),options_Inh_SemAlts :: !(Options)}
+data Syn_SemAlts  = Syn_SemAlts {attrOrderCollect_Syn_SemAlts :: !(AttrOrderMap),collectedArounds_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])),collectedAugments_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])),collectedInsts_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [Identifier]) ])),collectedMerges_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])),collectedRules_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, RuleInfo)])),collectedSigs_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, SigInfo) ])),collectedUniques_Syn_SemAlts :: !(([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])),errors_Syn_SemAlts :: !((Seq Error)),semPragmasCollect_Syn_SemAlts :: !(PragmaMap)}
+wrap_SemAlts :: T_SemAlts  ->
+                Inh_SemAlts  ->
+                Syn_SemAlts 
+wrap_SemAlts (T_SemAlts sem ) (Inh_SemAlts _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions )  =
+    (let ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect) = sem _lhsIallAttrDecls _lhsIallFields _lhsInts _lhsIoptions 
+     in  (Syn_SemAlts _lhsOattrOrderCollect _lhsOcollectedArounds _lhsOcollectedAugments _lhsOcollectedInsts _lhsOcollectedMerges _lhsOcollectedRules _lhsOcollectedSigs _lhsOcollectedUniques _lhsOerrors _lhsOsemPragmasCollect ))
+sem_SemAlts_Cons :: T_SemAlt  ->
+                    T_SemAlts  ->
+                    T_SemAlts 
+sem_SemAlts_Cons (T_SemAlt hd_ ) (T_SemAlts tl_ )  =
+    (T_SemAlts (\ _lhsIallAttrDecls
+                  _lhsIallFields
+                  _lhsInts
+                  _lhsIoptions ->
+                    (let _lhsOattrOrderCollect :: AttrOrderMap
+                         _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                         _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                         _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                         _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                         _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                         _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                         _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOsemPragmasCollect :: PragmaMap
+                         _hdOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                         _hdOallFields :: DataTypes
+                         _hdOnts :: (Set NontermIdent)
+                         _hdOoptions :: Options
+                         _tlOallAttrDecls :: (Map NontermIdent (Attributes, Attributes))
+                         _tlOallFields :: DataTypes
+                         _tlOnts :: (Set NontermIdent)
+                         _tlOoptions :: Options
+                         _hdIattrOrderCollect :: AttrOrderMap
+                         _hdIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                         _hdIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                         _hdIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                         _hdIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                         _hdIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                         _hdIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                         _hdIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                         _hdIerrors :: (Seq Error)
+                         _hdIsemPragmasCollect :: PragmaMap
+                         _tlIattrOrderCollect :: AttrOrderMap
+                         _tlIcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                         _tlIcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                         _tlIcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                         _tlIcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                         _tlIcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                         _tlIcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                         _tlIcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                         _tlIerrors :: (Seq Error)
+                         _tlIsemPragmasCollect :: PragmaMap
+                         -- use rule "Transform.ag"(line 824, column 55)
+                         _lhsOattrOrderCollect =
+                             ({-# LINE 824 "Transform.ag" #-}
+                              _hdIattrOrderCollect `orderMapUnion` _tlIattrOrderCollect
+                              {-# LINE 6071 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 157, column 32)
+                         _lhsOcollectedArounds =
+                             ({-# LINE 157 "Transform.ag" #-}
+                              _hdIcollectedArounds ++ _tlIcollectedArounds
+                              {-# LINE 6077 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 156, column 32)
+                         _lhsOcollectedAugments =
+                             ({-# LINE 156 "Transform.ag" #-}
+                              _hdIcollectedAugments ++ _tlIcollectedAugments
+                              {-# LINE 6083 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 154, column 32)
+                         _lhsOcollectedInsts =
+                             ({-# LINE 154 "Transform.ag" #-}
+                              _hdIcollectedInsts ++ _tlIcollectedInsts
+                              {-# LINE 6089 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 158, column 32)
+                         _lhsOcollectedMerges =
+                             ({-# LINE 158 "Transform.ag" #-}
+                              _hdIcollectedMerges ++ _tlIcollectedMerges
+                              {-# LINE 6095 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 152, column 32)
+                         _lhsOcollectedRules =
+                             ({-# LINE 152 "Transform.ag" #-}
+                              _hdIcollectedRules ++ _tlIcollectedRules
+                              {-# LINE 6101 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 153, column 32)
+                         _lhsOcollectedSigs =
+                             ({-# LINE 153 "Transform.ag" #-}
+                              _hdIcollectedSigs ++ _tlIcollectedSigs
+                              {-# LINE 6107 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 155, column 32)
+                         _lhsOcollectedUniques =
+                             ({-# LINE 155 "Transform.ag" #-}
+                              _hdIcollectedUniques ++ _tlIcollectedUniques
+                              {-# LINE 6113 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _hdIerrors Seq.>< _tlIerrors
+                              {-# LINE 6119 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 796, column 56)
+                         _lhsOsemPragmasCollect =
+                             ({-# LINE 796 "Transform.ag" #-}
+                              _hdIsemPragmasCollect `pragmaMapUnion` _tlIsemPragmasCollect
+                              {-# LINE 6125 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _hdOallAttrDecls =
+                             ({-# LINE 825 "Transform.ag" #-}
+                              _lhsIallAttrDecls
+                              {-# LINE 6131 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _hdOallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 6137 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _hdOnts =
+                             ({-# LINE 168 "Transform.ag" #-}
+                              _lhsInts
+                              {-# LINE 6143 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _hdOoptions =
+                             ({-# LINE 39 "Transform.ag" #-}
+                              _lhsIoptions
+                              {-# LINE 6149 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _tlOallAttrDecls =
+                             ({-# LINE 825 "Transform.ag" #-}
+                              _lhsIallAttrDecls
+                              {-# LINE 6155 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _tlOallFields =
+                             ({-# LINE 129 "Transform.ag" #-}
+                              _lhsIallFields
+                              {-# LINE 6161 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _tlOnts =
+                             ({-# LINE 168 "Transform.ag" #-}
+                              _lhsInts
+                              {-# LINE 6167 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _tlOoptions =
+                             ({-# LINE 39 "Transform.ag" #-}
+                              _lhsIoptions
+                              {-# LINE 6173 "Transform.hs" #-}
+                              )
+                         ( _hdIattrOrderCollect,_hdIcollectedArounds,_hdIcollectedAugments,_hdIcollectedInsts,_hdIcollectedMerges,_hdIcollectedRules,_hdIcollectedSigs,_hdIcollectedUniques,_hdIerrors,_hdIsemPragmasCollect) =
+                             hd_ _hdOallAttrDecls _hdOallFields _hdOnts _hdOoptions 
+                         ( _tlIattrOrderCollect,_tlIcollectedArounds,_tlIcollectedAugments,_tlIcollectedInsts,_tlIcollectedMerges,_tlIcollectedRules,_tlIcollectedSigs,_tlIcollectedUniques,_tlIerrors,_tlIsemPragmasCollect) =
+                             tl_ _tlOallAttrDecls _tlOallFields _tlOnts _tlOoptions 
+                     in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
+sem_SemAlts_Nil :: T_SemAlts 
+sem_SemAlts_Nil  =
+    (T_SemAlts (\ _lhsIallAttrDecls
+                  _lhsIallFields
+                  _lhsInts
+                  _lhsIoptions ->
+                    (let _lhsOattrOrderCollect :: AttrOrderMap
+                         _lhsOcollectedArounds :: ([ (NontermIdent, ConstructorIdent, [AroundInfo])  ])
+                         _lhsOcollectedAugments :: ([ (NontermIdent, ConstructorIdent, [AugmentInfo]) ])
+                         _lhsOcollectedInsts :: ([ (NontermIdent, ConstructorIdent, [Identifier]) ])
+                         _lhsOcollectedMerges :: ([ (NontermIdent, ConstructorIdent, [MergeInfo])   ])
+                         _lhsOcollectedRules :: ([ (NontermIdent, ConstructorIdent, RuleInfo)])
+                         _lhsOcollectedSigs :: ([ (NontermIdent, ConstructorIdent, SigInfo) ])
+                         _lhsOcollectedUniques :: ([ (NontermIdent, ConstructorIdent, [UniqueInfo]) ])
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOsemPragmasCollect :: PragmaMap
+                         -- use rule "Transform.ag"(line 824, column 55)
+                         _lhsOattrOrderCollect =
+                             ({-# LINE 824 "Transform.ag" #-}
+                              Map.empty
+                              {-# LINE 6200 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 157, column 32)
+                         _lhsOcollectedArounds =
+                             ({-# LINE 157 "Transform.ag" #-}
+                              []
+                              {-# LINE 6206 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 156, column 32)
+                         _lhsOcollectedAugments =
+                             ({-# LINE 156 "Transform.ag" #-}
+                              []
+                              {-# LINE 6212 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 154, column 32)
+                         _lhsOcollectedInsts =
+                             ({-# LINE 154 "Transform.ag" #-}
+                              []
+                              {-# LINE 6218 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 158, column 32)
+                         _lhsOcollectedMerges =
+                             ({-# LINE 158 "Transform.ag" #-}
+                              []
+                              {-# LINE 6224 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 152, column 32)
+                         _lhsOcollectedRules =
+                             ({-# LINE 152 "Transform.ag" #-}
+                              []
+                              {-# LINE 6230 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 153, column 32)
+                         _lhsOcollectedSigs =
+                             ({-# LINE 153 "Transform.ag" #-}
+                              []
+                              {-# LINE 6236 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 155, column 32)
+                         _lhsOcollectedUniques =
+                             ({-# LINE 155 "Transform.ag" #-}
+                              []
+                              {-# LINE 6242 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              Seq.empty
+                              {-# LINE 6248 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 796, column 56)
+                         _lhsOsemPragmasCollect =
+                             ({-# LINE 796 "Transform.ag" #-}
+                              Map.empty
+                              {-# LINE 6254 "Transform.hs" #-}
+                              )
+                     in  ( _lhsOattrOrderCollect,_lhsOcollectedArounds,_lhsOcollectedAugments,_lhsOcollectedInsts,_lhsOcollectedMerges,_lhsOcollectedRules,_lhsOcollectedSigs,_lhsOcollectedUniques,_lhsOerrors,_lhsOsemPragmasCollect))) )
+-- SemDef ------------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         options              : Options
+      synthesized attributes:
+         aroundInfos          : [AroundInfo]
+         augmentInfos         : [AugmentInfo]
+         definedInsts         : [Identifier]
+         errors               : Seq Error
+         mergeInfos           : [MergeInfo]
+         orderDepsCollect     : Set Dependency
+         pragmaNamesCollect   : [Identifier]
+         ruleInfos            : [RuleInfo]
+         sigInfos             : [SigInfo]
+         uniqueInfos          : [UniqueInfo]
+   alternatives:
+      alternative AroundDef:
+         child ident          : {Identifier}
+         child rhs            : {Expression}
+      alternative AttrOrderBefore:
+         child before         : {[Occurrence]}
+         child after          : {[Occurrence]}
+         visit 0:
+            local dependency  : _
+      alternative AugmentDef:
+         child ident          : {Identifier}
+         child rhs            : {Expression}
+      alternative Def:
+         child pos            : {Pos}
+         child mbName         : {Maybe Identifier}
+         child pattern        : Pattern 
+         child rhs            : {Expression}
+         child owrt           : {Bool}
+      alternative MergeDef:
+         child target         : {Identifier}
+         child nt             : {Identifier}
+         child sources        : {[Identifier]}
+         child rhs            : {Expression}
+      alternative SemPragma:
+         child names          : {[NontermIdent]}
+      alternative TypeDef:
+         child pos            : {Pos}
+         child ident          : {Identifier}
+         child tp             : {Type}
+      alternative UniqueDef:
+         child ident          : {Identifier}
+         child ref            : {Identifier}
+-}
+-- cata
+sem_SemDef :: SemDef  ->
+              T_SemDef 
+sem_SemDef (AroundDef _ident _rhs )  =
+    (sem_SemDef_AroundDef _ident _rhs )
+sem_SemDef (AttrOrderBefore _before _after )  =
+    (sem_SemDef_AttrOrderBefore _before _after )
+sem_SemDef (AugmentDef _ident _rhs )  =
+    (sem_SemDef_AugmentDef _ident _rhs )
+sem_SemDef (Def _pos _mbName _pattern _rhs _owrt )  =
+    (sem_SemDef_Def _pos _mbName (sem_Pattern _pattern ) _rhs _owrt )
+sem_SemDef (MergeDef _target _nt _sources _rhs )  =
+    (sem_SemDef_MergeDef _target _nt _sources _rhs )
+sem_SemDef (SemPragma _names )  =
+    (sem_SemDef_SemPragma _names )
+sem_SemDef (TypeDef _pos _ident _tp )  =
+    (sem_SemDef_TypeDef _pos _ident _tp )
+sem_SemDef (UniqueDef _ident _ref )  =
+    (sem_SemDef_UniqueDef _ident _ref )
+-- semantic domain
+newtype T_SemDef  = T_SemDef (Options ->
+                              ( ([AroundInfo]),([AugmentInfo]),([Identifier]),(Seq Error),([MergeInfo]),(Set Dependency),([Identifier]),([RuleInfo]),([SigInfo]),([UniqueInfo])))
+data Inh_SemDef  = Inh_SemDef {options_Inh_SemDef :: !(Options)}
+data Syn_SemDef  = Syn_SemDef {aroundInfos_Syn_SemDef :: !(([AroundInfo])),augmentInfos_Syn_SemDef :: !(([AugmentInfo])),definedInsts_Syn_SemDef :: !(([Identifier])),errors_Syn_SemDef :: !((Seq Error)),mergeInfos_Syn_SemDef :: !(([MergeInfo])),orderDepsCollect_Syn_SemDef :: !((Set Dependency)),pragmaNamesCollect_Syn_SemDef :: !(([Identifier])),ruleInfos_Syn_SemDef :: !(([RuleInfo])),sigInfos_Syn_SemDef :: !(([SigInfo])),uniqueInfos_Syn_SemDef :: !(([UniqueInfo]))}
+wrap_SemDef :: T_SemDef  ->
+               Inh_SemDef  ->
+               Syn_SemDef 
+wrap_SemDef (T_SemDef sem ) (Inh_SemDef _lhsIoptions )  =
+    (let ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos) = sem _lhsIoptions 
+     in  (Syn_SemDef _lhsOaroundInfos _lhsOaugmentInfos _lhsOdefinedInsts _lhsOerrors _lhsOmergeInfos _lhsOorderDepsCollect _lhsOpragmaNamesCollect _lhsOruleInfos _lhsOsigInfos _lhsOuniqueInfos ))
+sem_SemDef_AroundDef :: Identifier ->
+                        Expression ->
+                        T_SemDef 
+sem_SemDef_AroundDef ident_ rhs_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 1081, column 17)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1081 "Transform.ag" #-}
+                             [ (ident_, rhs_) ]
+                             {-# LINE 6355 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6361 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6367 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 43, column 19)
+                        _lhsOerrors =
+                            ({-# LINE 43 "Transform.ag" #-}
+                             Seq.empty
+                             {-# LINE 6373 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6379 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6385 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6391 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6397 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6403 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6409 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_AttrOrderBefore :: ([Occurrence]) ->
+                              ([Occurrence]) ->
+                              T_SemDef 
+sem_SemDef_AttrOrderBefore before_ after_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 841, column 7)
+                        _dependency =
+                            ({-# LINE 841 "Transform.ag" #-}
+                             [ Dependency b a | b <- before_, a <- after_ ]
+                             {-# LINE 6431 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 842, column 7)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 842 "Transform.ag" #-}
+                             Set.fromList _dependency
+                             {-# LINE 6437 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6443 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6449 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6455 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 43, column 19)
+                        _lhsOerrors =
+                            ({-# LINE 43 "Transform.ag" #-}
+                             Seq.empty
+                             {-# LINE 6461 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6467 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6473 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6479 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6485 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6491 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_AugmentDef :: Identifier ->
+                         Expression ->
+                         T_SemDef 
+sem_SemDef_AugmentDef ident_ rhs_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 1078, column 17)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1078 "Transform.ag" #-}
+                             [ (ident_, rhs_) ]
+                             {-# LINE 6513 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6519 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6525 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 43, column 19)
+                        _lhsOerrors =
+                            ({-# LINE 43 "Transform.ag" #-}
+                             Seq.empty
+                             {-# LINE 6531 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6537 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6543 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6549 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6555 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6561 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6567 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_Def :: Pos ->
+                  (Maybe Identifier) ->
+                  T_Pattern  ->
+                  Expression ->
+                  Bool ->
+                  T_SemDef 
+sem_SemDef_Def pos_ mbName_ (T_Pattern pattern_ ) rhs_ owrt_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOerrors :: (Seq Error)
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        _patternIcopy :: Pattern 
+                        _patternIdefinedAttrs :: ([AttrName])
+                        _patternIdefinedInsts :: ([Identifier])
+                        _patternIpatunder :: ([AttrName]->Pattern)
+                        _patternIstpos :: Pos
+                        -- "Transform.ag"(line 528, column 3)
+                        _lhsOerrors =
+                            ({-# LINE 528 "Transform.ag" #-}
+                             if checkParseRhs _lhsIoptions
+                             then Seq.fromList $ checkRhs rhs_
+                             else Seq.empty
+                             {-# LINE 6599 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1069, column 10)
+                        _lhsOruleInfos =
+                            ({-# LINE 1069 "Transform.ag" #-}
+                             [ (mbName_, _patternIpatunder, rhs_, _patternIdefinedAttrs, owrt_, show _patternIstpos) ]
+                             {-# LINE 6605 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6611 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6617 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             _patternIdefinedInsts
+                             {-# LINE 6623 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6629 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6635 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6641 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6647 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6653 "Transform.hs" #-}
+                             )
+                        ( _patternIcopy,_patternIdefinedAttrs,_patternIdefinedInsts,_patternIpatunder,_patternIstpos) =
+                            pattern_ 
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_MergeDef :: Identifier ->
+                       Identifier ->
+                       ([Identifier]) ->
+                       Expression ->
+                       T_SemDef 
+sem_SemDef_MergeDef target_ nt_ sources_ rhs_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 528, column 3)
+                        _lhsOerrors =
+                            ({-# LINE 528 "Transform.ag" #-}
+                             if checkParseRhs _lhsIoptions
+                             then Seq.fromList $ checkRhs rhs_
+                             else Seq.empty
+                             {-# LINE 6681 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1084, column 17)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1084 "Transform.ag" #-}
+                             [ (target_, nt_, sources_, rhs_) ]
+                             {-# LINE 6687 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6693 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6699 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6705 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6711 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6717 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6723 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6729 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6735 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_SemPragma :: ([NontermIdent]) ->
+                        T_SemDef 
+sem_SemDef_SemPragma names_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 810, column 7)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 810 "Transform.ag" #-}
+                             names_
+                             {-# LINE 6756 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6762 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6768 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6774 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 43, column 19)
+                        _lhsOerrors =
+                            ({-# LINE 43 "Transform.ag" #-}
+                             Seq.empty
+                             {-# LINE 6780 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6786 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6792 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6798 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6804 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6810 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_TypeDef :: Pos ->
+                      Identifier ->
+                      Type ->
+                      T_SemDef 
+sem_SemDef_TypeDef pos_ ident_ tp_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOerrors :: (Seq Error)
+                        _lhsOsigInfos :: ([SigInfo])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOuniqueInfos :: ([UniqueInfo])
+                        -- "Transform.ag"(line 535, column 3)
+                        _lhsOerrors =
+                            ({-# LINE 535 "Transform.ag" #-}
+                             if checkParseTy _lhsIoptions
+                             then case tp_ of
+                                    Haskell s -> let exp = Expression pos_ tks
+                                                     tks = [tk]
+                                                     tk  = HsToken s pos_
+                                                 in Seq.fromList $ checkTy exp
+                                    _ -> Seq.empty
+                             else Seq.empty
+                             {-# LINE 6840 "Transform.hs" #-}
+                             )
+                        -- "Transform.ag"(line 1072, column 14)
+                        _lhsOsigInfos =
+                            ({-# LINE 1072 "Transform.ag" #-}
+                             [ (ident_, tp_) ]
+                             {-# LINE 6846 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6852 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6858 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6864 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6870 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6876 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6882 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6888 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1004, column 40)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1004 "Transform.ag" #-}
+                             []
+                             {-# LINE 6894 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDef_UniqueDef :: Identifier ->
+                        Identifier ->
+                        T_SemDef 
+sem_SemDef_UniqueDef ident_ ref_  =
+    (T_SemDef (\ _lhsIoptions ->
+                   (let _lhsOuniqueInfos :: ([UniqueInfo])
+                        _lhsOaroundInfos :: ([AroundInfo])
+                        _lhsOaugmentInfos :: ([AugmentInfo])
+                        _lhsOdefinedInsts :: ([Identifier])
+                        _lhsOerrors :: (Seq Error)
+                        _lhsOmergeInfos :: ([MergeInfo])
+                        _lhsOorderDepsCollect :: (Set Dependency)
+                        _lhsOpragmaNamesCollect :: ([Identifier])
+                        _lhsOruleInfos :: ([RuleInfo])
+                        _lhsOsigInfos :: ([SigInfo])
+                        -- "Transform.ag"(line 1075, column 16)
+                        _lhsOuniqueInfos =
+                            ({-# LINE 1075 "Transform.ag" #-}
+                             [ (ident_, ref_) ]
+                             {-# LINE 6916 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1006, column 40)
+                        _lhsOaroundInfos =
+                            ({-# LINE 1006 "Transform.ag" #-}
+                             []
+                             {-# LINE 6922 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1005, column 40)
+                        _lhsOaugmentInfos =
+                            ({-# LINE 1005 "Transform.ag" #-}
+                             []
+                             {-# LINE 6928 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1087, column 55)
+                        _lhsOdefinedInsts =
+                            ({-# LINE 1087 "Transform.ag" #-}
+                             []
+                             {-# LINE 6934 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 43, column 19)
+                        _lhsOerrors =
+                            ({-# LINE 43 "Transform.ag" #-}
+                             Seq.empty
+                             {-# LINE 6940 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1007, column 40)
+                        _lhsOmergeInfos =
+                            ({-# LINE 1007 "Transform.ag" #-}
+                             []
+                             {-# LINE 6946 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 837, column 44)
+                        _lhsOorderDepsCollect =
+                            ({-# LINE 837 "Transform.ag" #-}
+                             Set.empty
+                             {-# LINE 6952 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 806, column 46)
+                        _lhsOpragmaNamesCollect =
+                            ({-# LINE 806 "Transform.ag" #-}
+                             []
+                             {-# LINE 6958 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1002, column 40)
+                        _lhsOruleInfos =
+                            ({-# LINE 1002 "Transform.ag" #-}
+                             []
+                             {-# LINE 6964 "Transform.hs" #-}
+                             )
+                        -- use rule "Transform.ag"(line 1003, column 40)
+                        _lhsOsigInfos =
+                            ({-# LINE 1003 "Transform.ag" #-}
+                             []
+                             {-# LINE 6970 "Transform.hs" #-}
+                             )
+                    in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+-- SemDefs -----------------------------------------------------
+{-
+   visit 0:
+      inherited attribute:
+         options              : Options
+      synthesized attributes:
+         aroundInfos          : [AroundInfo]
+         augmentInfos         : [AugmentInfo]
+         definedInsts         : [Identifier]
+         errors               : Seq Error
+         mergeInfos           : [MergeInfo]
+         orderDepsCollect     : Set Dependency
+         pragmaNamesCollect   : [Identifier]
+         ruleInfos            : [RuleInfo]
+         sigInfos             : [SigInfo]
+         uniqueInfos          : [UniqueInfo]
+   alternatives:
+      alternative Cons:
+         child hd             : SemDef 
+         child tl             : SemDefs 
+      alternative Nil:
+-}
+-- cata
+sem_SemDefs :: SemDefs  ->
+               T_SemDefs 
+sem_SemDefs list  =
+    (Prelude.foldr sem_SemDefs_Cons sem_SemDefs_Nil (Prelude.map sem_SemDef list) )
+-- semantic domain
+newtype T_SemDefs  = T_SemDefs (Options ->
+                                ( ([AroundInfo]),([AugmentInfo]),([Identifier]),(Seq Error),([MergeInfo]),(Set Dependency),([Identifier]),([RuleInfo]),([SigInfo]),([UniqueInfo])))
+data Inh_SemDefs  = Inh_SemDefs {options_Inh_SemDefs :: !(Options)}
+data Syn_SemDefs  = Syn_SemDefs {aroundInfos_Syn_SemDefs :: !(([AroundInfo])),augmentInfos_Syn_SemDefs :: !(([AugmentInfo])),definedInsts_Syn_SemDefs :: !(([Identifier])),errors_Syn_SemDefs :: !((Seq Error)),mergeInfos_Syn_SemDefs :: !(([MergeInfo])),orderDepsCollect_Syn_SemDefs :: !((Set Dependency)),pragmaNamesCollect_Syn_SemDefs :: !(([Identifier])),ruleInfos_Syn_SemDefs :: !(([RuleInfo])),sigInfos_Syn_SemDefs :: !(([SigInfo])),uniqueInfos_Syn_SemDefs :: !(([UniqueInfo]))}
+wrap_SemDefs :: T_SemDefs  ->
+                Inh_SemDefs  ->
+                Syn_SemDefs 
+wrap_SemDefs (T_SemDefs sem ) (Inh_SemDefs _lhsIoptions )  =
+    (let ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos) = sem _lhsIoptions 
+     in  (Syn_SemDefs _lhsOaroundInfos _lhsOaugmentInfos _lhsOdefinedInsts _lhsOerrors _lhsOmergeInfos _lhsOorderDepsCollect _lhsOpragmaNamesCollect _lhsOruleInfos _lhsOsigInfos _lhsOuniqueInfos ))
+sem_SemDefs_Cons :: T_SemDef  ->
+                    T_SemDefs  ->
+                    T_SemDefs 
+sem_SemDefs_Cons (T_SemDef hd_ ) (T_SemDefs tl_ )  =
+    (T_SemDefs (\ _lhsIoptions ->
+                    (let _lhsOaroundInfos :: ([AroundInfo])
+                         _lhsOaugmentInfos :: ([AugmentInfo])
+                         _lhsOdefinedInsts :: ([Identifier])
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOmergeInfos :: ([MergeInfo])
+                         _lhsOorderDepsCollect :: (Set Dependency)
+                         _lhsOpragmaNamesCollect :: ([Identifier])
+                         _lhsOruleInfos :: ([RuleInfo])
+                         _lhsOsigInfos :: ([SigInfo])
+                         _lhsOuniqueInfos :: ([UniqueInfo])
+                         _hdOoptions :: Options
+                         _tlOoptions :: Options
+                         _hdIaroundInfos :: ([AroundInfo])
+                         _hdIaugmentInfos :: ([AugmentInfo])
+                         _hdIdefinedInsts :: ([Identifier])
+                         _hdIerrors :: (Seq Error)
+                         _hdImergeInfos :: ([MergeInfo])
+                         _hdIorderDepsCollect :: (Set Dependency)
+                         _hdIpragmaNamesCollect :: ([Identifier])
+                         _hdIruleInfos :: ([RuleInfo])
+                         _hdIsigInfos :: ([SigInfo])
+                         _hdIuniqueInfos :: ([UniqueInfo])
+                         _tlIaroundInfos :: ([AroundInfo])
+                         _tlIaugmentInfos :: ([AugmentInfo])
+                         _tlIdefinedInsts :: ([Identifier])
+                         _tlIerrors :: (Seq Error)
+                         _tlImergeInfos :: ([MergeInfo])
+                         _tlIorderDepsCollect :: (Set Dependency)
+                         _tlIpragmaNamesCollect :: ([Identifier])
+                         _tlIruleInfos :: ([RuleInfo])
+                         _tlIsigInfos :: ([SigInfo])
+                         _tlIuniqueInfos :: ([UniqueInfo])
+                         -- use rule "Transform.ag"(line 1006, column 40)
+                         _lhsOaroundInfos =
+                             ({-# LINE 1006 "Transform.ag" #-}
+                              _hdIaroundInfos ++ _tlIaroundInfos
+                              {-# LINE 7052 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1005, column 40)
+                         _lhsOaugmentInfos =
+                             ({-# LINE 1005 "Transform.ag" #-}
+                              _hdIaugmentInfos ++ _tlIaugmentInfos
+                              {-# LINE 7058 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1087, column 55)
+                         _lhsOdefinedInsts =
+                             ({-# LINE 1087 "Transform.ag" #-}
+                              _hdIdefinedInsts ++ _tlIdefinedInsts
+                              {-# LINE 7064 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              _hdIerrors Seq.>< _tlIerrors
+                              {-# LINE 7070 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1007, column 40)
+                         _lhsOmergeInfos =
+                             ({-# LINE 1007 "Transform.ag" #-}
+                              _hdImergeInfos ++ _tlImergeInfos
+                              {-# LINE 7076 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 837, column 44)
+                         _lhsOorderDepsCollect =
+                             ({-# LINE 837 "Transform.ag" #-}
+                              _hdIorderDepsCollect `Set.union` _tlIorderDepsCollect
+                              {-# LINE 7082 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 806, column 46)
+                         _lhsOpragmaNamesCollect =
+                             ({-# LINE 806 "Transform.ag" #-}
+                              _hdIpragmaNamesCollect ++ _tlIpragmaNamesCollect
+                              {-# LINE 7088 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1002, column 40)
+                         _lhsOruleInfos =
+                             ({-# LINE 1002 "Transform.ag" #-}
+                              _hdIruleInfos ++ _tlIruleInfos
+                              {-# LINE 7094 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1003, column 40)
+                         _lhsOsigInfos =
+                             ({-# LINE 1003 "Transform.ag" #-}
+                              _hdIsigInfos ++ _tlIsigInfos
+                              {-# LINE 7100 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1004, column 40)
+                         _lhsOuniqueInfos =
+                             ({-# LINE 1004 "Transform.ag" #-}
+                              _hdIuniqueInfos ++ _tlIuniqueInfos
+                              {-# LINE 7106 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _hdOoptions =
+                             ({-# LINE 39 "Transform.ag" #-}
+                              _lhsIoptions
+                              {-# LINE 7112 "Transform.hs" #-}
+                              )
+                         -- copy rule (down)
+                         _tlOoptions =
+                             ({-# LINE 39 "Transform.ag" #-}
+                              _lhsIoptions
+                              {-# LINE 7118 "Transform.hs" #-}
+                              )
+                         ( _hdIaroundInfos,_hdIaugmentInfos,_hdIdefinedInsts,_hdIerrors,_hdImergeInfos,_hdIorderDepsCollect,_hdIpragmaNamesCollect,_hdIruleInfos,_hdIsigInfos,_hdIuniqueInfos) =
+                             hd_ _hdOoptions 
+                         ( _tlIaroundInfos,_tlIaugmentInfos,_tlIdefinedInsts,_tlIerrors,_tlImergeInfos,_tlIorderDepsCollect,_tlIpragmaNamesCollect,_tlIruleInfos,_tlIsigInfos,_tlIuniqueInfos) =
+                             tl_ _tlOoptions 
+                     in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
+sem_SemDefs_Nil :: T_SemDefs 
+sem_SemDefs_Nil  =
+    (T_SemDefs (\ _lhsIoptions ->
+                    (let _lhsOaroundInfos :: ([AroundInfo])
+                         _lhsOaugmentInfos :: ([AugmentInfo])
+                         _lhsOdefinedInsts :: ([Identifier])
+                         _lhsOerrors :: (Seq Error)
+                         _lhsOmergeInfos :: ([MergeInfo])
+                         _lhsOorderDepsCollect :: (Set Dependency)
+                         _lhsOpragmaNamesCollect :: ([Identifier])
+                         _lhsOruleInfos :: ([RuleInfo])
+                         _lhsOsigInfos :: ([SigInfo])
+                         _lhsOuniqueInfos :: ([UniqueInfo])
+                         -- use rule "Transform.ag"(line 1006, column 40)
+                         _lhsOaroundInfos =
+                             ({-# LINE 1006 "Transform.ag" #-}
+                              []
+                              {-# LINE 7142 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1005, column 40)
+                         _lhsOaugmentInfos =
+                             ({-# LINE 1005 "Transform.ag" #-}
+                              []
+                              {-# LINE 7148 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1087, column 55)
+                         _lhsOdefinedInsts =
+                             ({-# LINE 1087 "Transform.ag" #-}
+                              []
+                              {-# LINE 7154 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 43, column 19)
+                         _lhsOerrors =
+                             ({-# LINE 43 "Transform.ag" #-}
+                              Seq.empty
+                              {-# LINE 7160 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1007, column 40)
+                         _lhsOmergeInfos =
+                             ({-# LINE 1007 "Transform.ag" #-}
+                              []
+                              {-# LINE 7166 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 837, column 44)
+                         _lhsOorderDepsCollect =
+                             ({-# LINE 837 "Transform.ag" #-}
+                              Set.empty
+                              {-# LINE 7172 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 806, column 46)
+                         _lhsOpragmaNamesCollect =
+                             ({-# LINE 806 "Transform.ag" #-}
+                              []
+                              {-# LINE 7178 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1002, column 40)
+                         _lhsOruleInfos =
+                             ({-# LINE 1002 "Transform.ag" #-}
+                              []
+                              {-# LINE 7184 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1003, column 40)
+                         _lhsOsigInfos =
+                             ({-# LINE 1003 "Transform.ag" #-}
+                              []
+                              {-# LINE 7190 "Transform.hs" #-}
+                              )
+                         -- use rule "Transform.ag"(line 1004, column 40)
+                         _lhsOuniqueInfos =
+                             ({-# LINE 1004 "Transform.ag" #-}
+                              []
+                              {-# LINE 7196 "Transform.hs" #-}
                               )
                      in  ( _lhsOaroundInfos,_lhsOaugmentInfos,_lhsOdefinedInsts,_lhsOerrors,_lhsOmergeInfos,_lhsOorderDepsCollect,_lhsOpragmaNamesCollect,_lhsOruleInfos,_lhsOsigInfos,_lhsOuniqueInfos))) )
diff --git a/src-derived/Visage.hs b/src-derived/Visage.hs
--- a/src-derived/Visage.hs
+++ b/src-derived/Visage.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (Visage.ag)
+-- UUAGC 0.9.38.6 (Visage.ag)
 module Visage where
 {-# LINE 6 "Visage.ag" #-}
 
diff --git a/src-derived/VisagePatterns.hs b/src-derived/VisagePatterns.hs
--- a/src-derived/VisagePatterns.hs
+++ b/src-derived/VisagePatterns.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (VisagePatterns.ag)
+-- UUAGC 0.9.38.6 (VisagePatterns.ag)
 module VisagePatterns where
 {-# LINE 2 "VisagePatterns.ag" #-}
 
diff --git a/src-derived/VisageSyntax.hs b/src-derived/VisageSyntax.hs
--- a/src-derived/VisageSyntax.hs
+++ b/src-derived/VisageSyntax.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.38.1 (VisageSyntax.ag)
+-- UUAGC 0.9.38.6 (VisageSyntax.ag)
 module VisageSyntax where
 {-# LINE 2 "VisageSyntax.ag" #-}
 
diff --git a/src/Ag.hs b/src/Ag.hs
--- a/src/Ag.hs
+++ b/src/Ag.hs
@@ -19,6 +19,7 @@
 import qualified Transform          as Pass1  (sem_AG     ,  wrap_AG     ,  Syn_AG      (..), Inh_AG      (..))
 import qualified Desugar            as Pass1a (sem_Grammar,  wrap_Grammar,  Syn_Grammar (..), Inh_Grammar (..))
 import qualified DefaultRules       as Pass2  (sem_Grammar,  wrap_Grammar,  Syn_Grammar (..), Inh_Grammar (..))
+import qualified ResolveLocals      as Pass2a (sem_Grammar,  wrap_Grammar,  Syn_Grammar (..), Inh_Grammar (..))
 import qualified Order              as Pass3  (sem_Grammar,  wrap_Grammar,  Syn_Grammar (..), Inh_Grammar (..))
 import qualified KWOrder            as Pass3a (sem_Grammar,  wrap_Grammar,  Syn_Grammar (..), Inh_Grammar (..))
 import qualified GenerateCode       as Pass4  (sem_CGrammar, wrap_CGrammar, Syn_CGrammar(..), Inh_CGrammar(..))
@@ -43,13 +44,13 @@
 
 
 main :: IO ()
-main        
+main
  = do args     <- getArgs
       progName <- getProgName
-      
+
       let usageheader = "Usage info:\n " ++ progName ++ " options file ...\n\nList of options:"
           (flags,files,errs) = getOptions args
-          
+
       if showVersion flags
        then putStrLn banner
        else if null files || showHelp flags || (not.null) errs
@@ -65,7 +66,7 @@
       irrefutableMap <- readIrrefutableMap flags
 
       let output1   = Pass1.wrap_AG              (Pass1.sem_AG                                 output0 ) Pass1.Inh_AG       {Pass1.options_Inh_AG       = flags}
-          flags'    = Pass1.pragmas_Syn_AG       output1 $ flags
+          flags'    = condDisableOptimizations (Pass1.pragmas_Syn_AG output1 flags)
           grammar1  = Pass1.output_Syn_AG        output1
           output1a  = Pass1a.wrap_Grammar        (Pass1a.sem_Grammar grammar1                          ) Pass1a.Inh_Grammar {Pass1a.options_Inh_Grammar = flags', Pass1a.forcedIrrefutables_Inh_Grammar = irrefutableMap }
           grammar1a =Pass1a.output_Syn_Grammar   output1a
@@ -73,14 +74,15 @@
           grammar2  = Pass2.output_Syn_Grammar   output2
           outputV   = PassV.wrap_Grammar         (PassV.sem_Grammar grammar2                           ) PassV.Inh_Grammar  {}
           grammarV  = PassV.visage_Syn_Grammar   outputV
-          output3   = Pass3.wrap_Grammar         (Pass3.sem_Grammar grammar2                           ) Pass3.Inh_Grammar  {Pass3.options_Inh_Grammar  = flags'}
+          output2a  = Pass2a.wrap_Grammar        (Pass2a.sem_Grammar grammar2                          ) Pass2a.Inh_Grammar {Pass2a.options_Inh_Grammar = flags'}
+          grammar2a = Pass2a.output_Syn_Grammar  output2a
+          output3   = Pass3.wrap_Grammar         (Pass3.sem_Grammar grammar2a                          ) Pass3.Inh_Grammar  {Pass3.options_Inh_Grammar  = flags'}
           grammar3  = Pass3.output_Syn_Grammar   output3
-          output3a  = Pass3a.wrap_Grammar        (Pass3a.sem_Grammar grammar2                          ) Pass3a.Inh_Grammar  {Pass3a.options_Inh_Grammar  = flags'}
+          output3a  = Pass3a.wrap_Grammar        (Pass3a.sem_Grammar grammar2a                         ) Pass3a.Inh_Grammar  {Pass3a.options_Inh_Grammar  = flags'}
           grammar3a = Pass3a.output_Syn_Grammar  output3a
           output4   = Pass4.wrap_CGrammar        (Pass4.sem_CGrammar(Pass3.output_Syn_Grammar  output3)) Pass4.Inh_CGrammar {Pass4.options_Inh_CGrammar = flags'}
           output4a  = Pass4a.wrap_CGrammar       (Pass4a.sem_CGrammar(Pass3.output_Syn_Grammar output3)) Pass4a.Inh_CGrammar {Pass4a.options_Inh_CGrammar = flags'}
-          output4b  = Pass4b.wrap_ExecutionPlan  (Pass4b.sem_ExecutionPlan grammar3a) Pass4b.Inh_ExecutionPlan {Pass4b.options_Inh_ExecutionPlan = flags', Pass4b.inhmap_Inh_ExecutionPlan = Pass3a.inhmap_Syn_Grammar output3a, Pass4b.synmap_Inh_ExecutionPlan = Pass3a.synmap_Syn_Grammar output3a, Pass4b.pragmaBlocks_Inh_ExecutionPlan = pragmaBlocksTxt, Pass4b.importBlocks_Inh_ExecutionPlan = importBlocksTxt, Pass4b.textBlocks_Inh_ExecutionPlan = textBlocksDoc, Pass4b.moduleHeader_Inh_ExecutionPlan = mkModuleHeader $ Pass1.moduleDecl_Syn_AG output1, Pass4b.mainName_Inh_ExecutionPlan = mkMainName mainName $ Pass1.moduleDecl_Syn_AG output1}
-          debug4b   = Pass4b.debugoutput_Syn_ExecutionPlan  output4b
+          output4b  = Pass4b.wrap_ExecutionPlan  (Pass4b.sem_ExecutionPlan grammar3a) Pass4b.Inh_ExecutionPlan {Pass4b.options_Inh_ExecutionPlan = flags', Pass4b.inhmap_Inh_ExecutionPlan = Pass3a.inhmap_Syn_Grammar output3a, Pass4b.synmap_Inh_ExecutionPlan = Pass3a.synmap_Syn_Grammar output3a, Pass4b.pragmaBlocks_Inh_ExecutionPlan = pragmaBlocksTxt, Pass4b.importBlocks_Inh_ExecutionPlan = importBlocksTxt, Pass4b.textBlocks_Inh_ExecutionPlan = textBlocksDoc, Pass4b.moduleHeader_Inh_ExecutionPlan = mkModuleHeader $ Pass1.moduleDecl_Syn_AG output1, Pass4b.mainName_Inh_ExecutionPlan = mkMainName mainName $ Pass1.moduleDecl_Syn_AG output1, Pass4b.mainFile_Inh_ExecutionPlan = mainFile, Pass4b.optionsLine_Inh_ExecutionPlan = optionsLine}
           output5   = Pass5.wrap_Program         (Pass5.sem_Program (Pass4.output_Syn_CGrammar output4)) Pass5.Inh_Program  {Pass5.options_Inh_Program  = flags', Pass5.pragmaBlocks_Inh_Program = pragmaBlocksTxt, Pass5.importBlocks_Inh_Program = importBlocksTxt, Pass5.textBlocks_Inh_Program = textBlocksDoc, Pass5.textBlockMap_Inh_Program = textBlockMap, Pass5.optionsLine_Inh_Program = optionsLine, Pass5.mainFile_Inh_Program = mainFile, Pass5.moduleHeader_Inh_Program = mkModuleHeader $ Pass1.moduleDecl_Syn_AG output1, Pass5.mainName_Inh_Program = mkMainName mainName $ Pass1.moduleDecl_Syn_AG output1}
           output5a  = Pass5a.wrap_Program        (Pass5a.sem_Program (Pass4.output_Syn_CGrammar output4)) Pass5a.Inh_Program { Pass5a.options_Inh_Program  = flags', Pass5a.textBlockMap_Inh_Program = textBlockMap }
           output6   = PrErr.wrap_Errors          (PrErr.sem_Errors                       errorsToReport) PrErr.Inh_Errors   {PrErr.options_Inh_Errors   = flags', PrErr.dups_Inh_Errors = [] }
@@ -97,7 +99,8 @@
           parseErrorList   = map message2error parseErrors
           mainErrors       = toList ( Pass1.errors_Syn_AG       output1
                                Seq.>< Pass1a.errors_Syn_Grammar output1a
-                               Seq.>< Pass2.errors_Syn_Grammar  output2 )
+                               Seq.>< Pass2.errors_Syn_Grammar  output2
+                               Seq.>< Pass2a.errors_Syn_Grammar output2a)
           furtherErrors    = if kennedyWarren flags' then []
                              else toList ( Pass3.errors_Syn_Grammar  output3
                                   Seq.>< Pass4.errors_Syn_CGrammar output4)
@@ -108,15 +111,15 @@
                                      then furtherErrors
                                      else []
                              else [head parseErrorList]
-     
+
           fatalErrorList = filter (PrErr.isError flags') errorList
-          
+
           allErrors = if wignore flags'
                       then fatalErrorList
                       else errorsToFront flags' errorList
 
           errorsToReport = take (wmaxerrs flags') allErrors
-          
+
           errorsToStopOn = if werrors flags'
                             then errorList
                             else fatalErrorList
@@ -124,27 +127,27 @@
           blocks1                    = (Pass1.blocks_Syn_AG output1) {-SM `Map.unionWith (++)` (Pass3.blocks_Syn_Grammar output3)-}
           (pragmaBlocks, blocks2)    = Map.partitionWithKey (\(k, at) _->k==BlockPragma && at == Nothing) blocks1
           (importBlocks, textBlocks) = Map.partitionWithKey (\(k, at) _->k==BlockImport && at == Nothing) blocks2
-          
+
           importBlocksTxt = vlist_sep "" . map addLocationPragma . concat . Map.elems $ importBlocks
           textBlocksDoc   = vlist_sep "" . map addLocationPragma . Map.findWithDefault [] (BlockOther, Nothing) $ textBlocks
           pragmaBlocksTxt = unlines . concat . map fst  . concat . Map.elems $ pragmaBlocks
           textBlockMap    = Map.map (vlist_sep "" . map addLocationPragma) . Map.filterWithKey (\(_, at) _ -> at /= Nothing) $ textBlocks
-          
+
           outputfile = if null output then outputFile input else output
-          
+
           addLocationPragma :: ([String], Pos) -> PP_Doc
           addLocationPragma (strs, p)
             | genLinePragmas flags'
                 = "{-# LINE" >#< pp (show (line p)) >#< show (file p) >#< "#-}" >-< vlist (map pp strs) >-< "{-# LINE" >#< ppWithLineNr (pp.show.(+1)) >#< show outputfile >#< "#-}"
             | otherwise
                 = vlist (map pp strs)
-          
+
           optionsGHC = option (unbox flags') "-fglasgow-exts" ++ option (bangpats flags') "-XBangPatterns"
           option True s  = [s]
           option False _ = []
           optionsLine | null optionsGHC = ""
                       | otherwise       = "{-# OPTIONS_GHC " ++ unwords optionsGHC ++ " #-}"
-          
+
           mainName = stripPath $ defaultModuleName input
           mainFile = defaultModuleName input
 
@@ -157,7 +160,7 @@
           pluralS n = if n == 1 then "" else "s"
 
       putStr . formatErrors $ PrErr.pp_Syn_Errors output6
-      
+
       if additionalErrors > 0
        then putStr $ "\nPlus " ++ show additionalErrors ++ " more error" ++ pluralS additionalErrors ++
                      if additionalWarnings > 0
@@ -166,22 +169,24 @@
        else if additionalWarnings > 0
             then putStr $ "\nPlus " ++ show additionalWarnings ++ " more warning" ++ pluralS additionalWarnings ++ ".\n"
             else return ()
-           
-      if not (null fatalErrorList) 
+
+      if not (null fatalErrorList)
        then exitFailure
-       else 
+       else
         do
            if genvisage flags'
             then writeFile (outputfile++".visage") (writeATerm aterm)
             else return ()
-            
+
            if genAttributeList flags'
             then writeAttributeList (outputfile++".attrs") (Pass1a.allAttributes_Syn_Grammar output1a)
             else return ()
 
            if sepSemMods flags'
             then do -- alternative module gen
-                    Pass5.genIO_Syn_Program output5
+                    if kennedyWarren flags'
+                      then Pass4b.genIO_Syn_ExecutionPlan output4b
+                      else Pass5.genIO_Syn_Program output5
                     if not (null errorsToStopOn) then exitFailure else return ()
             else do -- conventional module gen
                     let doc
@@ -205,12 +210,26 @@
                                     , AspectAGDump.importAspectAG
                                     , textBlocksDoc
                                     , pp "\n\n{-- AspectAG Code --}\n\n"
-                                    
+
                                     , AspectAGDump.pp_Syn_Grammar aspectAG
                                     ]
                          | kennedyWarren flags'
-                            = vlist [debug4b,
-                                     if dumpgrammar flags'
+                            = vlist [ pp optionsLine
+                                    , pp $ "{-# LANGUAGE Rank2Types, GADTs, EmptyDataDecls #-}"
+                                    , pp pragmaBlocksTxt
+                                    , pp $ if isNothing $ Pass1.moduleDecl_Syn_AG output1
+                                           then moduleHeader flags' mainName
+                                           else mkModuleHeader (Pass1.moduleDecl_Syn_AG output1) mainName "" "" False
+                                    , pp importBlocksTxt
+                                    , pp $ "import Control.Monad.Identity (Identity)"
+                                    , pp $ "import qualified Control.Monad.Identity"
+                                    , textBlocksDoc
+                                    --, pp $ "{-"
+                                    --, Pass3a.depgraphs_Syn_Grammar output3a
+                                    --, Pass3a.visitgraph_Syn_Grammar output3a
+                                    --, pp $ "-}"
+                                    , Pass4b.output_Syn_ExecutionPlan output4b
+                                    , if dumpgrammar flags'
                                       then vlist [ pp "{- Dump of grammar with default rules"
                                                  , GrammarDump.pp_Syn_Grammar dump2
                                                  , pp "-}"
@@ -242,7 +261,7 @@
                                                  ]
                                       else empty
                                     , if dumpcgrammar flags'
-                                      then vlist [ pp "{- Dump of cgrammar" 
+                                      then vlist [ pp "{- Dump of cgrammar"
                                                  , CGrammarDump.pp_Syn_CGrammar dump3
                                                  , pp "-}"
                                                  ]
@@ -268,8 +287,8 @@
 
 message2error :: Message Token Pos -> Error
 message2error (Msg expect pos action) = ParserError pos (show expect) actionString
- where actionString 
-        =  case action 
+ where actionString
+        =  case action
            of Insert s -> "inserting: " ++ show s
 
               Delete s -> "deleting: "  ++ show s
@@ -282,24 +301,24 @@
 
 moduleHeader :: Options -> String -> String
 moduleHeader flags input
- = case moduleName flags 
+ = case moduleName flags
    of Name nm -> genMod nm
       Default -> genMod (defaultModuleName input)
       NoName  -> ""
    where genMod x = "module " ++ x ++ " where"
 
 inputFile :: String -> String
-inputFile name 
+inputFile name
  = if ".ag" `isSuffixOf` name || ".lag" `isSuffixOf` name
    then name
    else name ++ ".ag"
 
 outputFile :: String -> String
-outputFile name 
+outputFile name
  = defaultModuleName name ++ ".hs"
 
 defaultModuleName :: String -> String
-defaultModuleName name 
+defaultModuleName name
  = if ".ag" `isSuffixOf` name
    then take (length name - 3) name
    else if ".lag" `isSuffixOf` name
@@ -317,8 +336,8 @@
   = name
 
 mkModuleHeader :: Maybe (String,String,String) -> String -> String -> String -> Bool -> String
-mkModuleHeader Nothing defaultName _ _ _
-  = "module " ++ defaultName ++ " where"
+mkModuleHeader Nothing defaultName suffix _ _
+  = "module " ++ defaultName ++ suffix ++ " where"
 mkModuleHeader (Just (name, exports, imports)) _ suffix addExports replaceExports
   = "module " ++ name ++ suffix ++ exp ++ " where\n" ++ imports ++ "\n"
   where
diff --git a/src/KennedyWarren.hs b/src/KennedyWarren.hs
--- a/src/KennedyWarren.hs
+++ b/src/KennedyWarren.hs
@@ -18,8 +18,8 @@
 import qualified Data.IntMap as IntMap
 import qualified Data.IntSet as IntSet
 
-kennedyWarrenOrder :: Set.Set NontermIdent -> [NontDependencyInformation] -> TypeSyns -> Maybe ExecutionPlan
-kennedyWarrenOrder wr ndis typesyns = runST $ do
+kennedyWarrenOrder :: Set.Set NontermIdent -> [NontDependencyInformation] -> TypeSyns -> Derivings -> Maybe (ExecutionPlan, PP_Doc, PP_Doc)
+kennedyWarrenOrder wr ndis typesyns derivings = runST $ do
   indi <- mapM mkNontDependencyInformationM ndis
   knuth1 indi
   -- Check all graphs for cyclicity, transitive closure and consistency
@@ -62,14 +62,19 @@
     then do
        -- Create non-transitive closed graph for efficiency
        indi <- undoTransitiveClosure indi
+       -- Graphviz output of dependency graphs
+       gvs <- mapM toGVNontDependencyInfo indi
        -- Doing kennedywarren
-       ret <- runVG $ do
+       (ret, visitg) <- runVG $ do
          traceVG $ "Running kennedy-warren..."
          initvs <- kennedyWarrenVisitM wr indi
          -- Generate execution plan
-         kennedyWarrenExecutionPlan indi initvs wr typesyns
+         ex <- kennedyWarrenExecutionPlan indi initvs wr typesyns derivings
+         -- Get visit graph
+         visitg <- toGVVisitGraph
+         return (ex,visitg)
        -- Return the result
-       return $ Just ret
+       return $ Just (ret, vlist gvs, visitg)
     else return Nothing
 
 -------------------------------------------------------------------------------
@@ -130,6 +135,20 @@
                                            >-<
                                            text "")
 
+toGVVisitGraph :: VG s PP_Doc
+toGVVisitGraph = do
+  ndis <- gets vgNDI
+  noded <- forM (IntMap.toList ndis) $ \(n,rndi) -> do
+    ndi <- vgInST $ readSTRef rndi
+    return $ "node_" >|< n >#< "[label=\"" >|< ndiNonterminal (ndimOrig ndi) >|< "_" >|< n >|< "\"];"
+  edges <- gets vgEdges
+  edged <- forM (IntMap.toList edges) $ \(edg,(VGNode from,VGNode to)) -> do
+    inh <- getInherited (VGEdge edg)
+    syn <- getSynthesized (VGEdge edg)
+    return $ "node_" >|< from >#< "-> node_" >|< to >#< "[label=\"visit v" >|< edg 
+      >|< "\\ninh:" >#< (concat $ intersperse ", " $ map show $ Set.toList inh) >|< "\\nsyn: " >|< (concat $ intersperse ", " $ map show $ Set.toList syn) >|< "\"];"
+  return $ "digraph visitgraph { " >-< vlist noded >-< vlist edged >-< "}"
+
 -------------------------------------------------------------------------------
 --         Kennedy-Warren in monadic style
 -------------------------------------------------------------------------------
@@ -490,9 +509,11 @@
   -- Create initial nodes and edges (edges only for wrapper nodes)
   initvs <- forM ndis $ \ndi -> do
     nd <- insertInitialNode ndi
-    if (Set.member (ndiNonterminal $ ndimOrig $ ndi) wr)
+    let inh = Set.fromList $ ndiInh $ ndimOrig ndi
+    let syn = Set.fromList $ ndiSyn $ ndimOrig ndi
+    if (Set.member (ndiNonterminal $ ndimOrig $ ndi) wr) && (not (Set.null inh) || not (Set.null syn))
       then do
-        VGEdge initv <- createPending nd (Set.fromList $ ndiInh $ ndimOrig ndi) (Set.fromList $ ndiSyn $ ndimOrig ndi)
+        VGEdge initv <- createPending nd inh syn
         return $ Just initv
       else return Nothing
   -- Handle all pending edges while there are any
@@ -622,8 +643,8 @@
 ---         Construction of the execution plan           ---
 ------------------------------------------------------------
 kennedyWarrenExecutionPlan :: [NontDependencyInformationM s] -> [Maybe Int] -> Set.Set NontermIdent
-                              -> TypeSyns -> VG s ExecutionPlan
-kennedyWarrenExecutionPlan ndis initvs wr typesyns = do
+                              -> TypeSyns -> Derivings -> VG s ExecutionPlan
+kennedyWarrenExecutionPlan ndis initvs wr typesyns derivings = do
   -- Loop over all nonterminals
   nonts <- forM (zip ndis initvs) $ \(ndi, initv) -> do
     -- Loop over all productions of this nonterminal
@@ -654,4 +675,4 @@
                            initv
                            prods
   -- Return complete execution plan
-  return $ ExecutionPlan nonts typesyns wr
+  return $ ExecutionPlan nonts typesyns wr derivings
diff --git a/src/Knuth1.hs b/src/Knuth1.hs
--- a/src/Knuth1.hs
+++ b/src/Knuth1.hs
@@ -367,11 +367,11 @@
                   ndis' <- mapM addProdNont ndis
                   -- List of all newly added edges
 --                ntedge :: [Edge]
-                  let pntedge = concatMap (\x -> maybe [] id x) ndis'
+                  let pntedge = concatMap (maybe [] id) ndis'
                   -- Add backedges
-                  bedges <- addBackEdges ndis
+                  --bedges <- addBackEdges ndis
                   -- All added nonterminal edges
-                  let ntedge = pntedge ++ bedges
+                  let ntedge = pntedge -- ++ bedges
                   if null ntedge
                     -- When no new edges have been added we are done
                     then return ()
diff --git a/src/Options.hs b/src/Options.hs
--- a/src/Options.hs
+++ b/src/Options.hs
@@ -72,11 +72,12 @@
                , Option []        ["checkParseBlocks"]         (NoArg parseHsBlockOpt) "Parse blocks with Haskell parser"
                , Option []        ["checkParseHaskell"]  (NoArg parseHsOpt) "Parse Haskell code (recognizer)"
                , Option []        ["nocatas"]           (ReqArg nocatasOpt "list of nonterms") "Nonterminals not to generate catas for"
+               , Option []        ["nooptimize"]         (NoArg noOptimizeOpt) "Disable optimizations"
                ]
 
 allc = "dcfsprm"
 
-data Options = Options{ moduleName :: ModuleHeader 
+data Options = Options{ moduleName :: ModuleHeader
                       , dataTypes :: Bool
                       , strictData :: Bool
                       , strictWrap :: Bool
@@ -137,6 +138,7 @@
                       , checkParseBlock :: Bool
                       , nocatas :: Set NontermIdent
                       , kennedyWarren :: Bool
+                      , noOptimizations :: Bool
                       } deriving Show
 noOptions = Options { moduleName    = NoName
                     , dataTypes     = False
@@ -199,28 +201,29 @@
                     , checkParseBlock = False
                     , nocatas         = Set.empty
                     , kennedyWarren   = False
+                    , noOptimizations = False
                     }
 
-moduleOpt  nm   opts = opts{moduleName   = maybe Default Name nm}            
-dataOpt         opts = opts{dataTypes    = True}            
-strictDataOpt   opts = opts{strictData   = True}            
-strictWrapOpt   opts = opts{strictWrap   = True}            
-cataOpt         opts = opts{folds        = True}            
-semfunsOpt      opts = opts{semfuns      = True}            
-signaturesOpt   opts = opts{typeSigs     = True}            
-prettyOpt       opts = opts{attrInfo     = True}            
+moduleOpt  nm   opts = opts{moduleName   = maybe Default Name nm}
+dataOpt         opts = opts{dataTypes    = True}
+strictDataOpt   opts = opts{strictData   = True}
+strictWrapOpt   opts = opts{strictWrap   = True}
+cataOpt         opts = opts{folds        = True}
+semfunsOpt      opts = opts{semfuns      = True}
+signaturesOpt   opts = opts{typeSigs     = True}
+prettyOpt       opts = opts{attrInfo     = True}
 renameOpt       opts = opts{rename       = True}
 wrappersOpt     opts = opts{wrappers     = True}
 modcopyOpt      opts = opts{modcopy      = True}
 newtypesOpt     opts = opts{newtypes     = True}
 nestOpt         opts = opts{nest         = True}
 smacroOpt       opts = opts{smacro       = True}
-verboseOpt      opts = opts{verbose      = True}            
-helpOpt         opts = opts{showHelp     = True}            
-versionOpt      opts = opts{showVersion  = True}            
-prefixOpt pre   opts = opts{prefix       = pre }            
-selfOpt         opts = opts{withSelf     = True}            
-cycleOpt        opts = opts{withCycle    = True}            
+verboseOpt      opts = opts{verbose      = True}
+helpOpt         opts = opts{showHelp     = True}
+versionOpt      opts = opts{showVersion  = True}
+prefixOpt pre   opts = opts{prefix       = pre }
+selfOpt         opts = opts{withSelf     = True}
+cycleOpt        opts = opts{withCycle    = True}
 visitOpt        opts = opts{visit        = True, withCycle = True}
 seqOpt          opts = opts{withSeq      = True}
 unboxOpt        opts = opts{unbox        = True}
@@ -261,6 +264,7 @@
 parseHsBlockOpt opts = opts { checkParseBlock = True }
 parseHsOpt = parseHsRhsOpt . parseHsTpOpt . parseHsBlockOpt
 kennedyWarrenOpt opts = opts { kennedyWarren = True }
+noOptimizeOpt opts = opts { noOptimizations = True }
 nocatasOpt str opts = opts { nocatas = set `Set.union` nocatas opts } where
   set = Set.fromList ids
   ids = map identifier lst
@@ -270,15 +274,34 @@
             | otherwise = p : split ps
     where (p,ps) = break (== ',') str
 
-outputOpt  file  opts = opts{outputFiles  = file : outputFiles opts}            
-searchPathOpt  path  opts = opts{searchPath  = extract path ++ searchPath opts}            
+outputOpt  file  opts = opts{outputFiles  = file : outputFiles opts}
+searchPathOpt  path  opts = opts{searchPath  = extract path ++ searchPath opts}
   where extract xs = let (p,ps) = break (\x -> x == ';' || x == ':') xs
                      in if null p then [] else p : extract ps
 allOpt = moduleOpt Nothing . dataOpt . cataOpt . semfunsOpt . signaturesOpt . prettyOpt . renameOpt
 optimizeOpt   = visitOpt . casesOpt
 
+condDisableOptimizations opts
+  | noOptimizations opts =
+      opts { strictData         = False
+           , strictWrap         = False
+           , withSeq            = False
+           , unbox              = False
+           , bangpats           = False
+           , cases              = False
+           , strictCases        = False
+           , stricterCases      = False
+           , strictSems         = False
+           , localCps           = False
+           , splitSems          = False
+           , breadthFirstStrict = False
+           }
+  | otherwise = opts
+
 getOptions args = let (flags,files,errors) = getOpt Permute options args
-                  in (foldl (flip ($)) noOptions flags,files,errors)
+                      appliedOpts = foldl (flip ($)) noOptions flags
+                      finOpts = condDisableOptimizations appliedOpts
+                  in (finOpts,files,errors)
 
 data ModuleHeader  = NoName
                    | Name String
diff --git a/src/Version.hs b/src/Version.hs
--- a/src/Version.hs
+++ b/src/Version.hs
@@ -1,4 +1,7 @@
 module Version where
 
+import Paths_uuagc_bootstrap(version)
+import Data.Version
+
 banner :: String
-banner = "Attribute Grammar compiler / HUT project. Version 0.9.38.6"
+banner = ("Attribute Grammar compiler / HUT project. Version " ++ showVersion version)
diff --git a/uuagc-bootstrap.cabal b/uuagc-bootstrap.cabal
--- a/uuagc-bootstrap.cabal
+++ b/uuagc-bootstrap.cabal
@@ -1,7 +1,7 @@
 cabal-version: >=1.2
 build-type: Simple
 name: uuagc-bootstrap
-version: 0.9.38.6.1
+version: 0.9.38.6.2
 license: GPL
 license-file: LICENSE
 maintainer: Arie Middelkoop <ariem@cs.uu.nl>
