Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/LawnMower.txt
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/LawnMower.txt	(revision 9871)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/LawnMower.txt	(revision 9872)
@@ -102,6 +102,4 @@
 int[] ints = Enumerable.Range(-100, 201).ToArray();
 >>
-INIT <<
->>
 
 NONTERMINALS
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg	(revision 9871)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg	(revision 9872)
@@ -150,5 +150,5 @@
                                                                                          myTNode.Ident = identStr;
                                                                                          myTNode.FormalParameters = src;
-                                                                                         myTNode.FieldDefinitions = SourceReader.ExtractFormalParameters(src);
+                                                                                         myTNode.FieldDefinitions = Util.ExtractFormalParameters(src);
                                                                                   .)
   [ "CONSTRAINTS" ConstraintDef<out constraints>
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/HeuristicLab.Problems.GPDL-3.4.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/HeuristicLab.Problems.GPDL-3.4.csproj	(revision 9871)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/HeuristicLab.Problems.GPDL-3.4.csproj	(revision 9872)
@@ -192,11 +192,8 @@
     <Compile Include="AST.cs" />
     <Compile Include="Grammar.cs" />
-    <Compile Include="InterpreterBuilder.cs" />
-    <Compile Include="MethodBuilder.cs" />
     <Compile Include="Parser.cs" />
     <Compile Include="ProblemGenerator.cs" />
     <Compile Include="Scanner.cs" />
-    <Compile Include="SourceReader.cs" />
-    <Compile Include="SymbolBuilder.cs" />
+    <Compile Include="Util.cs" />
     <None Include="GPDef.atg" />
     <None Include="HeuristicLab.snk" />
Index: anches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs	(revision 9871)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using System;
-
-public class InterpreterBuilder {
-  private static Dictionary<string, string> code;
-  private static bool maximization;
-  private static string fitnessFunction;
-  private static string additionalCode;
-
-  public static void Initialize() {
-    code = new Dictionary<string, string>();
-  }
-
-  public static void AddSymbolSemantics(string symbol, MethodBuilder mBuilder) {
-    code.Add(symbol, mBuilder.GetCode());
-  }
-  public static void SetMaximization(bool val) {
-    maximization = val;
-  }
-
-  public static void SetFitnessFunction(string srcCode) {
-    fitnessFunction = srcCode;
-  }
-  public static void SetAdditionalCode(string srcCode) {
-    additionalCode = srcCode;
-  }
-
-  public static void Write() {
-    foreach (var entry in code) {
-      Console.WriteLine(entry.Value);
-    }
-  }
-}
Index: anches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/MethodBuilder.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/MethodBuilder.cs	(revision 9871)
+++ 	(revision )
@@ -1,73 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Text;
-
-public class MethodBuilder {
-  private string name;
-  private string formalParameter;
-  private StringBuilder srcBuilder;
-
-  public MethodBuilder() {
-    this.srcBuilder = new StringBuilder();
-  }
-
-  public void SetName(string name) {
-    this.name = name;
-  }
-  public void SetFormalParameters(string formalParameter) {
-    this.formalParameter = formalParameter;
-  }
-
-  public void BeginAlternatives() {
-    srcBuilder.AppendLine("switch(curSy) { ");
-  }
-
-  public void StartAlternative()
-  {
-    srcBuilder.AppendLine();
-  }
-
-  public void EndAlternatives() {
-    srcBuilder.AppendLine("} ");
-  }
-
-  public void AddSource(string src) {
-    srcBuilder.AppendLine(src);
-  }
-
-  public void AddCall(string symbol, string actualParameter) {
-
-    Console.WriteLine("Call: " + symbol + " " + actualParameter);
-    srcBuilder.Append(symbol).Append("(").Append(actualParameter).Append(");");
-  }
-
-  public void Write() {
-    Console.WriteLine(GetCode());
-  }
-
-  public string GetCode() {
-    return "private void " + name + "(" + formalParameter + ") {" + Environment.NewLine +
-           srcBuilder.ToString() + Environment.NewLine +
-           "}";
-  }
-}
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Parser.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Parser.cs	(revision 9871)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Parser.cs	(revision 9872)
@@ -218,5 +218,5 @@
 		myTNode.Ident = identStr;
 		myTNode.FormalParameters = src;
-		myTNode.FieldDefinitions = SourceReader.ExtractFormalParameters(src);
+		myTNode.FieldDefinitions = Util.ExtractFormalParameters(src);
 		
 		if (la.kind == 15) {
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs	(revision 9871)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs	(revision 9872)
@@ -53,48 +53,4 @@
 ";
 
-  private string mainClassTemplate = @"
-namespace ?PROBLEMNAME? {
-  public sealed class ?IDENT?Main {
-    public ?IDENT?Main() { 
-      Initialize();
-    }    
-    public void Initialize() {
-      var problem = new ?IDENT?Problem();
-      var wh = new AutoResetEvent(false);
-      var ga = new OffspringSelectionGeneticAlgorithm();
-      ga.Engine = new SequentialEngine();
-      ga.Problem = problem;
-      ga.PopulationSize.Value = 1000;
-      ga.MaximumGenerations.Value = 100;
-      ga.ComparisonFactorLowerBound.Value = 0;
-      ga.ComparisonFactorUpperBound.Value = 0;
-      ga.MutationProbability.Value = 0.15;
-      ga.Mutator = ga.MutatorParameter.ValidValues.OfType<MultiSymbolicExpressionTreeManipulator>().First();
-      var ts = ga.SelectorParameter.ValidValues.OfType<GenderSpecificSelector>().First();
-      ga.Selector = ts;
-      ga.Prepare();
-      ga.ExceptionOccurred += (sender, args) => {
-        Console.WriteLine(args.Value);
-        wh.Set();
-      };
-      ga.Stopped += (sender, args) => {
-         Console.WriteLine(""Finished"");
-         Console.WriteLine(""Evaluated solutions: "" + ((IntValue)(ga.Results[""EvaluatedSolutions""]).Value).Value);
-         Console.WriteLine(""Best quality: "" + ((DoubleValue)(ga.Results[""BestQuality""]).Value).Value);
-         wh.Set();
-      };
-      ga.Crossover = ga.CrossoverParameter.ValidValues.First();
-      ga.Start();    
-      while(!wh.WaitOne(500)) {
-         if(ga.Results.ContainsKey(""BestQuality"")) {
-           int evalSolutions = ((IntValue)(ga.Results[""EvaluatedSolutions""]).Value).Value;
-           double quality = ((DoubleValue)(ga.Results[""BestQuality""]).Value).Value;
-           Console.WriteLine(""{0}\t{1} "", evalSolutions, quality);
-         }
-      };
-    }
-  }
-}";
-
   private string problemClassTemplate = @"
 namespace ?PROBLEMNAME? {
@@ -207,5 +163,4 @@
 
     ?CONSTRAINTSSOURCE?
-
   }
 }";
@@ -408,12 +363,13 @@
     GenerateEvaluator(definition);
     GenerateProblem(definition);
-    GenerateMain(definition);
 
     problemSourceCode.Replace("?PROBLEMNAME?", definition.Name);
 
+    // write to a file for debugging
     using (var stream = new StreamWriter(definition.Name + ".cs")) {
       stream.WriteLine(problemSourceCode.ToString());
     }
 
+    // compile generated source
     using (var csc = new CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", "v4.0" } })) {
       var parameters = new CompilerParameters(new[] { "mscorlib.dll", "System.Core.dll", "System.dll", "System.Drawing.dll" }, Path.ChangeExtension(Path.GetRandomFileName(), ".dll"), true);
@@ -442,6 +398,9 @@
 
       CompilerResults results = csc.CompileAssemblyFromSource(parameters, problemSourceCode.ToString());
-      results.Errors.Cast<CompilerError>().ToList().ForEach(error => Console.WriteLine(error.Line + " " + error.ErrorText));
-
+      results.Errors.Cast<CompilerError>()
+        .ToList()
+        .ForEach(error => Console.WriteLine(error.Line + " " + error.ErrorText));
+
+      // load the assembly, and create an instance from the generate problem class
       var asm = results.CompiledAssembly;
       AppDomain.CurrentDomain.Load(asm.GetName());
@@ -460,13 +419,4 @@
     problemSourceCode.AppendLine(evaluatorClassCode).AppendLine();
   }
-
-  private void GenerateMain(GPDefNode definition) {
-    var mainClassCode =
-      mainClassTemplate
-        .Replace("?IDENT?", definition.Name);
-
-    problemSourceCode.AppendLine(mainClassCode).AppendLine();
-  }
-
 
   private void GenerateProblem(GPDefNode definition) {
@@ -511,5 +461,5 @@
     string formalParameter = definition.NonTerminals.Single(nt => nt.Ident == g.RootSymbol).FormalParameters;
     var actualParameterEnumerable =
-      SourceReader.ExtractFormalParameters(formalParameter).Select(e => e.RefOrOut + " " + e.Identifier);
+      Util.ExtractFormalParameters(formalParameter).Select(e => e.RefOrOut + " " + e.Identifier);
     string actualParameter = string.Empty;
     if (actualParameterEnumerable.Any()) {
@@ -524,10 +474,10 @@
     }
     foreach (var s in definition.Terminals) {
-      sb.AppendLine(GenerateTerminalInterpreterMethod(g, (TerminalNode)s));
-    }
-    return sb.ToString();
-  }
-
-  private string GenerateTerminalInterpreterMethod(Grammar g, TerminalNode s) {
+      sb.AppendLine(GenerateTerminalInterpreterMethod((TerminalNode)s));
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateTerminalInterpreterMethod(TerminalNode s) {
     var sb = new StringBuilder();
     if (!s.FormalParameters.Any())
Index: anches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SourceReader.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SourceReader.cs	(revision 9871)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text.RegularExpressions;
-
-public class SourceReader {
-
-  private static Regex formalParameterExpr = new Regex(@"\s*,?\s*((?<refOrOut>(out|ref))\s+)?(?<type>[_\w]*)\s+(?<id>[_\w]*)\s*");
-  public static IEnumerable<TerminalNode.FieldDefinition> ExtractFormalParameters(string formalParameterSrc) {
-    var match = formalParameterExpr.Match(formalParameterSrc);
-    var matches = formalParameterExpr.Matches(formalParameterSrc);
-
-    foreach (var m in matches.OfType<Match>()) {
-      yield return new TerminalNode.FieldDefinition(m.Groups["refOrOut"].Value, m.Groups["type"].Value, m.Groups["id"].Value);
-    }
-  }
-}
Index: anches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SymbolBuilder.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SymbolBuilder.cs	(revision 9871)
+++ 	(revision )
@@ -1,70 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using System;
-
-public class SymbolBuilder {
-  private static HashSet<string> symbols;
-  
-  private static Dictionary<string, string> formalParameter;
-  private static Dictionary<string, string> init;
-  private static Dictionary<string, string> mutate;
-  private static Dictionary<string, string> code;
-  
-  public static void Initialize()
-  {
-    symbols = new HashSet<string>();
-    formalParameter = new Dictionary<string, string>();
-    init = new Dictionary<string, string>();
-    mutate = new Dictionary<string, string>();
-    code = new Dictionary<string, string>();
-  }
-  
-  public static void CreateSymbol(string ident, string formalParameterList) {
-    symbols.Add(ident);
-    formalParameter[ident] = formalParameterList;
-    init[ident] = "";
-    mutate[ident] = "";
-    code[ident] = "";
-  }
-  
-  public static void DefineInitialization(string ident, string code) {
-    init[ident] = code;
-  }
-  
-  public static void DefineMutation(string ident, string code) {
-    mutate[ident] = code;
-  }
-  
-  public static void AddCode(string ident, string c) {
-    code[ident] = c;
-  }
-  
-  public static void WriteSymbols() {
-    foreach(var s in symbols) {
-      Console.WriteLine(s);
-      Console.WriteLine(init[s]);
-      Console.WriteLine(mutate[s]);
-      Console.WriteLine(code[s]);
-    }
-  }
-}
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Util.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Util.cs	(revision 9872)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Util.cs	(revision 9872)
@@ -0,0 +1,36 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+
+public class Util {
+  private static Regex formalParameterExpr = new Regex(@"\s*,?\s*((?<refOrOut>(out|ref))\s+)?(?<type>[_\w]*)\s+(?<id>[_\w]*)\s*");
+  public static IEnumerable<TerminalNode.FieldDefinition> ExtractFormalParameters(string formalParameterSrc) {
+    var match = formalParameterExpr.Match(formalParameterSrc);
+    var matches = formalParameterExpr.Matches(formalParameterSrc);
+
+    foreach (var m in matches.OfType<Match>()) {
+      yield return new TerminalNode.FieldDefinition(m.Groups["refOrOut"].Value, m.Groups["type"].Value, m.Groups["id"].Value);
+    }
+  }
+}
