diff --git a/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs b/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs
--- a/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs
+++ b/cabal-plugin/src/Distribution/Simple/UUAGC/Parser.hs
@@ -17,7 +17,7 @@
          ,owerrors, owignore, odumpgrammar, odumpcgrammar, ogentraces
          ,ogenusetraces, ogencostcentres, ogenlinepragmas, osepsemmods
          ,ogenfiledeps, ogenvisage, ogenattrlist, olckeywords
-         ,odoublecolons ]
+         ,odoublecolons, oself ]
 
 uabsFlags = [UData, UStrictData, UStrictWData, UCatas, USemFuns, USignatures
             ,UNewTypes, UPretty
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
@@ -72,13 +72,20 @@
 -- 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
+updateAGFile :: UUAGCOptions -> FilePath -> [String] -> IO ()
+updateAGFile opts f sp = do
+  let modeOpts = filter isModeOption opts
+      isModeOption UHaskellSyntax = True
+      isModeOption ULCKeyWords    = True
+      isModeOption UDoubleColons  = True
+      isModeOption _              = False
+  
   (_,(Just ppOutput), (Just ppError),ph) <- createProcess
-                                            $ (proc uuagcn ["--genfiledeps"
+                                            $ (proc uuagcn ( fromUUAGCOstoArgs modeOpts
+                                                           ++ ["--genfiledeps"
                                                            ,"--="++(intercalate ":" sp)
                                                            ,f
-                                                           ])
+                                                           ]))
                                                   { std_in  = Inherit
                                                   , std_out = CreatePipe
                                                   , std_err = CreatePipe
@@ -100,12 +107,12 @@
 uuagcPreBuild args buildF = do
   uuagcOpts <- parserAG defUUAGCOptions
   let agfls  = getAGFileList uuagcOpts
-      agflSP = map (\f -> (f,[searchPath f])) agfls
-  mapM_ (uncurry updateAGFile) agflSP
+      agflSP = map (\(f,opts) -> (f,opts,[searchPath f])) agfls
+  mapM_ (\(f,opts,s) -> updateAGFile opts f s) agflSP
   originalPreBuild args buildF
 
-getAGFileList :: AGFileOptions -> [FilePath]
-getAGFileList = map (\(AGFileOption s _) -> (normalise s))
+getAGFileList :: AGFileOptions -> [(FilePath, UUAGCOptions)]
+getAGFileList = map (\(AGFileOption s opts) -> (normalise s, opts))
 
 
 searchPath :: FilePath -> FilePath
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.24 (AbstractSyntax.ag)
+-- UUAGC 0.9.26 (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.24 (AbstractSyntaxDump.ag)
+-- UUAGC 0.9.26 (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.24 (Code.ag)
+-- UUAGC 0.9.26 (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.24 (CodeSyntax.ag)
+-- UUAGC 0.9.26 (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.24 (CodeSyntaxDump.ag)
+-- UUAGC 0.9.26 (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.24 (ConcreteSyntax.ag)
+-- UUAGC 0.9.26 (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.24 (DeclBlocks.ag)
+-- UUAGC 0.9.26 (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.24 (DefaultRules.ag)
+-- UUAGC 0.9.26 (DefaultRules.ag)
 module DefaultRules where
 {-# LINE 10 "DefaultRules.ag" #-}
 
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.24 (Desugar.ag)
+-- UUAGC 0.9.26 (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.24 (ErrorMessages.ag)
+-- UUAGC 0.9.26 (ErrorMessages.ag)
 module ErrorMessages where
 {-# LINE 2 "ErrorMessages.ag" #-}
 
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.24 (Expression.ag)
+-- UUAGC 0.9.26 (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.24 (GenerateCode.ag)
+-- UUAGC 0.9.26 (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.24 (HsToken.ag)
+-- UUAGC 0.9.26 (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.24 (Interfaces.ag)
+-- UUAGC 0.9.26 (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.24 (InterfacesRules.lag)
+-- UUAGC 0.9.26 (InterfacesRules.lag)
 module InterfacesRules where
 {-# LINE 10 "InterfacesRules.lag" #-}
 
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.24 (Order.ag)
+-- UUAGC 0.9.26 (Order.ag)
 module Order where
 {-# LINE 9 "Order.ag" #-}
 
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.24 (Patterns.ag)
+-- UUAGC 0.9.26 (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.24 (PrintCode.ag)
+-- UUAGC 0.9.26 (PrintCode.ag)
 module PrintCode where
 {-# LINE 10 "PrintCode.ag" #-}
 
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.24 (PrintErrorMessages.ag)
+-- UUAGC 0.9.26 (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.24 (PrintOcamlCode.ag)
+-- UUAGC 0.9.26 (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.24 (PrintVisitCode.ag)
+-- UUAGC 0.9.26 (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.24 (SemHsTokens.ag)
+-- UUAGC 0.9.26 (SemHsTokens.ag)
 module SemHsTokens where
 {-# LINE 4 "SemHsTokens.ag" #-}
 
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.24 (TfmToVisage.ag)
+-- UUAGC 0.9.26 (TfmToVisage.ag)
 module TfmToVisage where
 {-# LINE 8 "TfmToVisage.ag" #-}
 
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.24 (Visage.ag)
+-- UUAGC 0.9.26 (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.24 (VisagePatterns.ag)
+-- UUAGC 0.9.26 (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.24 (VisageSyntax.ag)
+-- UUAGC 0.9.26 (VisageSyntax.ag)
 module VisageSyntax where
 {-# LINE 2 "VisageSyntax.ag" #-}
 
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.26"
+banner = "Attribute Grammar compiler / HUT project. Version 0.9.27"
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.26
+version: 0.9.27
 license: GPL
 license-file: LICENSE
 maintainer: Arie Middelkoop <ariem@cs.uu.nl>
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.26
+version: 0.9.27
 license: GPL
 license-file: LICENSE
 maintainer: Arie Middelkoop <ariem@cs.uu.nl>
