--- a/cmajor++/CmDevEnv/Server/Compiler.cs
+++ b/cmajor++/CmDevEnv/Server/Compiler.cs
@@ -10,6 +10,11 @@
 
 namespace Server
 {
+    public enum UseCompiler
+    {
+        cmc, cmca
+    }
+
     public delegate void WriteToOutputWindow(string line);
 
     public class CompileError
@@ -85,6 +90,7 @@
     {
         public abstract void HandleCompileRequest(CompileRequest request);
         public abstract void HandleExitRequest(ExitRequest request);
+        public abstract void HandleCleanRequest(CleanRequest request);
     }
     public abstract class Request
     {
@@ -99,25 +105,31 @@
     }
     public class CompileRequest : Request
     {
-        public CompileRequest(string filePath, bool rebuild, string config, string sourceFilePath,
-            bool verbose, bool nocttc, bool debugCompilingClassess, bool debugCompilingFunctions, bool debugTi, bool debugArch, bool debugNothrow)
-        {
+        public CompileRequest(UseCompiler compilerToUse, string filePath, bool rebuild, string config, string sourceFilePath,
+            bool quiet, bool verbose, bool stats, bool nocttc, bool debugCompilingClassess, bool debugCompilingFunctions, bool debugTi, bool debugArch)
+        {
+            this.compilerToUse = compilerToUse;
             this.filePath = filePath;
             this.rebuild = rebuild;
             this.config = config;
             this.sourceFilePath = sourceFilePath;
+            this.quiet = quiet;
             this.verbose = verbose;
+            this.stats = stats;
             this.nocttc = nocttc;
             this.debugCompilingClassess = debugCompilingClassess;
             this.debugCompilingFunctions = debugCompilingFunctions;
             this.debugTi = debugTi;
             this.debugArch = debugArch;
-            this.debugNothrow = debugNothrow;
         }
         public override void Process(RequestHandler handler)
         {
             handler.HandleCompileRequest(this);
         }
+        public UseCompiler CompilerToUse
+        {
+            get { return compilerToUse; }
+        }
         public string FilePath
         {
             get { return filePath; }
@@ -134,10 +146,18 @@
         {
             get { return sourceFilePath; }
         }
+        public bool Quiet
+        {
+            get { return quiet; }
+        }
         public bool Verbose
         {
             get { return verbose; }
         }
+        public bool Stats
+        {
+            get { return stats; }
+        }
         public bool Nocttc
         {
             get { return nocttc; }
@@ -158,21 +178,48 @@
         {
             get { return debugArch; }
         }
-        public bool DebugNothrow
-        {
-            get { return debugNothrow; }
-        }
+        private UseCompiler compilerToUse;
         private string filePath;
         private bool rebuild;
         private string config;
         private string sourceFilePath;
+        private bool quiet;
         private bool verbose;
+        private bool stats;
         private bool nocttc;
         private bool debugCompilingClassess;
         private bool debugCompilingFunctions;
         private bool debugTi;
         private bool debugArch;
-        private bool debugNothrow;
+    }
+
+    public class CleanRequest : Request
+    {
+        public CleanRequest(UseCompiler compilerToUse, string filePath, string config)
+        {
+            this.compilerToUse = compilerToUse;
+            this.filePath = filePath;
+            this.config = config;
+        }
+        public override void Process(RequestHandler handler)
+        {
+            handler.HandleCleanRequest(this);
+        }
+        public UseCompiler CompilerToUse
+        {
+            get { return compilerToUse; }
+        }
+        public string FilePath
+        {
+            get { return filePath; }
+        }
+        public string Config
+        {
+            get { return config; }
+        }
+        private UseCompiler compilerToUse;
+        private string filePath;
+        private string config;
     }
 
     public class Compiler : RequestHandler
@@ -180,6 +227,7 @@
         public Compiler()
         {
             cmcPath = "cmc.exe";
+            cmcaPath = "cmca.exe";
             requestQueue = new Queue<Request>();
             requestWaiting = new ManualResetEvent(false);
             exit = new ManualResetEvent(false);
@@ -201,6 +249,11 @@
             get { return cmcPath; }
             set { cmcPath = value; }
         }
+        public string CmcaPath
+        {
+            get { return cmcaPath; }
+            set { cmcaPath = value; }
+        }
         public void DoExit()
         {
             Request request = new ExitRequest();
@@ -214,9 +267,18 @@
         {
             exit.WaitOne();
         }
-        public void DoCompile(string solutionOrProjectFilePath, bool rebuild, string config, string sourceFilePath, bool verbose, bool nocttc, bool debugCompilingClasses, bool debugCompilingFunctions, bool debugTi, bool debugArch, bool debugNothrow)
-        {
-            Request request = new CompileRequest(solutionOrProjectFilePath, rebuild, config, sourceFilePath, verbose, nocttc, debugCompilingClasses, debugCompilingFunctions, debugTi, debugArch, debugNothrow);
+        public void DoCompile(UseCompiler compilerToUse, string solutionOrProjectFilePath, bool rebuild, string config, string sourceFilePath, bool quiet, bool verbose, bool stats, bool nocttc, bool debugCompilingClasses, bool debugCompilingFunctions, bool debugTi, bool debugArch)
+        {
+            Request request = new CompileRequest(compilerToUse, solutionOrProjectFilePath, rebuild, config, sourceFilePath, quiet, verbose, stats, nocttc, debugCompilingClasses, debugCompilingFunctions, debugTi, debugArch);
+            lock (requestQueue)
+            {
+                requestQueue.Enqueue(request);
+            }
+            requestWaiting.Set();
+        }
+        public void DoClean(UseCompiler compilerToUse, string solutionOrProjectFilePath, string config)
+        {
+            Request request = new CleanRequest(compilerToUse, solutionOrProjectFilePath, config);
             lock (requestQueue)
             {
                 requestQueue.Enqueue(request);
@@ -243,9 +305,9 @@
         }
         public override void HandleCompileRequest(CompileRequest request)
         {
-            Compile(request.FilePath, request.Rebuild, request.Config, request.SourceFilePath, request.Verbose, request.Nocttc, request.DebugCompilingClasses, request.DebugCompilingFunctions, request.DebugTi, request.DebugArch, request.DebugNothrow);
-        }
-        private void Compile(string solutionOrProjectFilePath, bool rebuild, string config, string sourceFilePath, bool verbose, bool nocttc, bool debugCompilingClasses, bool debugCompilingFunctions, bool debugTi, bool debugArch, bool debugNothrow)
+            Compile(request.CompilerToUse, request.FilePath, request.Rebuild, request.Config, request.SourceFilePath, request.Quiet, request.Verbose, request.Stats, request.Nocttc, request.DebugCompilingClasses, request.DebugCompilingFunctions, request.DebugTi, request.DebugArch);
+        }
+        private void Compile(UseCompiler compilerToUse, string solutionOrProjectFilePath, bool rebuild, string config, string sourceFilePath, bool quiet, bool verbose, bool stats, bool nocttc, bool debugCompilingClasses, bool debugCompilingFunctions, bool debugTi, bool debugArch)
         {
             try
             {
@@ -262,10 +324,18 @@
                 {
                     arguments.Append(" -c " + sourceFilePath);
                 }
+                if (quiet)
+                {
+                    arguments.Append(" -quiet");
+                }
                 if (verbose)
                 {
                     arguments.Append(" -verbose");
                 }
+                if (stats)
+                {
+                    arguments.Append(" -stats");
+                }
                 if (nocttc)
                 {
                     arguments.Append(" -nocttc");
@@ -286,11 +356,8 @@
                 {
                     arguments.Append(" -debug:arch");
                 }
-                if (debugNothrow)
-                {
-                    arguments.Append(" -debug:nothrow");
-                }
-                ProcessStartInfo startInfo = new ProcessStartInfo(cmcPath, arguments.ToString());
+                string compilerPath = compilerToUse == UseCompiler.cmc ? cmcPath : cmcaPath;
+                ProcessStartInfo startInfo = new ProcessStartInfo(compilerPath, arguments.ToString());
                 startInfo.UseShellExecute = false;
                 startInfo.CreateNoWindow = true;
                 startInfo.RedirectStandardOutput = true;
@@ -331,6 +398,61 @@
                     {
                         writeControl.Invoke(writeDelegate, ex.ToString());
                     }
+                    compileResultHandler.Invoke(compileReady, new CompileError("devenv", "", ex.ToString(), "", 0, 0, "", 0, 0, ""));
+                }
+            }
+        }
+        public override void HandleCleanRequest(CleanRequest request)
+        {
+            Clean(request.CompilerToUse, request.FilePath, request.Config);
+        }
+        private void Clean(UseCompiler compilerToUse, string solutionOrProjectFilePath, string config)
+        {
+            try
+            {
+                StringBuilder arguments = new StringBuilder();
+                arguments.Append("-config=").Append(config);
+                arguments.Append(" -devenverrorformat");
+                arguments.Append(" ").Append(solutionOrProjectFilePath);
+                arguments.Append(" -clean");
+                string compilerPath = compilerToUse == UseCompiler.cmc ? cmcPath : cmcaPath;
+                ProcessStartInfo startInfo = new ProcessStartInfo(compilerPath, arguments.ToString());
+                startInfo.UseShellExecute = false;
+                startInfo.CreateNoWindow = true;
+                startInfo.RedirectStandardOutput = true;
+                startInfo.RedirectStandardError = true;
+                Process cmc = Process.Start(startInfo);
+                string outputLine = cmc.StandardOutput.ReadLine();
+                while (outputLine != null)
+                {
+                    if (writeControl != null && writeDelegate != null)
+                    {
+                        writeControl.Invoke(writeDelegate, outputLine);
+                    }
+                    outputLine = cmc.StandardOutput.ReadLine();
+                }
+                cmc.WaitForExit();
+                if (cmc.ExitCode == 0)
+                {
+                    if (compileResultHandler != null && compileReady != null)
+                    {
+                        compileResultHandler.Invoke(compileReady, new object[] { null });
+                    }
+                }
+                else
+                {
+                    string errorText = cmc.StandardError.ReadToEnd();
+                    if (compileResultHandler != null && compileReady != null)
+                    {
+                        CompileError error = ParseErrorText(errorText);
+                        compileResultHandler.Invoke(compileReady, error);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                if (compileResultHandler != null && compileReady != null)
+                {
                     compileResultHandler.Invoke(compileReady, new CompileError("devenv", "", ex.ToString(), "", 0, 0, "", 0, 0, ""));
                 }
             }
@@ -361,6 +483,7 @@
             return compileError;
         }
         private string cmcPath;
+        private string cmcaPath;
         private Queue<Request> requestQueue;
         private ManualResetEvent requestWaiting;
         private Thread compileThread;