diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC.hs b/cabal-plugin/src/Distribution/Simple/UUAGC.hs
new file mode 100644
--- /dev/null
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC.hs
@@ -0,0 +1,5 @@
+module Distribution.Simple.UUAGC(uuagcUserHook
+                                ,uuagc) where
+
+import Distribution.Simple.UUAGC.UUAGC
+
diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/AbsSyn.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/AbsSyn.hs
new file mode 100644
--- /dev/null
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/AbsSyn.hs
@@ -0,0 +1,138 @@
+module Distribution.Simple.UUAGC.AbsSyn where
+
+import Distribution.Simple.UUAGC.Options
+import System.FilePath(normalise)
+
+data AGFileOption = AGFileOption String UUAGCOptions deriving Show
+
+type AGFileOptions = [AGFileOption]
+
+data UUAGCOption = UModuleDefault
+                 | UModule String
+                 | UData
+                 | UStrictData
+                 | UStrictWData
+                 | UCatas
+                 | USemFuns
+                 | USignatures
+                 | UNewTypes
+                 | UPretty
+                 | UWrappers
+                 | URename
+                 | UModCopy
+                 | UNest
+                 | USyntaxMacro
+                 | UOutput FilePath
+                 | UVerbose
+                 | UHelp -- ?
+                 | UAll
+                 | USearchPath FilePath
+                 | UPrefix     String
+                 | USelf
+                 | UCycle
+                 | UVersion -- ?
+                 | UVisit
+                 | USeq
+                 | UUnbox -- UUnbox
+                 | UBangPats
+                 | UCase
+                 | UStrictCase
+                 | UStricterCase
+                 | ULocalCPS
+                 | USplitSems
+                 | UWErrors
+                 | UWIgnore
+                 | UWMax       Int
+                 | UDumpGrammar
+                 | UDumpCGrammar
+                 | UGenTraces
+                 | UGenUseTraces
+                 | UGenCostCentres
+                 | UGenLinePragmas
+                 | USepSemMods
+                 | UGenFileDeps
+                 | UGenVisage
+                 | UGenAttrList
+                 | UForceIrrefutable FilePath
+                 | ULCKeyWords
+                 | UOptimize
+                 | UDoubleColons
+                 | UHaskellSyntax
+                   deriving (Eq,Read,Show)
+
+type UUAGCOptions = [UUAGCOption]
+
+defaultUUAGCOptions :: UUAGCOptions
+defaultUUAGCOptions = [UData
+                      ,UCatas
+                      ,USemFuns
+                      ,USignatures
+                      ,UPretty
+                      ,UWrappers
+                      ,URename
+                      ,UModuleDefault
+                      ]
+
+optionTxt = "--"
+equalTxt  = "="
+
+toLOp   s = optionTxt ++ s
+toLEOpA s a = (toLOp s) ++ equalTxt ++ a
+
+fromUUAGCOtoArgs :: UUAGCOption -> String
+fromUUAGCOtoArgs (UModule s)            = toLEOpA omodule s
+fromUUAGCOtoArgs UData                  = toLOp odata
+fromUUAGCOtoArgs UStrictData            = toLOp ostrictdata
+fromUUAGCOtoArgs UStrictWData           = toLOp ostrictwrap
+fromUUAGCOtoArgs UCatas                 = toLOp ocatas
+fromUUAGCOtoArgs USemFuns               = toLOp osemfuns
+fromUUAGCOtoArgs USignatures            = toLOp osignatures
+fromUUAGCOtoArgs UNewTypes              = toLOp onewtypes
+fromUUAGCOtoArgs UPretty                = toLOp opretty
+fromUUAGCOtoArgs UWrappers              = toLOp owrappers
+fromUUAGCOtoArgs URename                = toLOp orename
+fromUUAGCOtoArgs UModCopy               = toLOp omodcopy
+fromUUAGCOtoArgs UNest                  = toLOp onest
+fromUUAGCOtoArgs USyntaxMacro           = toLOp osyntaxmacro
+fromUUAGCOtoArgs (UOutput fp)           = toLEOpA ooutput fp
+fromUUAGCOtoArgs UVerbose               = toLOp overbose
+fromUUAGCOtoArgs (USearchPath fp)       = toLEOpA "" fp
+fromUUAGCOtoArgs (UPrefix p)            = toLEOpA oprefix p
+fromUUAGCOtoArgs USelf                  = toLOp oself
+fromUUAGCOtoArgs UCycle                 = toLOp ocycle
+fromUUAGCOtoArgs UVersion               = toLOp oversion
+fromUUAGCOtoArgs UVisit                 = toLOp ovisit
+fromUUAGCOtoArgs USeq                   = toLOp oseq
+fromUUAGCOtoArgs UUnbox                 = toLOp ounbox
+fromUUAGCOtoArgs UBangPats              = toLOp obangpats
+fromUUAGCOtoArgs UCase                  = toLOp ocase
+fromUUAGCOtoArgs UStrictCase            = toLOp ostrictcase
+fromUUAGCOtoArgs UStricterCase          = toLOp ostrictercase
+fromUUAGCOtoArgs ULocalCPS              = toLOp olocalcps
+fromUUAGCOtoArgs USplitSems             = toLOp osplitsems
+fromUUAGCOtoArgs UWErrors               = toLOp owerrors
+fromUUAGCOtoArgs UWIgnore               = toLOp owignore
+fromUUAGCOtoArgs (UWMax i)              = toLEOpA owmax (show i)
+fromUUAGCOtoArgs UDumpGrammar           = toLOp odumpgrammar
+fromUUAGCOtoArgs UDumpCGrammar          = toLOp odumpcgrammar
+fromUUAGCOtoArgs UGenTraces             = toLOp ogentraces
+fromUUAGCOtoArgs UGenUseTraces          = toLOp ogenusetraces
+fromUUAGCOtoArgs UGenCostCentres        = toLOp ogencostcentres
+fromUUAGCOtoArgs UGenLinePragmas        = toLOp ogenlinepragmas
+fromUUAGCOtoArgs USepSemMods            = toLOp osepsemmods
+fromUUAGCOtoArgs UGenFileDeps           = toLOp ogenfiledeps
+fromUUAGCOtoArgs UGenVisage             = toLOp ogenvisage
+fromUUAGCOtoArgs UGenAttrList           = toLOp ogenattrlist
+fromUUAGCOtoArgs (UForceIrrefutable fp) = toLEOpA oforceirrefutable fp
+fromUUAGCOtoArgs UOptimize              = toLOp ooptimize
+fromUUAGCOtoArgs UModuleDefault         = toLOp omodule
+
+fromUUAGCOstoArgs :: UUAGCOptions -> [String]
+fromUUAGCOstoArgs = map fromUUAGCOtoArgs
+
+lookupFileOptions :: FilePath -> AGFileOptions -> UUAGCOptions
+lookupFileOptions s = foldl f defaultUUAGCOptions
+    where f e (AGFileOption s' opt)
+              | s == (normalise s')  = opt
+              | otherwise            = e
+
diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/Options.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/Options.hs
new file mode 100644
--- /dev/null
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/Options.hs
@@ -0,0 +1,52 @@
+module Distribution.Simple.UUAGC.Options where
+
+odata           = "data"
+ostrictdata     = "strictdata"
+ostrictwrap     = "strictwrap"
+ocatas          = "catas"
+osemfuns        = "semfuns"
+osignatures     = "signatures"
+onewtypes       = "newtypes"
+opretty         = "pretty"
+owrappers       = "wrappers"
+orename         = "rename"
+omodcopy        = "modcopy"
+onest           = "nest"
+osyntaxmacro    = "syntaxmacro"
+overbose        = "verbose"
+ohelp           = "help"
+oself           = "self"
+ocycle          = "cycle"
+oversion        = "version"
+ovisit          = "visit"
+oseq            = "seq"
+ounbox          = "unbox"
+obangpats       = "bangpats" 
+ocase           = "case"
+ostrictcase     = "strictcase"
+ostrictercase   = "strictercase"
+olocalcps       = "localcps"
+osplitsems      = "splitsems"
+owerrors        = "Werrors"
+owignore        = "Wignore"
+odumpgrammar    = "dumpgrammar"
+odumpcgrammar   = "dumpcgrammar"
+ogentraces      = "gentraces"
+ogenusetraces   = "genusetraces"
+ogencostcentres = "gencostcentres"
+ogenlinepragmas = "genlinepragmas"
+osepsemmods     = "sepsemmods"
+ogenfiledeps    = "genfiledeps"
+ogenvisage      = "genvisage"
+ogenattrlist    = "genattrlist"
+olckeywords     = "lckeywords"
+ooptimize       = "optimize"
+odoublecolons   = "doublecolons"
+ohaskellsyntax  = "haskellsyntax"
+oall            = "all"
+omodule         = "module"
+ooutput         = "output"
+osearch         = "path"
+oprefix         = "prefix"
+owmax           = "Wmax"
+oforceirrefutable = "forceirrefutable"
diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs
new file mode 100644
--- /dev/null
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs
@@ -0,0 +1,136 @@
+{-# OPTIONS_GHC -XScopedTypeVariables -XPatternSignatures #-}
+module Distribution.Simple.UUAGC.Parser(parserAG, scanner, parseIOAction) where
+
+import UU.Parsing
+import UU.Scanner
+import Distribution.Simple.UUAGC.AbsSyn
+import Distribution.Simple.UUAGC.Options
+import System.IO.Unsafe(unsafeInterleaveIO)
+import System.IO(hPutStr,stderr)
+import Control.Exception
+
+uFlags = [odata, ostrictdata, ostrictwrap, ocatas, osemfuns, osignatures
+         ,onewtypes, opretty
+         ,owrappers, orename, omodcopy, onest, osyntaxmacro, overbose
+         ,ohelp, ocycle, oversion, ovisit, oseq, ounbox, obangpats
+         ,ocase, ostrictcase, ostrictercase, olocalcps, osplitsems
+         ,owerrors, owignore, odumpgrammar, odumpcgrammar, ogentraces
+         ,ogenusetraces, ogencostcentres, ogenlinepragmas, osepsemmods
+         ,ogenfiledeps, ogenvisage, ogenattrlist, olckeywords
+         ,odoublecolons ]
+
+uabsFlags = [UData, UStrictData, UStrictWData, UCatas, USemFuns, USignatures
+            ,UNewTypes, UPretty
+            ,UWrappers, URename, UModCopy, UNest, USyntaxMacro, UVerbose
+            ,UHelp, UCycle, UVersion, UVisit, USeq, UUnbox, UBangPats
+            ,UCase, UStrictCase, UStricterCase, ULocalCPS, USplitSems
+            ,UWErrors, UWIgnore, UDumpGrammar, UDumpCGrammar, UGenTraces
+            ,UGenUseTraces, UGenCostCentres, UGenLinePragmas, USepSemMods
+            ,UGenFileDeps, UGenVisage, UGenAttrList, ULCKeyWords
+            ,UDoubleColons ]
+
+gFlags = [(oall, [odata, ocatas, osemfuns, osignatures, opretty, orename])
+         ,(ooptimize, [ovisit,ocase])
+         ,(ohaskellsyntax, [olckeywords, odoublecolons,ogenlinepragmas])
+         ]
+
+gabsFlags = [UAll, UOptimize, UHaskellSyntax]
+
+
+aFlags = [omodule, ooutput, osearch, oprefix, owmax, oforceirrefutable]
+
+ugFlags = uFlags ++ (map (fst) gFlags)
+
+ugabsFlags = uabsFlags ++ gabsFlags
+
+kwtxt = uFlags ++ (map (fst) gFlags) ++ aFlags ++ ["file", "options"]
+kwotxt = [":","..","."]
+sctxt  = "..,"
+octxt = ":.,"
+
+posTxt :: Pos
+posTxt = Pos 0 0 ""
+
+puFlag :: UUAGCOption -> String -> Parser Token UUAGCOption
+puFlag opt sopt = opt <$ pKey sopt
+
+pugFlags :: [Parser Token UUAGCOption]
+pugFlags = zipWith puFlag ugabsFlags ugFlags
+
+pModule :: Parser Token UUAGCOption
+pModule =  UModuleDefault <$ pKey omodule
+       <|> UModule <$> (pKey omodule *> pString)
+
+pOutput :: Parser Token UUAGCOption
+pOutput = UOutput <$> (pKey ooutput *> pString)
+
+pSearch :: Parser Token UUAGCOption
+pSearch = USearchPath <$> (pKey osearch *> pString)
+
+pPrefix :: Parser Token UUAGCOption
+pPrefix = UPrefix <$> (pKey oprefix *> pString)
+
+pWmax :: Parser Token UUAGCOption
+pWmax = f <$> (pKey owmax *> pInteger)
+    where f x = UWMax (read x)
+
+pForceIrrefutable :: Parser Token UUAGCOption
+pForceIrrefutable = UForceIrrefutable <$> (pKey oforceirrefutable *> pString)
+
+pAllFlags = pugFlags ++ [pModule,pOutput,pSearch,pPrefix,pWmax,pForceIrrefutable]
+
+pAnyFlag = pAny id pAllFlags
+
+pAGFileOption :: Parser Token AGFileOption
+pAGFileOption = AGFileOption <$> (pKey "file" *> pKey ":" *> pString)
+                <*> (pKey "options" *> pKey ":" *> pCommas pAnyFlag)
+
+pAGFileOptions :: Parser Token AGFileOptions
+pAGFileOptions = pList pAGFileOption
+
+parserAG :: FilePath -> IO AGFileOptions
+parserAG fp = do s <- readFile fp
+                 parseIOAction action pAGFileOptions (scanner fp s)
+
+scanner     :: String -> String -> [Token]
+scanner fn s = scan kwtxt kwotxt sctxt octxt (Pos 0 0 fn) s
+
+action :: (Eq s, Show s, Show p) => Message s p -> IO ()
+action m = hPutStr stderr (show m)
+
+test :: (Show a) => Parser Token a -> [Token] -> IO ()
+test p inp = do r <- parseIOAction action p inp
+                print r
+
+parseIOAction :: (Symbol s, InputState inp s p)
+               => (Message s p -> IO ())
+               -> AnaParser inp Pair s p a
+               -> inp
+               -> IO a
+parseIOAction  showMessage p inp
+ = do  (Pair v final) <- evalStepsIOAction showMessage (parse p inp)
+       final `seq` return v -- in order to force the trailing error messages to be printed
+
+evalStepsIOAction :: (Message s p -> IO ())
+                  ->  Steps b s p
+                  -> IO b
+evalStepsIOAction showMessage = evalStepsIOAction' showMessage (-1)
+
+evalStepsIOAction' :: (Message s p -> IO ())
+                   -> Int
+                   ->  Steps b s p
+                   -> IO b
+evalStepsIOAction' showMessage n (steps :: Steps b s p) = eval n steps
+  where eval                      :: Int -> Steps a s p -> IO a
+        eval 0 steps               = return (evalSteps steps)
+        eval n steps = case steps of
+          OkVal v        rest -> do arg <- unsafeInterleaveIO (eval n rest)
+                                    return (v arg)
+          Ok             rest -> eval n rest
+          Cost  _        rest -> eval n rest
+          StRepair _ msg rest -> do showMessage msg
+                                    eval (n-1) rest
+          Best _   rest   _   -> eval n rest
+          NoMoreSteps v       -> return v
+
+
diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
new file mode 100644
--- /dev/null
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
@@ -0,0 +1,140 @@
+module Distribution.Simple.UUAGC.UUAGC(uuagcUserHook,
+                                       uuagc
+                                      ) where
+
+import Distribution.Simple
+import Distribution.Simple.PreProcess
+import Distribution.Simple.LocalBuildInfo
+import Distribution.Simple.Utils
+import Distribution.Simple.Setup
+import Distribution.PackageDescription
+import Distribution.Simple.UUAGC.AbsSyn( AGFileOption(..)
+                                         , AGFileOptions
+                                         , UUAGCOption(..)
+                                         , UUAGCOptions
+                                         , defaultUUAGCOptions
+                                         , fromUUAGCOtoArgs
+                                         , fromUUAGCOstoArgs
+                                         , lookupFileOptions
+                                         )
+import Distribution.Simple.UUAGC.Parser
+import System.Process( CreateProcess(..), createProcess, CmdSpec(..)
+                     , StdStream(..), runProcess, waitForProcess
+                     , proc
+                     )
+import System.Directory
+import System.FilePath(pathSeparators,normalise)
+import System.Exit (ExitCode(..))
+import System.IO( openFile, IOMode(..), hFileSize
+                , hSetFileSize, hClose, hGetContents
+                , Handle(..), stderr, hPutStr
+                )
+import Control.Exception (throwIO)
+
+-- | 'uuagc' returns the name of the uuagc compiler
+uuagcn = "uuagc"
+
+-- | 'defUUAGCOptions' returns the default names of the uuagc options
+defUUAGCOptions = "uuagc_options"
+
+uuagcUserHook :: UserHooks
+uuagcUserHook = simpleUserHooks { hookedPreProcessors = ("ag", uuagc):knownSuffixHandlers
+                                , preBuild = uuagcPreBuild
+                                }
+
+originalPreBuild = preBuild simpleUserHooks
+
+processContent :: Handle -> IO [String]
+processContent h = do s <- hGetContents h
+                      return $ words s
+
+putErrorInfo :: Handle -> IO ()
+putErrorInfo h = do s <- hGetContents h
+                    hPutStr stderr s
+
+addSearch :: [String] -> [String] -> [String]
+addSearch spl fl = let sf = [head pathSeparators]
+                   in [ normalise (sp ++ sf ++ f)  | sp <- spl, f  <- fl]
+
+throwFailure :: IO ()
+throwFailure = do throwIO $ ExitFailure 1
+                  return ()
+
+-- This manages to change the file modification time.
+updateFile :: FilePath -> IO ()
+updateFile f = do h <- openFile f AppendMode
+                  i <- hFileSize h
+                  hSetFileSize h (i+1)
+                  hSetFileSize h i
+                  hClose h
+
+-- | 'updateAGFile' search into the uuagc options file for a list of all
+-- 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 :: FilePath -> [String] -> IO ()
+updateAGFile f sp = do
+  (_,(Just ppOutput), (Just ppError),ph) <- createProcess
+                                            $ (proc uuagcn ["--genfiledeps"
+                                                           ,"--="++(intercalate ":" sp)
+                                                           ,f
+                                                           ])
+                                                  { std_in  = Inherit
+                                                  , std_out = CreatePipe
+                                                  , std_err = CreatePipe
+                                                  }
+  ec <- waitForProcess ph
+  case ec of
+    ExitSuccess       -> do fls <- processContent ppOutput
+                            let flsC = addSearch sp fls
+                            fmt   <- getModificationTime f
+                            flsmt <- mapM getModificationTime flsC
+                            if any (fmt < ) flsmt
+                             then updateFile f
+                             else return ()
+    (ExitFailure exc) -> do putErrorInfo ppOutput
+                            putErrorInfo ppError
+                            throwFailure
+
+uuagcPreBuild :: Args -> BuildFlags -> IO HookedBuildInfo
+uuagcPreBuild args buildF = do
+  uuagcOpts <- parserAG defUUAGCOptions
+  let agfls  = getAGFileList uuagcOpts
+      agflSP = map (\f -> (f,[searchPath f])) agfls
+  mapM_ (uncurry updateAGFile) agflSP
+  originalPreBuild args buildF
+
+getAGFileList :: AGFileOptions -> [FilePath]
+getAGFileList = map (\(AGFileOption s _) -> (normalise s))
+
+
+searchPath :: FilePath -> FilePath
+searchPath fp = let pf = reverse fp
+                    sp = head pathSeparators
+                    rl = searchPath' sp  pf
+                in (reverse rl)
+    where searchPath' y []     = []
+          searchPath' y sp@(x:xs)
+              | x == y         = sp
+              | otherwise      = searchPath' y xs
+
+uuagc :: BuildInfo
+        -> LocalBuildInfo
+        -> PreProcessor
+uuagc build local  =
+   PreProcessor {
+     platformIndependent = True,
+     runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
+                       do info verbosity (inFile++" has been preprocessed into "++outFile)
+                          print $ "processing: " ++ inFile
+                          opts <- parserAG defUUAGCOptions
+                          let search  = searchPath inFile
+                              options = (fromUUAGCOstoArgs (lookupFileOptions inFile opts))
+                                        ++ ["-P"++search,"--output="++outFile,inFile]
+                          (_,_,_,ph) <- createProcess (proc uuagcn options)
+                          eCode <- waitForProcess ph
+                          case eCode of
+                            ExitSuccess   -> return ()
+                            ExitFailure _ -> throwFailure
+                }
+
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.10 (AbstractSyntax.ag)
+-- UUAGC 0.9.11 (AbstractSyntax.ag)
 module AbstractSyntax where
 
 -- AbstractSyntax.ag imports
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.10 (AbstractSyntaxDump.ag)
+-- UUAGC 0.9.11 (AbstractSyntaxDump.ag)
 module AbstractSyntaxDump where
 
 import Data.List
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.10 (Code.ag)
+-- UUAGC 0.9.11 (Code.ag)
 module Code where
 
 import Pretty
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.10 (CodeSyntax.ag)
+-- UUAGC 0.9.11 (CodeSyntax.ag)
 module CodeSyntax where
 
 import Patterns
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.10 (CodeSyntaxDump.ag)
+-- UUAGC 0.9.11 (CodeSyntaxDump.ag)
 module CodeSyntaxDump where
 
 import Data.List
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.10 (ConcreteSyntax.ag)
+-- UUAGC 0.9.11 (ConcreteSyntax.ag)
 module ConcreteSyntax where
 
 import UU.Scanner.Position (Pos)
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.10 (DeclBlocks.ag)
+-- UUAGC 0.9.11 (DeclBlocks.ag)
 module DeclBlocks where
 
 import Code (Decl,Expr)
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 -fbang-patterns #-}
 
--- UUAGC 0.9.10 (DefaultRules.ag)
+-- UUAGC 0.9.11 (DefaultRules.ag)
 module DefaultRules where
 
 import qualified List (delete,intersperse)
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 -fbang-patterns #-}
 
--- UUAGC 0.9.10 (Desugar.ag)
+-- UUAGC 0.9.11 (Desugar.ag)
 module Desugar where
 
 import qualified Data.Set as Set
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.10 (ErrorMessages.ag)
+-- UUAGC 0.9.11 (ErrorMessages.ag)
 module ErrorMessages where
 
 import UU.Scanner.Position(Pos)
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.10 (Expression.ag)
+-- UUAGC 0.9.11 (Expression.ag)
 module Expression where
 
 import UU.Scanner.Position(Pos)
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.10 (GenerateCode.ag)
+-- UUAGC 0.9.11 (GenerateCode.ag)
 module GenerateCode where
 
 import CommonTypes
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.10 (HsToken.ag)
+-- UUAGC 0.9.11 (HsToken.ag)
 module HsToken where
 
 import CommonTypes
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.10 (Interfaces.ag)
+-- UUAGC 0.9.11 (Interfaces.ag)
 module Interfaces where
 
 import CommonTypes
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 -fbang-patterns #-}
 
--- UUAGC 0.9.10 (InterfacesRules.lag)
+-- UUAGC 0.9.11 (InterfacesRules.lag)
 module InterfacesRules where
 
 import Interfaces
diff --git a/src-derived/Order.hs b/src-derived/Order.hs
--- a/src-derived/Order.hs
+++ b/src-derived/Order.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.10 (Order.ag)
+-- UUAGC 0.9.11 (Order.ag)
 module Order where
 
 -- From uuagc
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.10 (Patterns.ag)
+-- UUAGC 0.9.11 (Patterns.ag)
 module Patterns where
 
 -- Patterns.ag imports
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 -fbang-patterns #-}
 
--- UUAGC 0.9.10 (PrintCode.ag)
+-- UUAGC 0.9.11 (PrintCode.ag)
 module PrintCode where
 
 import Char (isAlphaNum)
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.10 (PrintErrorMessages.ag)
+-- UUAGC 0.9.11 (PrintErrorMessages.ag)
 module PrintErrorMessages where
 
 import Pretty
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.10 (SemHsTokens.ag)
+-- UUAGC 0.9.11 (SemHsTokens.ag)
 module SemHsTokens where
 
 import qualified Data.Sequence as Seq
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.10 (TfmToVisage.ag)
+-- UUAGC 0.9.11 (TfmToVisage.ag)
 module TfmToVisage where
 
 import AbstractSyntax
diff --git a/src-derived/Transform.hs b/src-derived/Transform.hs
--- a/src-derived/Transform.hs
+++ b/src-derived/Transform.hs
@@ -1,6 +1,6 @@
 
 
--- UUAGC 0.9.10 (Transform.ag)
+-- UUAGC 0.9.11 (Transform.ag)
 module Transform where
 
 import Control.Monad(mplus,mzero)
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.10 (Visage.ag)
+-- UUAGC 0.9.11 (Visage.ag)
 module Visage where
 
 import UU.Scanner.Position(Pos(..))
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.10 (VisagePatterns.ag)
+-- UUAGC 0.9.11 (VisagePatterns.ag)
 module VisagePatterns where
 
 import UU.Scanner.Position(Pos)
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.10 (VisageSyntax.ag)
+-- UUAGC 0.9.11 (VisageSyntax.ag)
 module VisageSyntax where
 
 import CommonTypes
diff --git a/src/Version.hs b/src/Version.hs
--- a/src/Version.hs
+++ b/src/Version.hs
@@ -1,4 +1,4 @@
 module Version where
 
 banner :: String
-banner = "Attribute Grammar compiler / HUT project. Version 0.9.11"
+banner = "Attribute Grammar compiler / HUT project. Version 0.9.12"
diff --git a/uuagc.cabal b/uuagc.cabal
--- a/uuagc.cabal
+++ b/uuagc.cabal
@@ -1,7 +1,7 @@
 cabal-version: >=1.2
 build-type: Simple
 name: uuagc
-version: 0.9.11
+version: 0.9.12
 license: GPL
 license-file: LICENSE
 maintainer: Arie Middelkoop <ariem@cs.uu.nl>
@@ -75,3 +75,11 @@
   extensions: TypeSynonymInstances, MultiParamTypeClasses
   hs-source-dirs: src, src-derived
 
+Library
+   build-depends:   base >= 4, base < 5, Cabal, directory, process, uulib, filepath
+   hs-source-dirs:  cabal-plugin/src
+   exposed-modules: Distribution.Simple.UUAGC
+   other-modules:   Distribution.Simple.UUAGC.UUAGC,
+                    Distribution.Simple.UUAGC.Parser,
+                    Distribution.Simple.UUAGC.AbsSyn,
+                    Distribution.Simple.UUAGC.Options
diff --git a/uuagc.cabal-for-ghc-6.6 b/uuagc.cabal-for-ghc-6.6
--- a/uuagc.cabal-for-ghc-6.6
+++ b/uuagc.cabal-for-ghc-6.6
@@ -1,5 +1,5 @@
 name: uuagc
-version: 0.9.11
+version: 0.9.12
 license: GPL
 license-file: LICENSE
 maintainer: Arie Middelkoop <ariem@cs.uu.nl>
