Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs	(revision 10062)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs	(revision 10062)
@@ -0,0 +1,333 @@
+﻿using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CodeGenerator {
+  public class BruteForceCodeGen {
+
+    private string usings = @"
+using System.Collections.Generic;
+using System.Linq;
+using System;
+";
+
+    private string solverTemplate = @"
+namespace ?PROBLEMNAME? {
+  private static class Grammar {
+    ?GRAMMARCLASSCODE?
+  }
+  private sealed class PartiallyProcessedSeq {
+    private PartiallyProcessedSeq parent;
+    private int alt;
+    private IEnumerable<string> remaining;
+    public PartiallyProcessedSeq(IEnumerable<string> alternative) {
+      this.remaining = alternative;
+    }
+    public PartiallyProcessedSeq CreateAlternative(int p, IEnumerable<string> alternative) {
+      var child = new PartiallyProcessedSeq(alternative.Concat(remaining));
+      child.parent = this;
+    }
+    public bool TryProcessToNextSymbolWithAlternatives(out string symbol) {
+      remaining = remaining.SkipWhile(s=>Grammar.NumberOfAlternatives(s)==0);
+      if(remaining.Any()) {
+        symbol = remaining.First();
+        remaining = remaining.Skip(1);
+        return true;
+      } else {
+        symbol = null;
+        return false;
+      }
+      
+    }
+    public IEnumerable<int> Path {
+      get {
+        var cur = this;
+        var List<int> path = new List<int>();
+        while(cur.parent!=null) {
+          path.Append(cur.p);
+          cur = cur.parent;
+        }
+        return path.Reverse();
+      }
+    }
+  }
+  public sealed class ?IDENT?Solver {
+
+    public static void Main(string[] args) {
+      var solver = new ?IDENT?Solver();
+      solver.Start();
+    }
+
+    public ?IDENT?Solver() { 
+      Initialize();
+    }    
+
+    private void Initialize() {
+      ?INITCODE?
+    }
+
+    private bool IsBetter(double a, double b) { 
+      ?MAXIMIZATION? ? a > b : a < b;
+    }
+
+    private IEnumerable<IEnumerator<int>> GeneratePaths() {
+      var queue = new Queue<PartiallyProcessedSeq>();
+      foreach(var alt in Grammar.GetAlternatives(Grammar.RootSymbol)) 
+        queue.Enqueue(new PartiallyProcessedSeq(alt));
+
+      while(queue.Count > 0) {
+        var e = queue.Dequeue();
+        string ntSöymbol;
+        if(e.TryProcessToNextNtSymbol(out ntSymbol)) {
+          int i=0;
+          foreach(var alt in Grammar.GetAlternatives(symbol)) {
+            queue.Enqueue(new e.CreateAlternative(i++, alt));
+          }
+        } else {
+          yield return e.Path;
+        }
+      }
+    }
+
+    ?PATHGENERATORCODE?
+
+    private void Start() {
+      // generate possible paths through the grammar and evaluate each of them    
+      var bestF = ?MAXIMIZATION? ? double.NegativeInfinity : double.PositiveInfinity;
+      foreach(var path in GeneratePaths()) {
+        currentPath = path;
+        var f = Calculate();
+        if(IsBetter(f, bestF)) bestF = f;
+        Console.WriteLine(""{0}\t{1}"",bestF, f);
+      }
+    }
+
+    private IEnumerator<int> currentPath;
+
+    public double Calculate() {
+      try {
+        ?FITNESSFUNCTION?
+      } catch(Exception e) {
+        throw;
+      }
+    }
+
+    ?ADDITIONALCODE?
+
+    ?INTERPRETERSOURCE?
+
+    ?CONSTRAINTSSOURCE?
+  }
+}";
+
+
+    /// <summary>
+    /// Generates the source code for a brute force searcher that can be compiled with a C# compiler
+    /// </summary>
+    /// <param name="ast">An abstract syntax tree for a GPDL file</param>
+    public void Generate(GPDefNode ast) {
+      var problemSourceCode = new StringBuilder();
+      problemSourceCode.AppendLine(usings);
+
+      GenerateProblem(ast, problemSourceCode);
+
+      problemSourceCode.Replace("?PROBLEMNAME?", ast.Name);
+
+      // write to a file for debugging
+      using (var stream = new StreamWriter(ast.Name + ".cs")) {
+        stream.WriteLine(problemSourceCode.ToString());
+      }
+    }
+
+    private void GenerateProblem(GPDefNode ast, StringBuilder problemSourceCode) {
+      var problemClassCode =
+        solverTemplate
+          .Replace("?MAXIMIZATION?", ast.FitnessFunctionNode.Maximization.ToString())
+          .Replace("?GRAMMARCLASSCODE?", GenerateGrammarClassCode(ast))
+          .Replace("?IDENT?", ast.Name)
+          .Replace("?FITNESSFUNCTION?", ast.FitnessFunctionNode.SrcCode)
+          .Replace("?INTERPRETERSOURCE?", GenerateInterpreterSource(ast))
+          .Replace("?INITCODE?", ast.InitCodeNode.SrcCode)
+          .Replace("?ADDITIONALCODE?", ast.ClassCodeNode.SrcCode)
+          .Replace("?CONSTRAINTSSOURCE?", GenerateConstraintMethods(ast.Terminals))
+          .Replace("?PATHGENERATORCODE?", GeneratePathGeneratorCode(ast))
+          ;
+
+      problemSourceCode.AppendLine(problemClassCode).AppendLine();
+    }
+
+    private string GenerateGrammarClassCode(GPDefNode ast) {
+      var sb = new StringBuilder();
+      // RootSymbol
+      sb.AppendFormat("public static string RootSymbol {{ get {{ return {0}; }} }}", ast.Rules.First().NtSymbol).AppendLine();
+      // GetAlternatives
+      sb.AppendFormat("public static IEnumerable<IEnumerable<string>> GetAlternatives(string symbol) {{");
+      sb.AppendFormat("switch(symbol) {{ ").AppendLine();
+      foreach (var ntSymbol in ast.NonTerminals) {
+        sb.AppendFormat("case {0}: {{ ").AppendLine();
+        var rule = ast.Rules.Single(r => r.NtSymbol == ntSymbol.Ident);
+        sb.AppendFormat("return new string[][] {{}}", rule.RuleExpr);
+        sb.AppendLine("break;}}");
+      }
+      foreach (var tSymbol in ast.NonTerminals) {
+
+      }
+      sb.AppendFormat(" else {{ throw new InvalidOperationException(\"Unkown symbol: \"+symbol); }}");
+      sb.AppendLine("}}");
+      sb.AppendFormat("}}").AppendLine();
+
+      // NumberOfAlternatives
+      sb.AppendFormat(
+        "public static int NumberOfAlternatives(string symbol) {{ return GetAlternatives(symbol).Count(); }}").AppendLine();
+      return sb.ToString();
+    }
+
+    // produces helper methods for the attributes of all terminal nodes
+    private string GenerateConstraintMethods(List<SymbolNode> symbols) {
+      var sb = new StringBuilder();
+      var terminals = symbols.OfType<TerminalNode>();
+      foreach (var t in terminals) {
+        sb.AppendLine(GenerateConstraintMethods(t));
+      }
+      return sb.ToString();
+    }
+
+    // generates helper methods for the attributes of a given terminal node
+    private string GenerateConstraintMethods(TerminalNode t) {
+      var sb = new StringBuilder();
+      foreach (var c in t.Constraints) {
+        var fieldType = t.FieldDefinitions.First(d => d.Identifier == c.Ident).Type;
+        if (c.Type == ConstraintNodeType.Range) {
+          sb.AppendFormat("public {0} GetMax{1}_{2}() {{ return {3}; }}", fieldType, t.Ident, c.Ident, c.RangeMaxExpression).AppendLine();
+          sb.AppendFormat("public {0} GetMin{1}_{2}() {{ return {3}; }}", fieldType, t.Ident, c.Ident, c.RangeMinExpression).AppendLine();
+        } else if (c.Type == ConstraintNodeType.Set) {
+          sb.AppendFormat("public {0}[] GetAllowed{1}_{2}() {{ return {3}.ToArray(); }}", fieldType, t.Ident, c.Ident, c.SetExpression).AppendLine();
+        }
+        sb.AppendFormat("public {0} Get{1}_{2}Element(int i) {{ return GetAllowed{1}_{2}()[i]; }}", fieldType, t.Ident, c.Ident);
+      }
+      return sb.ToString();
+    }
+
+
+    // generates code for a breath-first-search generating all possible paths through the grammar
+    private string GeneratePathGeneratorCode(GPDefNode ast) {
+      var sb = new StringBuilder();
+      foreach (var s in ast.NonTerminals) {
+        sb.Append(GeneratePathGeneratorCode(s));
+      }
+      foreach (var s in ast.Terminals) {
+        sb.Append(GeneratePathGeneratorCode(s));
+      }
+      return sb.ToString();
+    }
+
+    // generates code for a breath-first-search generating all possible paths through the grammar
+    private string GeneratePathGeneratorCode(SymbolNode s) {
+      var sb = new StringBuilder();
+
+      return sb.ToString();
+    }
+
+    private string GenerateInterpreterSource(GPDefNode definition) {
+      var sb = new StringBuilder();
+      // create a grammar instance based on the AST
+      var g = new Grammar(definition.NonTerminals, definition.Terminals, definition.Rules);
+      // find formal parameters of root node
+      string formalParameter = definition.NonTerminals.Single(nt => nt.Ident == g.RootSymbol).FormalParameters;
+      // actual parameter are the same as formalparameter only without type identifier
+      var actualParameterEnumerable =
+        Util.ExtractFormalParameters(formalParameter).Select(e => e.RefOrOut + " " + e.Identifier);
+      string actualParameter = string.Empty;
+      // generate a string of actual parameters beginning with: ', a0, a1, ...'
+      if (actualParameterEnumerable.Any()) {
+        foreach (var e in actualParameterEnumerable) {
+          actualParameter += ", " + e;
+        }
+      }
+      // generate entry method for evaluation. This is called from the min/max function
+      // e.g.: ProgramRoot(ref int a0) { ProgramRoot(rootNode , ref a0); }
+      sb.AppendFormat("void {0}({1}) {{ {0}(currentPath {2}); }}", g.RootSymbol, formalParameter, actualParameter).AppendLine();
+
+      // generate methods for all nonterminals and terminals using the grammar instance
+      foreach (var s in definition.NonTerminals) {
+        sb.AppendLine(GenerateInterpreterMethod(g, s));
+      }
+      foreach (var s in definition.Terminals) {
+        sb.AppendLine(GenerateTerminalInterpreterMethod((TerminalNode)s));
+      }
+      return sb.ToString();
+    }
+
+    private string GenerateTerminalInterpreterMethod(TerminalNode s) {
+      var sb = new StringBuilder();
+      // if the terminal symbol has attributes then we must create values for these attributes
+      if (!s.FormalParameters.Any())
+        sb.AppendFormat("private void {0}(IEnumerator<int> path) {{", s.Ident);
+      else
+        sb.AppendFormat("private void {0}(IEnumerator<int> path, {1}) {{", s.Ident, s.FormalParameters);
+
+      // each field must match a formal parameter, assign a value for each parameter
+      foreach (var element in s.FieldDefinitions) {
+        // read next symbol
+        sb.AppendLine("path.MoveNext();");
+        sb.AppendFormat("{0} = Get{1}_{0}Element(path.Current)", element.Identifier, s.Ident).AppendLine(";");
+      }
+      sb.AppendLine("}");
+      return sb.ToString();
+    }
+
+    private string GenerateInterpreterMethod(Grammar g, SymbolNode s) {
+      var sb = new StringBuilder();
+      if (!s.FormalParameters.Any())
+        sb.AppendFormat("private void {0}(IEnumerator<int> path) {{", s.Ident);
+      else
+        sb.AppendFormat("private void {0}(IEnumerator<int> path, {1}) {{", s.Ident, s.FormalParameters);
+      // generate local definitions
+      sb.AppendLine(g.GetLocalDefinitions(s.Ident));
+
+      // read next symbol
+      sb.AppendLine("path.MoveNext();");
+
+      // if there are alternatives for this symbol -> choose alternative based on the path
+      var alts = g.GetAlternatives(s.Ident);
+      if (alts.Count() > 1) {
+        int i = 0;
+        sb.AppendLine("switch(path.Current) {");
+        // generate a case for each alternative
+        foreach (var l in alts) {
+          sb.AppendFormat("case {0}: {{ ", i).AppendLine();
+          foreach (var e in g.GetSequenceWithSemanticActions(s.Ident, i++)) {
+            sb.AppendLine(GenerateSourceForAction(e));
+          }
+          sb.AppendLine("break;").AppendLine("}");
+        }
+        sb.AppendLine("} else throw new System.InvalidOperationException()").AppendLine();
+      } else {
+        foreach (var e in g.GetSequenceWithSemanticActions(s.Ident, 0)) {
+          sb.AppendLine(GenerateSourceForAction(e));
+        }
+      }
+      sb.AppendLine("}");
+      return sb.ToString();
+    }
+
+    // helper for generating calls to other symbol methods
+    private string GenerateSourceForAction(RuleExprNode e) {
+      var action = e as RuleActionNode;
+      var call = e as CallSymbolNode;
+      if (action != null) {
+        return action.SrcCode + ";";
+      } else if (call != null) {
+        if (!call.ActualParameter.Any())
+          return string.Format("{0}(path);", call.Ident);
+        else
+          return string.Format("{0}(path, {1});", call.Ident, call.ActualParameter);
+      } else {
+        throw new ArgumentException();
+      }
+    }
+  }
+}
Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/CodeGenerator.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/CodeGenerator.csproj	(revision 10062)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/CodeGenerator.csproj	(revision 10062)
@@ -0,0 +1,54 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5561A84D-887A-48D8-8E82-CE8B44AD135F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CodeGenerator</RootNamespace>
+    <AssemblyName>CodeGenerator</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BruteForceCodeGen.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Problems.GPDL\3.4\HeuristicLab.Problems.GPDL-3.4.csproj">
+      <Project>{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}</Project>
+      <Name>HeuristicLab.Problems.GPDL-3.4</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/HeuristicLab.Problems.GPDL/CodeGenerator/Properties/AssemblyInfo.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/CodeGenerator/Properties/AssemblyInfo.cs	(revision 10062)
+++ /branches/HeuristicLab.Problems.GPDL/CodeGenerator/Properties/AssemblyInfo.cs	(revision 10062)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CodeGenerator")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("FH-Hagenberg")]
+[assembly: AssemblyProduct("CodeGenerator")]
+[assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5797b262-3624-4e2b-832d-300eaff4f4e9")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/GpdlCompiler.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/GpdlCompiler.csproj	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/GpdlCompiler.csproj	(revision 10062)
@@ -33,59 +33,5 @@
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ALGLIB-3.7.0">
-      <HintPath>..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Algorithms.GeneticAlgorithm-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.ParallelEngine-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.ParallelEngine-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Random-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Selection-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.SequentialEngine-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.SequentialEngine-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System" />
     <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
@@ -94,4 +40,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\CodeGenerator\CodeGenerator.csproj">
+      <Project>{5561a84d-887a-48d8-8e82-ce8b44ad135f}</Project>
+      <Name>CodeGenerator</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.Problems.GPDL\3.4\HeuristicLab.Problems.GPDL-3.4.csproj">
       <Project>{e4ee5afb-d552-447b-8a16-6cbe7938af32}</Project>
Index: /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/Program.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/Program.cs	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/GpdlCompiler/Program.cs	(revision 10062)
@@ -21,4 +21,5 @@
 
 using System;
+using CodeGenerator;
 using HeuristicLab.Problems.GPDL;
 
@@ -31,7 +32,9 @@
       Parser parser = new Parser(scanner);
       parser.Parse();
+      var codeGen = new BruteForceCodeGen();
+
+      codeGen.Generate(parser.AbstractSyntaxTree);
     } else
       Console.WriteLine("-- No source file specified");
   }
-
 }
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/HeuristicLab.Grammars-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/HeuristicLab.Grammars-3.3.csproj	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/HeuristicLab.Grammars-3.3.csproj	(revision 10062)
@@ -105,15 +105,4 @@
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
     </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Windows.Forms.DataVisualization" />
-    <Reference Include="System.Xml.Linq">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data.DataSetExtensions">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln	(revision 10062)
@@ -30,4 +30,19 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Grammars-3.3", "HeuristicLab.Grammars\3.3\HeuristicLab.Grammars-3.3.csproj", "{A5452B63-B33B-4F9F-9E81-98B75EDB5612}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerator", "CodeGenerator\CodeGenerator.csproj", "{5561A84D-887A-48D8-8E82-CE8B44AD135F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{E2060931-6700-464B-9E82-50846D7AE4E9}"
+	ProjectSection(SolutionItems) = preProject
+		Examples\Artificial Ant.txt = Examples\Artificial Ant.txt
+		Examples\EvenParity.txt = Examples\EvenParity.txt
+		Examples\Factorial.txt = Examples\Factorial.txt
+		Examples\Fib.txt = Examples\Fib.txt
+		Examples\LawnMower.txt = Examples\LawnMower.txt
+		Examples\multi-output-multiplier.txt = Examples\multi-output-multiplier.txt
+		Examples\Multiplexer.txt = Examples\Multiplexer.txt
+		Examples\symbreg HEAL.txt = Examples\symbreg HEAL.txt
+		Examples\symbreg Koza.txt = Examples\symbreg Koza.txt
+	EndProjectSection
 EndProject
 Global
@@ -89,4 +104,12 @@
 		{A5452B63-B33B-4F9F-9E81-98B75EDB5612}.Release|x86.ActiveCfg = Release|x86
 		{A5452B63-B33B-4F9F-9E81-98B75EDB5612}.Release|x86.Build.0 = Release|x86
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Release|x64.ActiveCfg = Release|Any CPU
+		{5561A84D-887A-48D8-8E82-CE8B44AD135F}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
@@ -95,4 +118,5 @@
 	GlobalSection(NestedProjects) = preSolution
 		{582440C3-BB33-4683-A5EC-673AB51A7AB3} = {3768D612-38EB-47D8-9E79-75D8E5AB00A8}
+		{E2060931-6700-464B-9E82-50846D7AE4E9} = {3768D612-38EB-47D8-9E79-75D8E5AB00A8}
 	EndGlobalSection
 	GlobalSection(Performance) = preSolution
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 10061)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/HeuristicLab.Problems.GPDL-3.4.csproj	(revision 10062)
@@ -103,15 +103,4 @@
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
     </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Windows.Forms.DataVisualization" />
-    <Reference Include="System.Xml.Linq">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data.DataSetExtensions">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
@@ -153,10 +142,18 @@
   -->
   <PropertyGroup>
-    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
 set Outdir=$(Outdir)
 
-call GenerateFromAtg.cmd</PreBuildEvent>
+call GenerateFromAtg.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+export Outdir=$(Outdir)
+
+$SolutionDir/GenerateFromAtg.sh
+</PreBuildEvent>
   </PropertyGroup>
 </Project>
Index: anches/HeuristicLab.Problems.GPDL/PreBuildEvent.cmd
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/PreBuildEvent.cmd	(revision 10061)
+++ 	(revision )
@@ -1,11 +1,0 @@
-IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
-IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
-IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
-IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
-GOTO Done
-
-:Error_Handling
-ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 
-exit 0
-
-:Done
Index: /branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/SyntaxAnalyzer.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/SyntaxAnalyzer.csproj	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/SyntaxAnalyzer.csproj	(revision 10062)
@@ -33,11 +33,5 @@
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="System" />
     <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
@@ -53,10 +47,18 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
 set Outdir=$(Outdir)
 
-call GenerateFromAtg.cmd</PreBuildEvent>
+call GenerateFromAtg.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+export Outdir=$(Outdir)
+
+$SolutionDir/GenerateFromAtg.sh
+</PreBuildEvent>
   </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /branches/HeuristicLab.Problems.GPDL/Test/Test.csproj
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/Test/Test.csproj	(revision 10061)
+++ /branches/HeuristicLab.Problems.GPDL/Test/Test.csproj	(revision 10062)
@@ -35,74 +35,4 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="ALGLIB-3.7.0">
-      <HintPath>..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Algorithms.GeneticAlgorithm-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Operators-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.ParallelEngine-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.ParallelEngine-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Random-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.SequentialEngine-3.3">
-      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.SequentialEngine-3.3.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System" />
-  </ItemGroup>
   <Choose>
     <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
