Index: branches/HeuristicLab.Problems.GPDL/Build.cmd
===================================================================
--- branches/HeuristicLab.Problems.GPDL/Build.cmd	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/Build.cmd	(revision 9430)
@@ -0,0 +1,104 @@
+@ECHO OFF
+
+SET CLEANBEFOREBUILD=
+
+SET SELECTED=
+SET CONFIGURATION=
+SET PLATFORM=
+
+IF "%~1"=="" GOTO :prompt_solution
+
+SET SELECTED=%1
+IF NOT EXIST %SELECTED% (
+  ECHO Solution file %SELECTED% could not be found.
+  GOTO :end
+)
+ECHO Building solution %SELECTED% ...
+GOTO :config_selection
+
+:prompt_solution
+SET /A COUNT=0
+FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
+  CALL :forloopbody "%%A"
+)
+
+IF "%COUNT%"=="1" (
+  SET SELECTED=%SOLUTIONS.1%
+  ECHO Building %SOLUTIONS.1% as it is the only solution that was found ...
+  GOTO :config_selection
+)
+
+ECHO Found the following solutions:
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
+ECHO.
+SET /P SOLUTIONINDEX=Which solution to build? Type the number: 
+
+SET SELECTED=""
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
+  IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B
+)
+
+IF %SELECTED%=="" GOTO :eof
+
+:config_selection
+IF "%~2"==""  GOTO :prompt_config
+
+SET CONFIGURATION=%~2
+ECHO Building configuration %CONFIGURATION% ...
+GOTO :platform_selection
+
+:prompt_config
+SET /P CONFIGURATION=Which configuration to build [Release]: 
+IF "%CONFIGURATION%"=="" SET CONFIGURATION=Release
+
+:platform_selection
+IF "%~3"=="" GOTO :prompt_platform
+  
+SET PLATFORM=%~3
+ECHO Building platform %PLATFORM% ...
+GOTO :clean
+
+:prompt_platform
+SET /P PLATFORM=Which platform to build [Any CPU]: 
+IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
+
+:clean
+IF "%~4"=="" GOTO :prompt_clean
+
+SET CLEANBEFOREBUILD=%~4
+GOTO :main
+
+:prompt_clean
+SET /P CLEANBEFOREBUILD=Would you like to clean before building [n]: 
+IF "%CLEANBEFOREBUILD%"=="" SET CLEANBEFOREBUILD=n
+
+:main
+REM First find the path to the msbuild.exe by performing a registry query
+FOR /F "tokens=1,3 delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
+  IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B)
+
+REM Then execute msbuild to clean and build the solution
+REM Disable that msbuild creates a cache file of the solution
+SET MSBuildUseNoSolutionCache=1
+REM Run msbuild to clean and then build
+IF "%CLEANBEFOREBUILD%" NEQ "n" (
+  ECHO Cleaning ...
+  %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+)
+ECHO Building ...
+%MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+
+ECHO.
+ECHO DONE.
+
+:end
+
+PAUSE
+
+GOTO :eof
+
+REM This workaround is necessary so that COUNT gets reevaluated
+:forloopbody
+SET /A COUNT+=1
+SET SOLUTIONS.%COUNT%=%1
+GOTO :eof
Index: branches/HeuristicLab.Problems.GPDL/Coco-2/Main.frm
===================================================================
--- branches/HeuristicLab.Problems.GPDL/Coco-2/Main.frm	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/Coco-2/Main.frm	(revision 9430)
@@ -0,0 +1,159 @@
+// ATTENTION: Replace all occurences of "???" by the compiler name! 
+
+// ???.cs                                                        HDO, 2006-08-28
+// -----
+// Main program for compiler generated from ???.atg with Coco-2.
+//=====================================|========================================
+
+using System;
+using System.IO;
+
+using Lex = ???Lex;
+using Syn = ???Syn;
+
+public class ??? {
+
+  private static String NAME = "???";
+  private static bool interactiveMode;
+
+  private static void Abort(String abortKind, String moduleName,
+                            String methName,  String descr) {
+    Console.WriteLine();
+    Console.WriteLine("*** {0} in class {1} method {2}", 
+                      abortKind, moduleName, methName);
+    Console.WriteLine("*** {0}", descr);
+    Console.WriteLine();
+    Console.WriteLine();
+    Console.WriteLine(NAME + " aborted");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    if (interactiveMode) {
+      Console.Write("type [CR] to quit");
+      string dummy = Console.ReadLine();
+    } // if
+    Environment.Exit(Utils.EXIT_FAILURE);
+  } // Abort
+
+  private static int CompileFile(String srcFileName) {
+    FileStream srcFs = null;
+    try {
+      srcFs = new FileStream(srcFileName, FileMode.Open);
+    } catch (Exception) {
+      Console.WriteLine("*** file \"{0}\" not found", srcFileName);
+      return Utils.EXIT_FAILURE;
+    } // try/catch
+    try {
+      Lex.src = new StreamReader(srcFs);
+      Console.WriteLine("parsing ...");
+      Syn.Parse();
+      Lex.src.Close();
+      Lex.src.Dispose();
+      Lex.src = null;
+      if (Errors.NumOfErrors() > 0) {
+        Console.WriteLine("listing ...");
+        String lstFileName = Path.ChangeExtension(srcFileName, ".lst");
+        FileStream lstFs = null;
+        try {
+          lstFs = new FileStream(lstFileName, FileMode.Create);
+        } catch (Exception) {
+          Utils.FatalError(NAME, "CompileFile", "file \"{0}\" not created", lstFileName);
+          return Utils.EXIT_FAILURE;
+        } // try/catch
+        StreamWriter lstWriter = null;
+        try {
+          lstWriter = new StreamWriter(lstFs);
+          StreamReader srcFsReader = null;
+          try { // open the source file a second time to generate the error listing
+            srcFsReader = new StreamReader(new FileStream(srcFileName, FileMode.Open));
+            lstWriter.WriteLine(NAME + " (file: \"{0}\")", srcFileName);
+            Errors.GenerateListing(srcFsReader, lstWriter, Errors.ListingShape.longListing);
+          } finally {
+            srcFsReader.Close();
+            srcFsReader.Dispose();
+          } // try/finally
+          Console.WriteLine("{0} error(s) detected", Errors.NumOfErrors());
+        } finally {
+          lstWriter.Close();
+          lstWriter.Dispose();
+        } // try/finally
+      } else 
+        Console.WriteLine("no errors detected");
+    } finally {
+      if (Lex.src != null) {
+        Lex.src.Close();
+        Lex.src.Dispose();
+        Lex.src = null;
+      } // if
+      Utils.Modules(Utils.ModuleAction.resetModule);
+    } // try/finally to make sure srcFs and srcReader are closed
+    return Utils.EXIT_SUCCESS;
+  } // CompileFile
+
+
+  public static void Main(String[] args) {
+  //-----------------------------------|----------------------------------------
+    int result = 0;
+
+    // --- install modules ---
+    Utils.InstallModule("Utils",   new Utils.ModuleMethodDelegate(Utils.UtilsMethod ));
+    Utils.InstallModule("Sets",    new Utils.ModuleMethodDelegate(Sets.SetsMethod  ));
+    Utils.InstallModule("Errors",  new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));
+
+    Utils.InstallModule("???Lex",  new Utils.ModuleMethodDelegate(???Lex.???LexMethod));
+    Utils.InstallModule("???Sem",  new Utils.ModuleMethodDelegate(???Sem.???SemMethod));
+    Utils.InstallModule("???Syn",  new Utils.ModuleMethodDelegate(???Syn.???SynMethod));
+
+    // --- initialize modules ---
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    Errors.PushAbortMethod(new Errors.AbortMethod(Abort));
+
+    Console.WriteLine("---------------------------");
+    Console.WriteLine(" {0} Compiler {1," + (5 - NAME.Length) +"} Version X  ", NAME, "");
+    Console.WriteLine(" Frontend gen. with Coco-2");
+    Console.WriteLine("---------------------------");
+    Console.WriteLine();
+
+    if (args.Length > 0) { // command line mode
+      interactiveMode = false;
+      Console.WriteLine();
+      int i = 0;
+      do {
+        Console.WriteLine("source file \"{0}\"", args[i]);
+        result = CompileFile(args[i]);
+        if (result != Utils.EXIT_SUCCESS)
+          Environment.Exit(result);
+        Console.WriteLine();
+        i++;
+      } while (i < args.Length);
+    } else { // args.Length == 0, interactive mode
+      interactiveMode = true;
+      for (;;) {
+        String srcFileName;
+        Utils.GetInputFileName("source file > ", out srcFileName);
+        if (srcFileName.Length > 0) {
+          result = CompileFile(srcFileName);
+          if (result != Utils.EXIT_SUCCESS)
+            Environment.Exit(result);
+        } // if
+        char answerCh;
+        do {
+          Console.WriteLine();
+          Console.Write("[c]ontinue or [q]uit > ");
+          answerCh = Char.ToUpper(Console.ReadKey().KeyChar);
+        } while (answerCh != 'C' && answerCh != 'Q');
+        if (answerCh == 'Q')
+          break;
+        else // answerCh == 'C'
+          Console.WriteLine();
+      } // for
+    } // else
+
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Environment.Exit(Utils.EXIT_SUCCESS);
+
+  } // Main
+
+} // ???
+
+// End of ???.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSem.frm
===================================================================
--- branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSem.frm	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSem.frm	(revision 9430)
@@ -0,0 +1,66 @@
+// ==>ModuleName.cs                                              HDO, 2006-08-28
+// -------------
+// Semantic evaluator for table-driven top-down parsing.
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+
+using Lex = ==>LexName;
+using Syn = ==>SynName;
+
+public class ==>ModuleName {
+
+
+  public const String MODULENAME = "==>ModuleName";
+
+  public static void ==>ModuleNameMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        return;
+    } // switch
+  } // ==>ModuleNameMethod
+
+
+  // *** start of global SYN and SEM declarations from ATG ***
+  
+==>GlobalDeclarations
+  // *** end of global SYN and SEM declarations from ATG ***
+
+  ==>SemanticMethods
+
+  public delegate void PragmaMethod();
+  public static PragmaMethod[] pragmaMethods = {
+      ==>PragmaMethodsInit
+    };
+
+
+  public static void StartSem() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          ==>GrammarRootName();
+          break;
+      } // switch
+    } // for
+  } // StartSem
+
+    
+} // ==>ModuleName
+
+// End of ==>ModuleName.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSyn.frm
===================================================================
--- branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSyn.frm	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/Coco-2/PGTSyn.frm	(revision 9430)
@@ -0,0 +1,520 @@
+// ==>ModuleName.cs                                              HDO, 2006-08-28
+// -------------
+// Table-driven top-down syntax analyzer (G-code interpreter).
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+// --- call pragma mehts. and exec. sem. acts. after syntax errors? ---
+#define CONTPRAGMAACTS            // !!!must be defined for SG and PGT!!! 
+#undef  CONTSEMACTS               // should not be defined 
+
+using System;
+using System.Text;
+
+using Lex = ==>LexName;
+using Sem = ==>SemName;
+
+public class ==>ModuleName {
+                   
+  public static String MODULENAME = "==>ModuleName";
+
+  // --- G-code instructions ---
+  public enum Instruction {
+    T, TA, TC, TCA, NT, NTA, ANY, ANYA, EPS, EPSA, JMP, RET
+  } // Instruction
+
+==>GlobalDeclarations
+
+  // --- other constants ---
+  private const int MINERRDIST   =   3;
+  private const int MAXSTACKLEN  = 100;
+  private const int EOFTOK       =   0;
+  private const int FIRSTNONTERM = LASTPRAGMA + 1;
+
+  public class NTData {
+    public int          startPC;
+    public bool         del;
+    public Sets.Set256  firstSet;
+    public NTData(int startPC, bool del, Sets.Set256 firstSet) {
+      this.startPC  = startPC;
+      this.del      = del;
+      this.firstSet = firstSet;
+    } // NTData
+  } // NTData
+  
+  private class GrammarTable {
+    public int[]  header = {
+      ==>header
+    };
+    public byte[] code = {
+      ==>code
+    };
+    public NTData[] nts = {
+      ==>nts
+    };
+    public Sets.Set256[] epsSets = {
+      ==>epsSets
+    };
+    public Sets.Set256[] anySets = {
+      ==>anySets
+    };
+    public String[] names = {
+      ==>names
+    };
+  } // GrammarTable;
+
+  private static GrammarTable gt;
+
+  private static int   pc;             // G-code counter
+  private static int[] stk;            // stack of G-code return adresses
+  private static int   sp;             // stack pointer
+  private static bool  mustRead;       // next Lex.token to read
+  private static int   altRoot;        // root of alternative chain
+  private static bool  leaveOrEnter;   // leaveCnt > 0 OR enterCnt > 0
+  private static int   leaveCnt;       // nr. of sem. proc. to leave
+  private static int   enterCnt;       // nr. of sem. proc. to enter
+  private static int   errDist;        // current error distance
+  private static int[] stkAtErr;       // saved stack at error position
+  private static int[] newSP;          // new stack length
+  private static int[] newPC;          // pc after recovery
+
+
+  public static void ==>ModuleNameMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        Errors.InstallStopParsingMethod(StopParsing);
+        gt       = new GrammarTable();
+        stk      = new int[MAXSTACKLEN];
+        stkAtErr = new int[MAXSTACKLEN];
+        newSP    = new int[LASTTERM + 1];
+        newPC    = new int[LASTTERM + 1];
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        gt       = null;
+        stk      = null;
+        stkAtErr = null;
+        newSP    = null;
+        newPC    = null;
+        break;
+    } // switch
+  } // ==>ModuleNameMethod
+
+  private static void Push(int pc) {
+    if (sp < MAXSTACKLEN)
+      stk[sp++] = pc;
+    else
+      Errors.Restriction(MODULENAME, "Push", "parser stack overflow");
+  } // Push
+
+  private static int Pop() {
+    if (sp > 0)
+      return stk[--sp];
+    else {
+      Errors.CompilerError(MODULENAME, "Pop", "parser stack underflow");
+      return 0;
+    } // else
+  } // Pop
+
+  private static void GetNextToken() {
+    for (;;) {
+      Lex.GetToken(); // updates Lex.token
+      if (Lex.token <= LASTTERM)
+        return;
+  #if !CONTPRAGMAACTS
+      if (NumOfSynErrors() == 0)
+  #endif
+        Sem.pragmaMethods[Lex.token - LASTTERM - 1]();
+    } // for
+  } // GetNextToken
+
+  private static int AdrAt(int pc) {
+    return (gt.code[pc - 1] |
+           (gt.code[pc    ] << 8));
+  } // AdrAt
+
+  private static void AdjustPC(ref int pc) {
+    if (pc == 0)
+      return;
+    for (;;)
+      switch ((Instruction)gt.code[pc - 1]) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+        case Instruction.NT:
+        case Instruction.NTA:
+        case Instruction.ANY:
+        case Instruction.ANYA:
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          return;
+        case Instruction.JMP:
+          pc = AdrAt(pc + 1);
+          break;
+        case Instruction.RET:
+          pc = 0;
+          return;
+        default:
+          pc++; // syn. or sem. action
+          break;
+      } // switch
+  } // AdjustPC
+
+  private static void GetSymInstr(int pc, 
+                        out int opcode, out int sy, out int nextPC, out int altPC) {
+    opcode = gt.code[pc - 1];
+    nextPC = 0; // dummy init
+    altPC  = 0; // dummy init 
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.TA:
+      case Instruction.TC:
+      case Instruction.TCA:
+      case Instruction.ANYA:
+      case Instruction.EPS:
+      case Instruction.EPSA:
+        sy = gt.code[pc];
+        break;
+      case Instruction.NT:
+      case Instruction.NTA:
+        sy = gt.code[pc] + FIRSTNONTERM;
+        break;
+      default: // ANY, JMP, RET, SEM, SYN 
+        sy = 0;
+        break;
+    } // switch
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.EPS:
+        nextPC = pc + 2;
+        altPC = 0;
+        break;
+      case Instruction.TC:
+      case Instruction.NT:
+        nextPC = pc + 3;
+        altPC = 0;
+        break;
+      case Instruction.TA:
+      case Instruction.ANYA:
+      case Instruction.EPSA:
+        nextPC = pc + 4;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.TCA:
+      case Instruction.NTA:
+        nextPC = pc + 5;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.ANY:
+        nextPC = pc + 1;
+        altPC = 0;
+        break;
+    } // switch
+    AdjustPC(ref nextPC);
+    AdjustPC(ref altPC);
+  } // GetSymInstr
+
+  private static void Fill(int pc, int sp) {
+    int opcode, sy, nextPC, altPC, i;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+          newPC[sy] = pc;
+          newSP[sy] = sp;
+          break;
+        case Instruction.NT:
+        case Instruction.NTA:
+          for (i = 0; i <= LASTTERM; i++)
+            if (Sets.member((ushort)i, gt.nts[sy - FIRSTNONTERM].firstSet)) {
+              newPC[i] = pc;
+              newSP[i] = sp;
+            }
+          if (gt.nts[sy - FIRSTNONTERM].del)
+            Fill(nextPC, sp);
+          break;
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          Fill(nextPC, sp);
+          break;
+      } // switch
+      pc = altPC;
+    } // while
+  } // Fill
+
+  private static void FillSucc(int pc, int sp) {
+    int opcode, sy, nextPC, altPC;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      if (nextPC > 0)
+        Fill(nextPC, sp);
+      pc = altPC;
+    } // while
+  } // FillSucc
+
+  private static void Triple(int altRoot) {
+    for (int i = 0; i <= LASTTERM; i++) { // clear triple list
+      newPC[i] = 0;
+      newSP[i] = 0;
+    } // for
+    for (int i = 1; i <= sp; i++) {       // successors of stacked nt's
+      FillSucc(stk[i - 1], i - 1);
+      Fill(stk[i - 1], i - 1);
+    } // for
+    FillSucc(altRoot, sp);                // successors of alt. chain
+    Fill(altRoot, sp);                    // current alt. chain
+  } // Triple
+
+  private static void HandleSynErr(ref int pc, ref int altRoot) {
+    int     opcode, sy, nextPC, altPC, adjPC, nwSP, eq;
+    bool    nameInMsg;
+    String  name;
+    StringBuilder msg = new StringBuilder();
+    leaveOrEnter = false;
+    if (errDist >= MINERRDIST) { // --- primary error
+      nameInMsg = false;
+      adjPC = altRoot;
+      AdjustPC(ref adjPC);
+      while (adjPC > 0) {
+        GetSymInstr(adjPC, out opcode, out sy, out nextPC, out altPC);
+        if ( (Instruction)opcode >= Instruction.T  && 
+             (Instruction)opcode <= Instruction.NTA  ) {
+          if ( gt.names[sy].IndexOf(' ') >= 0 || 
+               !Char.IsLetter(gt.names[sy][0]) )
+            name = "\"" + gt.names[sy] + "\"";
+          else
+            name = gt.names[sy];
+          if (name.IndexOf('{') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("{", "{{");
+          if (name.IndexOf('}') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("}", "}}");
+          if (msg.Length + name.Length + 2 > 80) {
+            msg.Append(" ...");
+            break;
+          } // if
+          if (!nameInMsg) {
+            nameInMsg = true;
+            msg.Append("expected: " + name);
+          } else {
+            msg.Append(", ");
+            msg.Append(name);
+          } // else
+        } // if
+        adjPC = altPC;
+      } // while
+      if (!nameInMsg)
+        msg.Append("syntax error");
+      Errors.SynError(Lex.tokenLine, Lex.tokenCol, msg.ToString(), "");
+      Triple(altRoot);
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      leaveCnt = sp - nwSP;
+      enterCnt = 0;
+      Array.Copy(stk, stkAtErr, stk.Length); // save stack
+    } else {                 // --- spurios error
+      if (errDist == 0) {    // no token used since last error
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // if
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter) 
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      eq = 2;                // compare stkAtErr and stk
+      while (eq <= sp && eq <= nwSP && stkAtErr[eq - 1] == stk[eq - 1])
+        eq++;
+      eq--;                  // stacks are equal up to index eq
+      leaveCnt = sp - eq;
+      if (nwSP < eq) {
+        leaveCnt = sp - nwSP;
+        enterCnt = 0;
+      } else if (nwSP > eq)
+        enterCnt = nwSP - eq;
+      else // nwSP == eq
+        enterCnt = 0;
+      Array.Copy(stkAtErr, stk, stk.Length); // restore stack
+    } // else
+    leaveOrEnter = (leaveCnt + enterCnt) > 0;
+    sp = nwSP;
+    pc = newPC[Lex.token];
+    altRoot = pc;
+    errDist = 0;
+  } // HandleSynErr
+
+  public static int Interpret() {
+  //-----------------------------------|----------------------------------------
+    int actionNr, opcode, currPC;
+    for (;;) {
+      opcode = gt.code[pc - 1];
+      if ( !leaveOrEnter && mustRead && 
+           (Instruction)opcode <= Instruction.EPSA ) {
+        GetNextToken();
+        mustRead = false;
+        errDist++;
+        altRoot = pc;
+      } // if
+      if (leaveOrEnter) {
+        if (leaveCnt > 0) {
+          leaveCnt--;
+          actionNr = 0;
+        } else { // enterCnt > 0
+          enterCnt--;
+          actionNr = gt.code[stkAtErr[sp - enterCnt - 1] - 2];
+        } // else
+        leaveOrEnter = (leaveCnt + enterCnt) > 0;
+        return actionNr;
+      } // if
+      pc++;
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+          if (Lex.token == gt.code[pc - 1])
+            if (Lex.token != EOFTOK) {
+              pc++;
+              mustRead = true;
+            } else {
+              return 0;
+            } // else
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.TC:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 2;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TCA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 4;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.NT:
+          currPC = gt.code[pc - 1];
+          if ( gt.nts[currPC].del || 
+               Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet) ) {
+            pc++;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.NTA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet)) {
+            pc += 3;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.ANY:
+          mustRead = true;
+          break;
+        case Instruction.ANYA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.anySets[currPC - 1])) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.EPS:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc++;
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.EPSA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc += 3;
+          else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.JMP:
+          pc = AdrAt(pc);
+          break;
+        case Instruction.RET:
+          pc = Pop();
+          altRoot = pc;
+          return 0;
+        default:
+          if (opcode <= 128) {
+  #if !CONTSEMACTS
+          if (Errors.NumOfSynErrors() == 0)
+  #endif
+            return opcode - 12;
+          } else // opcode > 128
+            return opcode - 128;
+          break;
+      } // switch
+    } // for
+  } // Interpret
+
+
+  public static bool Parse() {
+  //-----------------------------------|----------------------------------------
+    Lex.InitLex();
+    sp           = 0;
+    pc           = ROOTPC;
+    altRoot      = pc;
+    mustRead     = true;
+    errDist      = MINERRDIST + 1;
+    leaveOrEnter = false;
+    leaveCnt     = 0;
+    enterCnt     = 0;
+    Sem.StartSem();
+    return Errors.NumOfSynErrors() == 0;
+  } // Parse
+
+
+  public static void StopParsing() {
+  //-----------------------------------|----------------------------------------
+    leaveCnt     = sp + 1;
+    enterCnt     = 0;
+    leaveOrEnter = true;
+  } // StopParsing
+
+} // ==>ModuleName
+ 
+// End of ==>ModuleName.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/Coco-2/SGLex.frm
===================================================================
--- branches/HeuristicLab.Problems.GPDL/Coco-2/SGLex.frm	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/Coco-2/SGLex.frm	(revision 9430)
@@ -0,0 +1,260 @@
+// ==>ModuleName.cs                                              HDO, 2006-08-28
+// -------------
+// Lexical analyzer (finite-state machine interpreter).
+// Generated by Coco-2 (SG).
+//=====================================|========================================
+
+#undef TEST_Lex
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Text;
+
+public class ==>ModuleName {
+
+  public const String MODULENAME = "==>ModuleName";
+  public const int    EOFSPIX    = 1;
+
+  public static TextReader src;
+
+  // --- token information ---
+  public static int    token;               // current token
+  public static int    tokenLine, tokenCol; // position of current token
+  public static String tokenStr;            // token string recognized
+
+  // --- current char. info, for "power users" only ---
+  public static char   curCh;               // current input character
+  public static int    curLine, curCol;     // position of curCh
+
+
+  public static void ==>ModuleNameMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        caseSensitive = ==>CaseSensitivity;
+        lt            = new LexicalTable();
+        tokenStrArr   = new char[256];
+        kwHt          = CreateHashtable();
+        nHt           = CreateHashtable();
+        nl            = new ArrayList();
+        break;
+      case Utils.ModuleAction.resetModule:
+        kwHt.Clear();
+        nHt.Clear();
+        nl.Clear();
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        lt            = null;
+        tokenStrArr   = null;
+        kwHt          = null;
+        nHt           = null;
+        nl            = null;
+        break;
+    } // switch
+  } // ==>ModuleNameMethod
+
+  private static  Hashtable CreateHashtable() {
+    if (caseSensitive)
+      return new Hashtable();
+    else
+      return CollectionsUtil.CreateCaseInsensitiveHashtable();
+  } // CreateHashtable
+
+
+  public static void InitLex() {
+  //-----------------------------------|----------------------------------------
+    // --- initialize keyword hash table  ---
+    kwHt.Clear();
+    ==>Initialisations
+    // --- initialize name data structures  ---
+    nHt.Clear();
+    nl.Clear();
+    nl.Add("");      // so spix = 0 is the empty string
+    nl.Add("!EOF!"); // so EOFSPIX = 1
+    // --- (re)set global data ---
+    curLineStr  = "";
+    curCh       = ' ';
+    curLine     = 0;
+    curCol      = 2;
+    tokenStr    = null;
+    token       = 0;
+    tokenCol    = 0;
+    tokenLine   = 0;
+    tokenStrLen = 0;
+    pendingEOLs = 0;
+    apxLen      = pendingEOLs; // to prevent warning
+  } // InitLex
+
+  private static void EnterKeyword(int token, String keyword) {
+    kwHt.Add(keyword, token);
+  } // EnterKeyword
+
+
+  // *** start of global LEX declarations from ATG ***
+  ==>GlobalDeclarations
+  // *** end of global LEX declarations from ATG ***
+
+
+  public static bool caseSensitive;
+
+  private class LexicalTable {
+    public int   header = ==>header;
+    public int[] startTab = {
+        ==>startTab
+      };
+    public Sets.Set256 ignoredChars = new Sets.Set256(
+        ==>ignoredChars
+      );
+    public Sets.Set256 commentStart = new Sets.Set256(
+        ==>commentStart
+      );
+    public Sets.Set256[] cls = {
+        ==>cls
+      };
+  } // LexicalTable
+
+  private static LexicalTable lt;
+  private static Hashtable    kwHt;  // hash table for keywords: string -> token 
+  private static Hashtable    nHt;   // hash table for names: string -> null 
+  private static ArrayList    nl;    // name list  for names, index is spix
+
+  private static String curLineStr;  // current source line
+  private static char[] tokenStrArr; // token string in an array
+  private static int    tokenStrLen; // length of token string in tokenStrArr
+  private static int    state;       // current automaton state
+  private static int    apxLen;      // length of appendix in token string
+  private static int    pendingEOLs; // nr of EOLs found in comment
+
+  // --- to save and restore scanner state ---
+  private static char   savedCh;
+  private static int    savedCol, savedLine;
+
+  private static void SaveScannerState() {
+    savedCh      = curCh;
+    savedCol     = curCol;
+    savedLine    = curLine;
+  } // SaveScannerState
+
+  private static void RestoreScannerState() {
+    tokenStrLen -= apxLen;
+    apxLen       = 0;
+    curCh        = savedCh;
+    curCol       = savedCol;
+    curLine      = savedLine;
+  } // RestoreScannerState
+
+
+  public static void NextCh() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      ==>NextChMethodFront
+      if (curCol < curLineStr.Length) {         // within line
+        curCol++;
+        curCh = curLineStr[curCol - 1];
+        return;
+      } else if (curCol == curLineStr.Length) { // end of line
+        curCol++;
+        curCh = Utils.LF; // to separate lines
+        return;
+      } else { // curCol > curLineStr.Length
+        curLineStr = src.ReadLine();
+        curLine++;
+        curCol = 0;
+        if (curLineStr == null) {               // end of file
+          curLineStr = "";
+          curCh = Utils.EF;
+          return;
+        } // if
+      } // else
+    } // for
+  } // NextCh
+
+
+  private static void CommentErr() {
+    Errors.LexError(curLine, curCol, "end of file in comment");
+  } // CommentErr
+
+  private static bool Comment() {
+    ==>CommentMethod
+    return false;
+  } // Comment
+
+  private static void HandleLexErr() {
+    Errors.LexError(curLine, curCol, 
+                    "invalid character '{0}' (hex {1:X})", curCh, (int)curCh);
+    if (apxLen > 0)
+      RestoreScannerState();
+  } // HandleLexErr
+
+
+  public static void GetToken() {
+  //-----------------------------------|----------------------------------------
+    token = -1;
+    tokenStr = null;
+    do {
+      ==>GetTokenMethodFront
+      // --- scan for next token ---
+      tokenLine   = curLine;
+      tokenCol    = curCol;
+      tokenStrLen = 0;
+      apxLen      = 0;
+      state = (curCh == Utils.EF) ? 1 : lt.startTab[curCh];
+      for (;;) {
+        tokenStrArr[tokenStrLen++]= curCh;
+        NextCh();
+        switch (state) {
+          case 0:
+            Errors.LexError(tokenLine, tokenCol, "invalid token start");
+            break;
+          case 1:
+            token = 0;
+            tokenStrLen = 0;
+            break;                      // EOF recognized
+          ==>GetTokenMethodCaseBody
+        } // switch
+        break;
+      } // for
+    } while (token < 0);
+    if (tokenStr == null)
+      tokenStr = new String(tokenStrArr, 0, tokenStrLen);
+  } // GetToken
+
+  private static int KeywordCheck() {
+    tokenStr = new String(tokenStrArr, 0, tokenStrLen - apxLen);
+    Object token = kwHt[tokenStr];
+    return (token == null) ? -1 : (int)token;
+  } // KeywordCheck
+
+
+  public static int Hash(String s) {
+  //-----------------------------------|----------------------------------------
+    Object spix = nHt[s];
+    if (spix == null) {
+      if (caseSensitive)
+        nl.Add(s);
+      else
+        nl.Add(s.ToUpper());
+      spix   = nl.Count - 1;
+      nHt[s] = spix;
+    } // if
+    return (int)spix;
+  } // Hash
+  
+  
+  public static String HashedStr(int spix) {
+  //-----------------------------------|----------------------------------------
+    return (String)nl[spix];
+  } // HashedStr
+
+
+  ==>TokenClass&PragmaMethodsImpls
+
+} // ==>ModuleName
+
+// End of ==>ModuleName.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/GenerateFromAtg.cmd
===================================================================
--- branches/HeuristicLab.Problems.GPDL/GenerateFromAtg.cmd	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/GenerateFromAtg.cmd	(revision 9430)
@@ -0,0 +1,6 @@
+cd %SolutionDir%\Coco-2
+SG  %ProjectDir%\GPDef.atg
+PGT %ProjectDir%\GPDef.atg
+
+cd %ProjectDir%
+mv %SolutionDir%\Coco-2\*.cs .
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CreateProblemMenuItem.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CreateProblemMenuItem.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CreateProblemMenuItem.cs	(revision 9430)
@@ -0,0 +1,324 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Views;
+using HeuristicLab.Optimizer;
+
+namespace HeuristicLab.Problems.GPDL.Views {
+  internal class CreateProblemMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
+    private const string gpdlString = @"
+PROBLEM ArtificialAnt
+
+CODE <<
+public struct Point { 
+  public int x; public int y; 
+  public Point(int x, int y) {
+    this.x = x;
+	this.y = y;
+  }
+};
+
+class World {
+
+private static string[] LosAltosTrail = new string[] {
+"" ###                                          "",
+""   #                                  .###..  "",
+""   #                                  #    #  "",
+""   #                                  #    #  "",
+""   ####.#####           .############..    .  "",
+""            #           .                  #  "",
+""            #           #                  .  "",
+""            #           #                  .  "",
+""            #           #                  #  "",
+""            .           #                  .  "",
+""            #           .                  .  "",
+""            #           .                  #  "",
+""            #           #                  .  "",
+""            #           #            ...###.  "",
+""            .       .#...            #        "",
+""            .       .                .        "",
+""            #       .                .        "",
+""            #       #                .#...    "",
+""            #       #                    #    "",
+""            #       #                    .    "",
+""            #       #                    .    "",
+""            #       .                ...#.    "",
+""            #       .                #        "",
+"" ..##..#####.       #                #        "",
+"" #                  #                #        "",
+"" #                  #                #        "",
+"" #                  #                #        "",
+"" #                  #                #        "",
+"" #                  #                #        "",
+"" #     .#####....##..                #        "",
+"" #     #                             #        "",
+"" .     #                             #        "",
+"" .####..                             #        "",
+""                                   #.#        "",
+""                                   #          "",
+""                                   #          "",
+""                                   #          "",
+""                                   #          "",
+""                                   #          "",
+""                                   #          "",
+""                                   #          "",
+""                              ######          "",
+""                              .               "",
+""                              #               "",
+""                              #               "",
+""                              #               "",
+""                              #               "",
+""                              #               "",
+""                              #               "",
+""                            #..               "",
+""                            #                 "",
+""                            #                 "",
+""                            #                 "",
+""                            #                 "",
+""                            #                 "",
+""                      .######                 "",
+""                      .                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       "",
+""                      #                       ""
+};
+  private char[][] world = LosAltosTrail.Select(l=>l.ToArray()).ToArray();
+  public int TotalFood = LosAltosTrail.Select(l=>l.Where(c=>c=='#').Count()).Sum();
+  public int Width { get { return 100; } }
+  public int Height { get { return 100; } }
+  
+  public void Reset() {
+    world = LosAltosTrail.Select(l=>l.ToArray()).ToArray();
+  }
+  
+  public bool FoodAt(Point p) {
+    if(p.x < 0 || p.y < 0) return false;
+    if(world.Length <= p.y) return false;
+	if(world[p.y].Length <= p.x) return false;
+    return world[p.y][p.x] == '#';
+  }
+  public void RemoveFoodAt(Point p) {
+    if(world.Length < p.y) return;
+	if(world[p.y].Length < p.x) return;
+    world[p.y][p.x] = ' ';
+  }
+}
+
+enum Direction {West, East, North, South};
+
+class AntState {
+  public Point Position { get; set;} 
+  public int MaxSteps { get; set;}
+  public Direction Direction { get; set; }
+  public World World { get; set; }
+  public int Steps { get; set; }
+  public int FoodEaten { get; set; }
+ 
+  public AntState() {
+    Steps = 0;	
+	FoodEaten = 0;
+  }
+ 
+  public void TurnLeft() {
+    Steps++;
+    switch(Direction) {
+	  case Direction.West: Direction = Direction.South; break;
+	  case Direction.South: Direction = Direction.East; break;
+	  case Direction.East: Direction = Direction.North; break;
+	  case Direction.North: Direction = Direction.West; break;
+	}
+  }
+  public void TurnRight() {
+    Steps++;
+    switch(Direction) {
+	  case Direction.West: Direction = Direction.North; break;
+	  case Direction.South: Direction = Direction.West; break;
+	  case Direction.East: Direction = Direction.South; break;
+	  case Direction.North: Direction = Direction.East; break;
+	}
+  }
+  public void MoveForward() { 
+    Position = NextPosition; 
+	Steps++; 
+	if(World.FoodAt(Position)) {
+    	World.RemoveFoodAt(Position);
+		FoodEaten++;
+    }
+  }
+  public Point NextPosition { 
+    get { 
+	    int x, y;
+        switch(Direction) {
+    	  case Direction.West: 
+		    x = (Position.x + World.Width - 1) % World.Width;
+			y = Position.y;
+			return new Point(x, y);
+    	  case Direction.South: 
+  		    x = Position.x;
+			y = (Position.y + World.Height + 1) % World.Height;
+			return new Point(x, y);
+    	  case Direction.East:
+  		    x = (Position.x + World.Width + 1) % World.Width;
+			y = Position.y;
+			return new Point(x, y);
+    	  case Direction.North:
+  		    x = Position.x;
+			y = (Position.y + World.Height - 1) % World.Height;
+			return new Point(x, y);
+    	}
+ 		return new Point(-1,-1);
+    } 
+  }  
+}
+
+World CreateWorld() {   
+  var w = new World();
+  Console.WriteLine(""Total food: ""+w.TotalFood);
+  return w;
+}
+
+World world;
+>>
+INIT <<
+  world = CreateWorld();
+>>
+
+NONTERMINALS
+  Ant<<World world, AntState state>>. 
+  IfFoodAhead<<World world, AntState state>>.
+  Prog2<<World world, AntState state>>.
+  Prog3<<World world, AntState state>>.
+
+TERMINALS
+  Left<<>> CONSTRAINTS .
+  Right<<>> CONSTRAINTS .
+  Move<<>> CONSTRAINTS .
+ 
+RULES
+  Ant<<World world, AntState state>> = 
+    IfFoodAhead<<world, state>>
+    | Prog2<<world, state>>
+    | Prog3<<world, state>>
+    | Left<<>>                                         SEM << state.TurnLeft(); >>
+    | Right<<>>                                        SEM << state.TurnRight(); >>
+    | Move<<>>                                         SEM << state.MoveForward(); >>
+    .
+    
+  IfFoodAhead<<World world, AntState state>> =     
+                                                   SEM <<
+                                                      if(world.FoodAt(state.NextPosition)) {
+                                                   >>
+                                                   
+    Ant<<world, state>>                            SEM << } else { >>
+    Ant<<world, state>>                            SEM << } >> 
+  .
+
+  Prog2<<World world, AntState state>> = 
+    Ant<<world, state>> Ant<<world, state>>
+  .
+  
+  Prog3<<World world, AntState state>> =
+    Ant<<world, state>> Ant<<world, state>> Ant<<world, state>>
+  .
+
+
+MAXIMIZE                                                   /* could also use the keyword MINIMIZE here */
+  <<    
+    world.Reset();
+    var state = new AntState() {Position = new Point(0,0), MaxSteps=400, Direction=Direction.East, World = world};
+    while(state.Steps < state.MaxSteps) {
+      Ant(world, state);
+    }
+    return (double)state.FoodEaten;
+  >>  
+END ArtitificialAnt.
+";
+
+    
+    public override string Name {
+      get { return "Create &Problem"; }
+    }
+    public override IEnumerable<string> Structure {
+      get { return new string[] { "&Edit" }; }
+    }
+    public override int Position {
+      get { return 3000; }
+    }
+    public override string ToolTipText {
+      get { return "Create a genetic programming problem from a GPDL definition."; }
+    }
+
+    protected override void OnToolStripItemSet(EventArgs e) {
+      ToolStripItem.Enabled = true;
+    }
+    protected override void OnActiveViewChanged(object sender, EventArgs e) {
+      ToolStripItem.Enabled = true;
+    }
+    protected override void OnViewChanged(object sender, EventArgs e) {
+      base.OnViewChanged(sender, e);
+      ToolStripItem.Enabled = true;
+    }
+
+    public override void Execute() {
+      Utils.InstallModule("Utils", new Utils.ModuleMethodDelegate(Utils.UtilsMethod));
+      Utils.InstallModule("Sets", new Utils.ModuleMethodDelegate(Sets.SetsMethod));
+      Utils.InstallModule("Errors", new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));
+
+      Utils.InstallModule("GPDefLex", new Utils.ModuleMethodDelegate(GPDefLex.GPDefLexMethod));
+      Utils.InstallModule("GPDefSem", new Utils.ModuleMethodDelegate(GPDefSem.GPDefSemMethod));
+      Utils.InstallModule("GPDefSyn", new Utils.ModuleMethodDelegate(GPDefSyn.GPDefSynMethod));
+
+      // --- initialize modules ---
+      Utils.Modules(Utils.ModuleAction.initModule);
+
+      Errors.PushAbortMethod(new Errors.AbortMethod(Abort));
+      
+      using (var src = new StringReader(gpdlString)) {
+        GPDefLex.src = src;
+        GPDefSyn.Parse();
+      }
+
+      GPDefLex.InitLex();
+      GPDefSyn.Interpret();
+      MainFormManager.MainForm.ShowContent(GPDefSem.problem);
+    }
+
+    private void Abort(string abortKind, string moduleName, string methodName, string descr) {
+      
+      
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/HeuristicLab.Problems.GPDL.Views-3.4.csproj
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/HeuristicLab.Problems.GPDL.Views-3.4.csproj	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/HeuristicLab.Problems.GPDL.Views-3.4.csproj	(revision 9430)
@@ -0,0 +1,244 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.GPDL.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.GPDL.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimizer-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <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>
+    <None Include="HeuristicLab.snk" />
+    <Compile Include="CreateProblemMenuItem.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </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>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Plugin.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Plugin.cs.frame	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Plugin.cs.frame	(revision 9430)
@@ -0,0 +1,32 @@
+#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.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.GPDL.Views {
+  [Plugin("HeuristicLab.Problems.GPDL.Views","Provides views to define genetic programming problems using GPDL.", "3.4.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.GPDL.Views-3.4.dll", PluginFileType.Assembly)]
+  public class Plugin : PluginBase {
+  }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 9430)
@@ -0,0 +1,54 @@
+#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.Reflection;
+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("HeuristicLab.Problems.GPDL.Views")]
+[assembly: AssemblyDescription("Provides views to create genetic programming problems using GPDL.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
+[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("26E5AEE5-C9C8-4F27-B864-32139CF123EB")]
+// 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 Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.0.$WCREV$")]
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.sln	(revision 9430)
@@ -0,0 +1,85 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3768D612-38EB-47D8-9E79-75D8E5AB00A8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.GPDL-3.4", "HeuristicLab.Problems.GPDL\3.4\HeuristicLab.Problems.GPDL-3.4.csproj", "{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxAnalyzer", "SyntaxAnalyzer\SyntaxAnalyzer.csproj", "{729B818F-E1D0-4C9D-915A-775B2A4B1D27}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Coco-2", "Coco-2", "{582440C3-BB33-4683-A5EC-673AB51A7AB3}"
+	ProjectSection(SolutionItems) = preProject
+		Coco-2\Errors.cs = Coco-2\Errors.cs
+		Coco-2\Main.frm = Coco-2\Main.frm
+		Coco-2\PGT.exe = Coco-2\PGT.exe
+		Coco-2\PGTSem.frm = Coco-2\PGTSem.frm
+		Coco-2\PGTSyn.frm = Coco-2\PGTSyn.frm
+		Coco-2\Sets.cs = Coco-2\Sets.cs
+		Coco-2\SG.exe = Coco-2\SG.exe
+		Coco-2\SGLex.frm = Coco-2\SGLex.frm
+		Coco-2\Utils.cs = Coco-2\Utils.cs
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{B1F65B90-B1B7-45AF-9A16-DD8709B76C32}"
+	ProjectSection(SolutionItems) = preProject
+		examples\Artificial Ant.txt = examples\Artificial Ant.txt
+		examples\Factorial.txt = examples\Factorial.txt
+		examples\Fib.txt = examples\Fib.txt
+		examples\multi-output-multiplier.txt = examples\multi-output-multiplier.txt
+		examples\symbreg HEAL.txt = examples\symbreg HEAL.txt
+		examples\symbreg Koza.txt = examples\symbreg Koza.txt
+	EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.GPDL.Views-3.4", "HeuristicLab.Problems.GPDL.Views\3.4\HeuristicLab.Problems.GPDL.Views-3.4.csproj", "{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|x64.ActiveCfg = Debug|x64
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|x64.Build.0 = Debug|x64
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|x86.ActiveCfg = Debug|x86
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Debug|x86.Build.0 = Debug|x86
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|x64.ActiveCfg = Release|x64
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|x64.Build.0 = Release|x64
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|x86.ActiveCfg = Release|x86
+		{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}.Release|x86.Build.0 = Release|x86
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Release|Any CPU.Build.0 = Release|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Release|x64.ActiveCfg = Release|Any CPU
+		{729B818F-E1D0-4C9D-915A-775B2A4B1D27}.Release|x86.ActiveCfg = Release|Any CPU
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|x64.ActiveCfg = Debug|x64
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|x64.Build.0 = Debug|x64
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|x86.ActiveCfg = Debug|x86
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Debug|x86.Build.0 = Debug|x86
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|x64.ActiveCfg = Release|x64
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|x64.Build.0 = Release|x64
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|x86.ActiveCfg = Release|x86
+		{3F9E665A-3DCB-49C3-8806-0E47FC48EA52}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{582440C3-BB33-4683-A5EC-673AB51A7AB3} = {3768D612-38EB-47D8-9E79-75D8E5AB00A8}
+		{B1F65B90-B1B7-45AF-9A16-DD8709B76C32} = {3768D612-38EB-47D8-9E79-75D8E5AB00A8}
+	EndGlobalSection
+EndGlobal
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/AST.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/AST.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/AST.cs	(revision 9430)
@@ -0,0 +1,110 @@
+using System.Collections.Generic;
+using System;
+using System.Text;
+
+public class GPDefNode {
+  public string Name { get; set; }
+  public CodeNode ClassCodeNode { get; set; }
+  public CodeNode InitCodeNode { get; set; }
+  public List<SymbolNode> NonTerminals { get; private set; }
+  public List<SymbolNode> Terminals { get; private set; }
+  public List<RuleNode> Rules { get; private set; }
+  public FitnessFunctionNode FitnessFunctionNode { get; set; }
+
+  public GPDefNode() {
+    this.NonTerminals = new List<SymbolNode>();
+    this.Terminals = new List<SymbolNode>();
+    this.Rules = new List<RuleNode>();
+    this.ClassCodeNode = new CodeNode();
+    this.InitCodeNode = new CodeNode();
+  }
+}
+
+public class CodeNode {
+  public string SrcCode { get; set; }
+}
+
+public class FitnessFunctionNode {
+  public bool Maximization { get; set; }
+  public string SrcCode { get; set; }
+}
+
+public class SymbolNode {
+  public string Ident { get; set; }
+  public string FormalParameters { get; set; }
+
+}
+
+public class NonTerminalNode : SymbolNode {
+}
+
+public class TerminalNode : SymbolNode {
+  public class FieldDefinition {
+    private readonly string refOrOut;
+    private readonly string type;
+    private readonly string identifier;
+
+    public FieldDefinition(string refOrOut, string type, string identifier) {
+      this.type = type;
+      this.identifier = identifier;
+      this.refOrOut = refOrOut;
+    }
+    public string RefOrOut { get { return this.refOrOut; } }
+    public string Type { get { return this.type; } }
+    public string Identifier { get { return this.identifier; } }
+  }
+  public IEnumerable<ConstraintNode> Constraints { get; set; }
+  public IEnumerable<FieldDefinition> FieldDefinitions { get; set; }
+}
+
+
+public enum ConstraintNodeType { Set, Range };
+public class ConstraintNode {
+  public string Ident { get; set; }
+  public ConstraintNodeType Type { get; set; }
+  public string SetExpression { get; set; }
+  public string RangeMinExpression { get; set; }
+  public string RangeMaxExpression { get; set; }
+  public ConstraintNode(string ident) {
+    this.Ident = ident;
+  }
+}
+
+public class RuleNode {
+  public string NtSymbol { get; set; }
+  public string LocalCode { get; set; }
+  public RuleExprNode RuleExpr { get; set; }
+}
+
+public class RuleExprNode { }
+
+public class AlternativesNode : RuleExprNode {
+  private List<RuleExprNode> alt;
+  public IEnumerable<RuleExprNode> Alternatives { get { return alt; } }
+  public AlternativesNode() {
+    this.alt = new List<RuleExprNode>();
+  }
+  public void Add(RuleExprNode expr) {
+    alt.Add(expr);
+  }
+}
+
+public class SequenceNode : RuleExprNode {
+  private readonly List<RuleExprNode> seq;
+  public IEnumerable<RuleExprNode> Sequence { get { return seq; } }
+  public SequenceNode() {
+    seq = new List<RuleExprNode>();
+  }
+  public void Add(RuleExprNode expr) {
+    seq.Add(expr);
+  }
+}
+
+public class CallSymbolNode : RuleExprNode {
+  public string Ident { get; set; }
+  public string ActualParameter { get; set; }
+}
+
+public class RuleActionNode : RuleExprNode {
+  public string SrcCode { get; set; }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Errors.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Errors.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Errors.cs	(revision 9430)
@@ -0,0 +1,437 @@
+// Errors.cs                                                     HDO, 2006-08-28
+// ---------
+// Error handling, storage of error messages and listing generation.
+//=====================================|========================================
+
+#undef TEST_ERRORS
+
+using System;
+using System.IO;
+
+public class Errors {
+
+  public const String MODULENAME = "Errors";
+
+  public static void ErrorsMethod(Utils.ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        aps = new AbortMethod[MAXABORTPROCS];
+        sp = 0;
+        PushAbortMethod(DefaultAbort);
+        stopParsing = null;
+        eowCnt = new int[4];
+        curEoW = new ErrorWarn[4];
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        eowl = null;
+        eowCnt = null;
+        curEoW = null;
+        return;
+    } // switch
+    // --- for initModule and resetModule ---
+    eowl = null;
+    numOfErrs = 0;
+    numOfWarns = 0;
+    for (int i = 0; i < 4; i++)
+      eowCnt[i] = 0;
+  } // ErrorsMethod
+
+
+  public const int MAXABORTPROCS = 3;
+  public const int MAXNUMOFERRS = 30; // sum of lex., syn. and sem. errors
+  public const int MAXNUMOFWARNS = 50;
+
+  public delegate void StopParsingMethod();
+
+  public delegate void AbortMethod(String abortKind, String moduleName,
+                                   String methodName, String descr);
+
+  enum EoWKind {
+    lexErr,
+    synErr,
+    semErr,
+    warn
+  } // EoWKind
+
+  public class ErrorWarnInfo {
+    public String msg;
+    public int line, col;
+  } // ErrorWarnInfo
+
+  private class ErrorWarn {
+    public EoWKind kind;
+    public ErrorWarnInfo info;
+    public ErrorWarn next;
+  } // ErrorWarn
+
+  private static AbortMethod[] aps; // abort method stack
+  private static int sp;  // stack pointer for aps
+  private static StopParsingMethod stopParsing;
+
+  // --- errors and/or warnings handling ---
+
+  private static ErrorWarn eowl;        // sorted list of errors or warnings
+  private static int numOfErrs, numOfWarns;
+  private static int[] eowCnt;
+
+  private static void DefaultAbort(String abortKind, String moduleName,
+                                   String funcName, String descr) {
+    Console.WriteLine();
+    Console.WriteLine("*** {0} in module {1} function {2}",
+                      abortKind, moduleName, funcName);
+    Console.WriteLine("*** {0}", descr);
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Environment.Exit(Utils.EXIT_FAILURE);
+  } // DefaultAbort
+
+
+  // --- install stop parsing and abort functions ---
+
+  public static void InstallStopParsingMethod(StopParsingMethod spp) {
+    //-----------------------------------|----------------------------------------
+    stopParsing = spp;
+  } // InstallStopParsingMethod
+
+  public static void PushAbortMethod(AbortMethod ap) {
+    //-----------------------------------|----------------------------------------
+    if (sp == MAXABORTPROCS)
+      Restriction(MODULENAME, "PushAbortFunc", "too many abort functions");
+    aps[sp++] = ap;
+  } // PushAbortMethod
+
+
+  // --- report error or restriction and call abort functions ---
+
+  public static void CompilerError(String moduleName, String funcName,
+                                   String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    for (int i = sp - 1; i >= 0; i--)
+      aps[i]("compiler error", moduleName, funcName, msg); // should not return*
+    DefaultAbort("compiler error", moduleName, funcName, msg);
+  } // CompilerError
+
+  public static void Restriction(String moduleName, String funcName,
+                                 String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    for (int i = sp - 1; i >= 0; i--)
+      aps[i]("restriction", moduleName, funcName, msg); // should not return
+    DefaultAbort("restriction", moduleName, funcName, msg);
+  } // Restriction
+
+  public static void CallStopParsing() {
+    //-----------------------------------|----------------------------------------
+    if (stopParsing != null)
+      stopParsing();
+  } // CallStopParsing
+
+
+  // --- storage of errors found on compilation ---
+
+  private static void EnterMessage(EoWKind knd, int line, int col, String msg) {
+    ErrorWarn eow, prveow, nxteow;
+    eowCnt[(int)knd]++;
+    eow = new ErrorWarn();
+    eow.kind = knd;
+    eow.info = new ErrorWarnInfo();
+    eow.info.line = line;
+    eow.info.col = col;
+    eow.info.msg = msg;
+    prveow = null;
+    nxteow = eowl;
+    while (nxteow != null && nxteow.info.line <= line) {
+      prveow = nxteow;
+      nxteow = nxteow.next;
+    } // while
+    while (nxteow != null && nxteow.info.line == line && nxteow.info.col <= col) {
+      prveow = nxteow;
+      nxteow = nxteow.next;
+    } // while
+    if (prveow == null)
+      eowl = eow;
+    else
+      prveow.next = eow;
+    eow.next = nxteow;
+  } // EnterMessage
+
+  private static void CheckForLimits(EoWKind knd, int line, int col) {
+    if (knd == EoWKind.lexErr || knd == EoWKind.synErr || knd == EoWKind.semErr) {
+      numOfErrs++;
+      if (numOfErrs == MAXNUMOFERRS) {
+        Warning(line, col, "too many errors, parsing stopped");
+        CallStopParsing();
+      } // if
+    } else { // knd == EoWKind.warn
+      numOfWarns++;
+      if (numOfWarns == MAXNUMOFWARNS) {
+        Warning(line, col, "too many warnings, parsing stopped");
+        CallStopParsing();
+      } // if
+    } // else
+  } // CheckForLimits
+
+
+  public static void LexError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.lexErr, line, col, msg);
+    CheckForLimits(EoWKind.lexErr, line, col);
+  } // SynError
+
+  public static void SynError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.synErr, line, col, msg);
+    CheckForLimits(EoWKind.synErr, line, col);
+  } // SynError
+
+  public static void SemError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.semErr, line, col, msg);
+    CheckForLimits(EoWKind.semErr, line, col);
+  } // SemError
+
+  public static void Warning(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfWarns == MAXNUMOFWARNS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.warn, line, col, msg);
+    CheckForLimits(EoWKind.warn, line, col);
+  } // Warning
+
+
+  // --- retrieval of stored source errors and warnings ---
+
+  public static int NumOfErrors() {
+    //-----------------------------------|----------------------------------------
+    return numOfErrs;
+  } // NumOfErrors
+
+  public static int NumOfLexErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.lexErr];
+  } // NumOfLexErrors
+
+  public static int NumOfSynErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.synErr];
+  } // NumOfSynErrors
+
+  public static int NumOfSemErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.semErr];
+  } // NumOfSemErrors
+
+  public static int NumOfWarnings() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.warn];
+  } // NumOfWarnings
+
+
+  private static ErrorWarn[] curEoW;
+
+  private static ErrorWarnInfo GetMessage(bool first, EoWKind knd) {
+    ErrorWarn eow = null;
+    ErrorWarnInfo eowi = null;
+    if (first)
+      eow = eowl;
+    else
+      eow = curEoW[(int)knd].next;
+    while (eow != null && eow.kind != knd)
+      eow = eow.next;
+    curEoW[(int)knd] = eow;
+    if (eow == null) {
+      eowi = new ErrorWarnInfo();
+      eowi.msg = "";
+      eowi.line = 0;
+      eowi.col = 0;
+    } else
+      eowi = eow.info;
+    return eowi;
+  } // GetMessage
+
+  public static ErrorWarnInfo GetLexError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.lexErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetSynError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.synErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetSemError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.semErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetWarning(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.warn);
+  } // ErrorWarnInfo
+
+
+  // --- listing generation ---
+
+  private static void PutMsg(TextWriter lst, ErrorWarn eow) {
+    switch (eow.kind) {
+      case EoWKind.lexErr:
+        lst.Write("+LEX+");
+        break;
+      case EoWKind.synErr:
+        lst.Write("*SYN*");
+        break;
+      case EoWKind.semErr:
+        lst.Write("#SEM#");
+        break;
+      case EoWKind.warn:
+        lst.Write("!WRN!");
+        break;
+    } // switch 
+    for (int i = 0; i < eow.info.col; i++)
+      lst.Write(" ");
+    lst.Write(" ^{0}", eow.info.msg);
+  } // PutMsg
+
+  public enum ListingShape {
+    longListing,
+    shortListing
+  } // ListingShape
+
+  public static void GenerateListing(TextReader src, TextWriter lst,
+                                     ListingShape listShape) {
+    //-----------------------------------|----------------------------------------
+    ErrorWarn eow = null;
+    int lnr, skip;
+    String srcLine;
+
+    ((StreamReader)src).BaseStream.Seek(0, SeekOrigin.Begin);
+
+    eow = eowl;
+    if (eow != null) {
+      while (eow != null && eow.info.line < 1) {
+        PutMsg(lst, eow);
+        eow = eow.next;
+      } // while
+      lst.WriteLine();
+    } // if
+    lnr = 1;
+    for (; ; ) {
+      if (listShape == ListingShape.shortListing) {
+        if (eow == null) {
+          lst.WriteLine("...");
+          break;
+        } // if
+        skip = eow.info.line - lnr;
+        if (skip > 0) {
+          lst.WriteLine("...");
+          lnr = eow.info.line;
+          while (skip-- > 0) {
+            srcLine = src.ReadLine();
+            if (srcLine == null)
+              break;
+          } // while
+        } // if
+      } // if
+      srcLine = src.ReadLine();
+      if (srcLine == null)
+        break;
+      lst.WriteLine("{0,5}| {1}", lnr, srcLine);
+      while (eow != null && eow.info.line == lnr) {
+        PutMsg(lst, eow);
+        eow = eow.next;
+      } // while
+      lnr++;
+    } // for
+    lst.WriteLine();
+    while (eow != null) {
+      PutMsg(lst, eow);
+      eow = eow.next;
+    } // while
+    lst.WriteLine();
+    lst.WriteLine("error(s) and warning(s):");
+    lst.WriteLine("-----------------------");
+    lst.WriteLine();
+    lst.WriteLine("{0,5} lexical error(s) ", NumOfLexErrors());
+    lst.WriteLine("{0,5} syntax error(s)  ", NumOfSynErrors());
+    lst.WriteLine("{0,5} semantic error(s)", NumOfSemErrors());
+    lst.WriteLine("{0,5} warning(s)       ", NumOfWarnings());
+  } // GenerateListing
+
+
+#if TEST_ERRORS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Errors");
+
+    Console.WriteLine("installing ...");
+    Utils.InstallModule("Utils",  new Utils.ModuleMethodDelegate(Utils.UtilsMethod));
+    Utils.InstallModule("Sets",   new Utils.ModuleMethodDelegate(Sets.SetsMethod  ));
+    Utils.InstallModule("Errors", new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));
+    Console.WriteLine("initModule ...");
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    LexError(1, 1, "LexError at {0}, {1}", 1, 1);
+    SynError(3, 10, "SynError at {0}, {1}", 2, 10);
+    SemError(5, 5, "SemError at {0}, {1}", 5, 5);
+    Warning(0, 0, "Warning  at {0}, {1}", 0, 0);
+    Warning(9, 0, "Warning  at {0}, {1}", 9, 0);
+
+    String srcName;
+    Utils.GetInputFileName("source file name > ", out srcName);
+    FileStream   srcFs = new FileStream(srcName, FileMode.Open);
+    StreamReader src   = new StreamReader(srcFs);
+    FileStream   lstFs = new FileStream(srcName + ".lst", FileMode.Create);
+    StreamWriter lst   = new StreamWriter(lstFs);
+
+    lst.WriteLine("START");
+    GenerateListing(src, lst, ListingShape.longListing);
+    lst.WriteLine("END");
+
+    src.Close();
+    lst.Close();
+    
+    Console.WriteLine("resetModule ...");
+    Utils.Modules(Utils.ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Errors
+
+// End of Errors.cs
+//=====================================|========================================
+
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Sets.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Sets.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Sets.cs	(revision 9430)
@@ -0,0 +1,314 @@
+// Sets.cs                                                      HDO, 2006-08-28
+// -------
+// Definition of types BitSet and Set256 as well as methods for their manipulation.
+//=====================================|========================================
+
+#undef TEST_SETS
+
+using System;
+using System.Text;
+
+public class Sets {
+
+  public const String MODULENAME = "Sets";
+
+  public static void SetsMethod(Utils.ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        emptySet = new Set256();
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        break;
+    } // switch
+  } // SetsFunc
+
+  public const ushort BITSET_BIT = 16;
+  public const ushort BITSET_MASK = 15;
+  public const ushort ELEM_MAX = 256; // max. nr. of elems in a Set256
+  public const ushort SET256_LEN = 16;
+
+  public class Set256 {
+
+    public ushort[] ushorts;
+
+    public Set256() {
+      ushorts = new ushort[SET256_LEN];
+    } // Set256
+
+    public Set256(params ushort[] paramUshorts) {
+      ushorts = new ushort[SET256_LEN];
+      for (int i = 0; i < paramUshorts.Length; i++)
+        ushorts[i] = paramUshorts[i];
+    } // Set256
+
+    public ushort this[int i] {
+      get {
+        return ushorts[i];
+      }
+      set {
+        ushorts[i] = value;
+      }
+    }
+
+    public override String ToString() {
+      StringBuilder sb = new StringBuilder("{");
+      bool first = true;
+      for (ushort i = 0; i < ELEM_MAX; i++)
+        if (member(i, this)) {
+          if (!first)
+            sb.Append(", ");
+          sb.Append(i.ToString());
+          first = false;
+        } // if
+      sb.Append("}");
+      return sb.ToString();
+    } // ToString
+
+  } // Set256
+
+  public static Set256 emptySet; // empty set constant 
+
+  // --- operations for BitSet arrays ---
+
+  private static void checkVal(ushort x) {
+    if ((x < 0) || (x > 255)) {
+      Errors.Restriction("Sets", "setincl", "value {0} out of supported range 0..255", x);
+    } // if
+ } //checkVal
+
+  // x member of s?
+  public static bool member(ushort x, Set256 s) {
+    //-----------------------------------|----------------------------------------
+    checkVal(x);
+    return Utils.TestBit(s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // member
+
+  // include x in s 
+  public static void setincl(ref Set256 s, ushort x) {
+    //-----------------------------------|----------------------------------------
+    checkVal(x);
+    Utils.SetBit(ref s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // setincl
+
+  // exclude x from s 
+  //-----------------------------------|----------------------------------------
+  public static void setexcl(ref Set256 s, ushort x) {
+    checkVal(x);
+    Utils.ClrBit(ref s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // setexcl
+
+
+  // --- operations for type Set256 only ---
+
+  // init s, use
+  //   e or E for an <e>lement, e.g., setinit(s, "E", e)
+  //   r or R for a  <r>ange,   e.g., setinit(s, "R", lb, ub) 
+  public static void setinit(out Set256 s, String form, params ushort[] p) {
+    //-----------------------------------|----------------------------------------
+    int pi = 0;
+    ushort e, lb, ub;
+    s = new Set256();
+    foreach (char op in form) {
+      switch (op) {
+        case 'E':
+        case 'e':
+          e = p[pi++];  // single element e
+          setincl(ref s, e);
+          break;
+        case 'R':
+        case 'r':
+          lb = p[pi++]; // range lb .. ub
+          ub = p[pi++];
+          if (lb > ub)
+            Utils.FatalError(MODULENAME, "setinit", "lb > ub");
+          e = lb;
+          while (e <= ub) {
+            setincl(ref s, e);
+            e++;
+          } // while
+          break;
+        default:
+          Utils.FatalError(MODULENAME, "setinit",
+                           "unknown operation \'{0}\'", op.ToString());
+          break;
+      } // switch
+    } // while
+  } // setinit
+
+
+  // s1 <= s2? 
+  public static bool setle(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      if ((s1.ushorts[i] & ~(s2.ushorts[i])) != 0)
+        return false;
+      i++;
+    } // while 
+    return true;
+  } // setle
+
+
+  // sets s1 and s2 disjoint?
+  public static bool setdisjoint(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      if ((s1.ushorts[i] & s2.ushorts[i]) != 0)
+        return false;
+      i++;
+    } // while
+    return true;
+  } // setdisjoint
+
+
+  // s1 = s1 inters s2 
+  public static void setinters(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] &= s2.ushorts[i];
+      i++;
+    } // while
+  } // setinters
+
+
+  // s1 = s1 union s2
+  public static void setunion(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] |= s2.ushorts[i];
+      i++;
+    } // while
+  } // setunion
+
+  // s1 = s1 - s2 
+  public static void setdiff(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] &= (ushort)(~(s2.ushorts[i]));
+      i++;
+    } // while
+  } // setdiff
+
+
+  // clear s, s = {}
+  public static void setclear(ref Set256 s) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      s.ushorts[i] = 0;
+  } // setclear
+
+  // set assignment, s1 = s2
+  public static void setcpy(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      s1.ushorts[i] = s2.ushorts[i];
+  } // setcpy
+
+  // set comparison, s1 == s2? 
+  public static bool seteq(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      if (s1.ushorts[i] != s2.ushorts[i])
+        return false;
+    return true;
+  } // seteq
+
+  // s empty?
+  public static bool setempty(Set256 s) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      if (s.ushorts[i] != 0)
+        return false;
+    return true;
+  } // setempty
+
+
+#if TEST_SETS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Sets");
+
+    Console.WriteLine("installing ...");
+    Utils.InstallModule("Utils", new Utils.ModuleMethodDelegate(Utils.UtilsMethod));
+    Utils.InstallModule("Sets",  new Utils.ModuleMethodDelegate(Sets.SetsMethod ));
+    Console.WriteLine("initModule ...");
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    Console.WriteLine("emptySet = " + emptySet);
+
+    Set256 s = new Set256();
+    Console.WriteLine("s = " + s);
+    setincl(ref s, 177);
+    setincl(ref s, 4);
+    Console.WriteLine("after setincl(ref s, 177) and setincl(ref s, 4), s = " + s);
+    setexcl(ref s, 177);
+    setexcl(ref s, 4);
+    Console.WriteLine("after setexcl(ref s, 177) and setexcl(ref s, 4), s = " + s);
+
+    setinit(out s, "E", 4);
+    Console.WriteLine("after setinit(out s, \"E\", 4), s = " + s);
+    setinit(out s, "R", 4, 177);
+    Console.WriteLine("after setinit(out s, \"R\", 4, 177), s = " + s);
+
+    Set256 a, b;
+    setinit(out a, "E", 4);
+    setinit(out b, "E", 5);
+    Console.WriteLine("setle(a, b) = " + setle(a, b));
+
+    setinit(out a, "R",   0,   9);
+    setinit(out b, "R",   9,  100);
+    Console.WriteLine("setdisjoint(a, b) = " + setdisjoint(a, b));
+
+    setinit(out a, "R", 0, 99);
+    setinit(out b, "R", 80, 100);
+    setinters(ref a, b);
+    Console.WriteLine("setinters(ref a, b) = " + a);
+
+    setinit(out a, "R", 0, 9);
+    setinit(out b, "R", 100, 109);
+    setunion(ref a, b);
+    Console.WriteLine("setunion(ref a, b) = " + a);
+
+    setinit(out a, "R", 0, 99);
+    setinit(out b, "R", 1, 98);
+    setdiff(ref a, b);
+    Console.WriteLine("setdiff(ref a, b) = " + a);
+
+    setclear(ref a);
+    Console.WriteLine("setclear(a) = " + a);
+
+    setinit(out b, "R", 0, 9);
+    setcpy(ref a, b);
+    Console.WriteLine("setcpy(a) = " + a);
+
+    Console.WriteLine("seteq(a, b) = " + seteq(a, b));
+
+    Console.WriteLine("setempty(a) = " + setempty(a));
+    Console.WriteLine("setempty(emptySet) = " + setempty(emptySet));
+
+    Console.WriteLine("resetModule ...");
+    Utils.Modules(Utils.ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Sets
+
+// End of Sets.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Utils.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Utils.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Coco-2/Utils.cs	(revision 9430)
@@ -0,0 +1,395 @@
+// Utils.cs                                       HDO, 2006-08-28; SN, 10.9.2007
+// --------
+// Collection of useful utilities (constants, types, and methods).
+//=====================================|========================================
+
+#undef TEST_UTILS
+
+using System;
+using System.IO;
+
+public class Utils {
+
+  public const String MODULENAME = "Utils";
+
+  public static void UtilsMethod(ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case ModuleAction.getModuleName:
+        return;
+      case ModuleAction.initModule:
+        timerRuns = false;
+        break;
+      case ModuleAction.resetModule:
+        timerRuns = false;
+        break;
+      case ModuleAction.cleanupModule:
+        return;
+    } // switch
+  } // UtilsMethod
+
+  // --- general char constants ---
+  public const char EF = '\0';
+  public const char LF = '\n';
+  public const char NL = '\n';
+  public const char HT = '\t';
+  public const char VT = '\v';
+  public const char BS = '\b';
+  public const char CR = '\r';
+  public const char FF = '\f';
+  public const char BEL = '\a';
+
+  public const int UCHAR_MAX = 255;
+  public const int CHAR_BIT = 8;
+  public const long INT_MAX = 2147483647;
+  public const long INT_MIN = -INT_MAX;
+  public const int BYTE_MAX = UCHAR_MAX;
+  public const int BYTE_BIT = CHAR_BIT;
+
+  // --- general integer constants ---
+  public const int EXIT_FAILURE = -1;
+  public const int EXIT_SUCCESS = 0;
+  public const int KB = 1024;
+  public const int MB = KB * KB;
+
+  // --- module handling types and program module handling ---
+
+  public enum ModuleAction {
+    getModuleName,
+    initModule,
+    resetModule,
+    cleanupModule
+  } // ModuleAction
+
+  public delegate void ModuleMethodDelegate(ModuleAction action,
+                                            out String moduleName);
+
+  private struct ModuleInfo {
+    public String moduleName;
+    public ModuleMethodDelegate moduleMethod;
+    public bool init;
+  } // ModuleInfo
+
+  private const int MAXMODULES = 20;
+  private static ModuleInfo[] mil = new ModuleInfo[MAXMODULES];
+  private static int modCnt;
+
+  public static void InstallModule(String moduleName, ModuleMethodDelegate moduleMethod) {
+    //-----------------------------------|----------------------------------------
+    if (moduleName == MODULENAME) {
+      modCnt = 0;
+      for (int i = 0; i < MAXMODULES; i++) {
+        mil[i].moduleName = "";
+        mil[i].moduleMethod = null;
+        mil[i].init = false;
+      } // for
+    } // if
+    if (modCnt == MAXMODULES)
+      FatalError(MODULENAME, "InstallModule", "too many modules");
+    String mn;
+    moduleMethod(ModuleAction.getModuleName, out mn);
+    if (moduleName != mn)
+      FatalError(MODULENAME, "InstallModule",
+                 "incorrect module name \"{0}\"", moduleName);
+    mil[modCnt].moduleName = moduleName;
+    mil[modCnt].moduleMethod = moduleMethod;
+    mil[modCnt].init = false;
+    modCnt++;
+  } // InstallModule
+
+  private static bool withinCleanUp = false;
+
+  public static void Modules(ModuleAction action) {
+    //-----------------------------------|----------------------------------------
+    String dummy;
+    switch (action) {
+      case ModuleAction.initModule:
+        for (int i = 0; i < modCnt; i++) {
+          if (!mil[i].init) {
+            mil[i].moduleMethod(ModuleAction.initModule, out dummy);
+            mil[i].init = true;
+          } else
+            FatalError(MODULENAME, "Modules",
+                       "{0} reinitialized", mil[i].moduleName);
+        } // for
+        break;
+      case ModuleAction.resetModule:
+      case ModuleAction.cleanupModule:
+        if (!withinCleanUp) {
+          withinCleanUp = true;
+          for (int i = modCnt - 1; i >= 0; i--)
+            if (mil[i].init) {
+              mil[i].moduleMethod(action, out dummy);
+              mil[i].init = action != ModuleAction.cleanupModule;
+            } else
+              FatalError(MODULENAME, "Modules",
+                         "{0} not initialized", mil[i].moduleName);
+          withinCleanUp = false;
+        } // if
+        break;
+      default:
+        FatalError(MODULENAME, "Modules",
+                   "invalid ModuleAction {0}", action.ToString());
+        break;
+    } // switch
+  } // Modules
+
+
+  // --- misc. utilities ---
+
+  public static void FatalError(String moduleName, String methodName,
+                                String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    Console.WriteLine();
+    Console.WriteLine("*** FATAL ERROR in module {0}, method {1}",
+            moduleName, methodName);
+    Console.WriteLine("*** " + fmt, p);
+    Modules(ModuleAction.cleanupModule);
+    Environment.Exit(EXIT_FAILURE);
+  } // FatalError
+
+  public static void GetInputFileName(String prompt, out String fileName) {
+    //-----------------------------------|----------------------------------------
+    Console.WriteLine();
+    Console.Write("{0}", prompt);
+    fileName = Console.ReadLine();
+  } // GetInputFileName
+
+
+  // --- timer utilities ---
+
+  private static bool timerRuns = false;
+  private static DateTime startedAt, stoppedAt;
+
+  public static void StartTimer() {
+    //-----------------------------------|----------------------------------------
+    if (timerRuns)
+      FatalError(MODULENAME, "StartTimer", "timer still running");
+    timerRuns = true;
+    startedAt = DateTime.Now;
+  } // StartTimer
+
+  public static void StopTimer() {
+    //-----------------------------------|----------------------------------------
+    if (!timerRuns)
+      FatalError(MODULENAME, "StopTimer", "timer not running");
+    stoppedAt = DateTime.Now;
+    timerRuns = false;
+  } // StopTimer
+
+  public static TimeSpan ElapsedTime() {
+    //-----------------------------------|----------------------------------------
+    TimeSpan elapsed = stoppedAt - startedAt;
+    return elapsed;
+  } // ElapsedTime
+
+
+  // --- Min/Max methods ---
+
+  public static T Min<T>(T a, T b) where T : IComparable {
+    //-----------------------------------|----------------------------------------
+    return a.CompareTo(b) < 0 ? a : b;
+  } // Min
+
+  public static T Max<T>(T a, T b) where T : IComparable {
+    //-----------------------------------|----------------------------------------
+    return a.CompareTo(b) > 0 ? a : b;
+  } // Max
+
+
+  // --- shift methods ---
+
+  public static int BSL(int x, int i) {
+    //-----------------------------------|----------------------------------------
+    return x << i;
+  } // BSL
+
+  public static int BSR(int x, int i) {
+    //-----------------------------------|----------------------------------------
+    return x >> i;
+  } // BSR
+
+
+  // --- bit manipulation methods ---
+
+  public static ushort Bit(ushort i) {
+    //-----------------------------------|----------------------------------------
+    return (ushort)(1 << i);
+  } // Bit
+
+  public static void SetBit(ref ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    x |= Bit(i);
+  } // SetBit
+
+  public static void ClrBit(ref ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    x &= (ushort)(~Bit(i));
+  } // ClrBit
+
+  public static bool TestBit(ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    return (x & Bit(i)) != 0;
+  } // TestBit
+
+  public static int Strquotechar(ref string s, char ch) {
+    // -------------------------------------|--------------------------------------
+    switch (ch) {
+      case EF:
+        s = "EF";
+        break;
+      case LF:
+        s = "LF";
+        break;
+      case HT:
+        s = "HT";
+        break;
+      case VT:
+        s = "VT";
+        break;
+      case BS:
+        s = "BS";
+        break;
+      case CR:
+        s = "CR";
+        break;
+      case FF:
+        s = "FF";
+        break;
+      case BEL:
+        s = "BEL";
+        break;
+      case '\\':
+      case '\'':
+      case '\"':
+        s = "\'\\" + (char)ch + "\'";
+        break;
+      default:
+        if (!Char.IsControl(ch))
+          s = "\'" + (char)ch + "\'";
+        else
+          s = "\'\\" + (char)ch + "\'";
+        break;
+    }
+    return s.Length;
+  } // Strquotechar
+
+  public static int Strquotestr(ref string s, string t) {
+    // -------------------------------------|--------------------------------------
+    char ch = ' ';
+    string s1;
+    int i = 0;
+
+    s1 = s;
+    s += '"';
+    while (i < t.Length) {
+      ch = t[i];
+      i++;
+      switch (ch) {
+        case LF:
+          s += '\\';
+          s += 'n';
+          break;
+        case HT:
+          s += '\\';
+          s += 't';
+          break;
+        case VT:
+          s += '\\';
+          s += 'v';
+          break;
+        case BS:
+          s += '\\';
+          s += 'b';
+          break;
+        case CR:
+          s += '\\';
+          s += 'r';
+          break;
+        case FF:
+          s += '\\';
+          s += 'f';
+          break;
+        case BEL:
+          s += '\\';
+          s += 'a';
+          break;
+        case '\\':
+        case '\'':
+        case '"':
+          s += '\\';
+          s += ch;
+          break;
+        default:
+          if (!Char.IsControl(ch))
+            s += ch;
+          else {
+            s = "\\" + (char)ch;
+            s += s.Length.ToString();
+          }
+          break;
+      }
+    }
+    s += '"';
+    return s1.Length;
+  } // Strquotestr
+
+#if TEST_UTILS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Utils");
+
+    Console.WriteLine("installing ...");
+    InstallModule("Utils", new ModuleMethodDelegate(UtilsMethod));
+    Console.WriteLine("initModule ...");
+    Modules(ModuleAction.initModule);
+
+    // FatalError(MODULENAME, "Main", 
+    //            "any {0} error {1}", "additional", "messages");
+
+    Console.WriteLine("StartTimer ...");
+    StartTimer();
+    String fn;
+    GetInputFileName("input file name > ", out fn);
+    Console.WriteLine("input file name = " + fn);
+    Console.WriteLine("StopTimer ...");
+    StopTimer();
+    Console.WriteLine(ElapsedTime());
+
+    Console.WriteLine("Min(17, 4) = " + Min(17, 4));
+    Console.WriteLine("Max(17, 4) = " + Max(17, 4));
+
+    Console.WriteLine();
+    Console.WriteLine("BSL(1, 2) = " + BSL(1, 2));
+    Console.WriteLine("BSR(4, 2) = " + BSR(4, 2));
+    Console.WriteLine("Bit(4)    = " + Bit(4));
+    ushort x = 1;
+    Console.WriteLine("x = " + x);
+    SetBit (ref x, 2);
+    Console.WriteLine("after SetBit (x, 2), x = " + x);
+    Console.WriteLine("TestBit(x, 2) = " + TestBit(x, 2));
+    ClrBit (ref x, 2);
+    Console.WriteLine("after ClrBit (x, 2), x = " + x);
+    Console.WriteLine("TestBit(x, 2) = " + TestBit(x, 2));
+
+
+    Console.WriteLine("resetModule ...");
+    Modules(ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Modules(ModuleAction.cleanupModule);
+
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Utils
+
+// End of Utils.cs
+//=====================================|========================================
+
+
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg	(revision 9430)
@@ -0,0 +1,250 @@
+COMPILER GPDef
+SEM <<
+  static StringBuilder srcText;
+  public static HeuristicLab.Optimization.IProblem problem;
+>>
+
+
+CHARACTER SETS
+  letter = 'A'..'Z' + 'a'..'z'.
+  digit = '0'..'9'.
+  whiteSpace = CHR(9) + EOL IGNORE. /* ' ' ignored by default */
+
+COMMENTS
+  FROM '/*' TO '*/' NESTED.
+
+KEYWORDS
+  'PROBLEM'. 'END'. 'EPS'.
+  'LOCAL'. 'NONTERMINALS'. 'RULES'.
+  'SEM'. 'MAXIMIZE'. 'MINIMIZE'. 'TERMINALS'. 'CONSTRAINTS'. 'INIT'. 'MUTATE'. 'CODE'.
+  'IN'. 'SET'. 'RANGE'.
+
+TOKENS
+  '='. '|'. '.'. '('. ')'. '['. ']'. '{'. '}'. '..'.
+
+TOKEN CLASSES
+  ident<<out string identStr>> =
+    letter {letter | digit}        LEX << identStr = tokenStr; >>
+  .
+
+PRAGMAS
+  source       = '<<' SEM << GPDefSem.srcText = new StringBuilder();
+                             for (; ; ) {
+                              switch (GPDefLex.curCh) {
+                                case Utils.EF:
+                                  Errors.SemError(GPDefLex.curLine, GPDefLex.curCol, "end of file in source text");
+                                  return;
+                                case '<':
+                                  GPDefLex.NextCh();
+                                  if (GPDefLex.curCh == '<') {
+                                    GPDefSem.srcText.Append('<');
+                                    Errors.Warning(GPDefLex.curLine, GPDefLex.curCol, "non closed source text before?");
+                                    GPDefLex.NextCh();
+                                  }
+                                  GPDefSem.srcText.Append('<');
+                                  break;
+                                case '>':
+                                  GPDefLex.NextCh();
+                                  if (GPDefLex.curCh == '>') {
+                                    GPDefLex.curCh = ' ';          // force GPDefLex to get next character
+                                    SourceReader.Handle(GPDefSem.srcText.ToString());
+                                    return;
+                                  }
+                                  GPDefSem.srcText.Append('>');
+                                  break;
+                                default:
+                                  GPDefSem.srcText.Append(GPDefLex.curCh);
+                                  GPDefLex.NextCh();
+                                  break;
+                              }
+                            }
+                            >> .
+NONTERMINALS
+  GPDef.
+  NonterminalDecl<<out NonTerminalNode ntNode>>.
+  TerminalDecl<<out TerminalNode tNode>>.
+  RuleDef<<out RuleNode rNode>>.
+  SynExpr<<out RuleExprNode expr>>.
+  SynTerm<<out RuleExprNode expr>>.
+  SynFact<<out RuleExprNode expr>>.
+  SemAction<<out RuleActionNode action>>.
+  ConstraintDef<<out IEnumerable<ConstraintNode> constraints>>.
+  ConstraintRule<<out ConstraintNode constraint>>.
+  SetDefinition<<ConstraintNode constraint>>.
+
+RULES
+  GPDef =                                                                         LOCAL <<
+                                                                                    string identStr = "";
+                                                                                    RuleNode ruleNode = null;
+                                                                                    GPDefNode gpDef = new GPDefNode();
+                                                                                    NonTerminalNode ntNode = null;
+                                                                                    FitnessFunctionNode fitnessFunNode = null;
+                                                                                    TerminalNode tNode = null;
+                                                                                    problem = null;
+                                                                                  >>
+    'PROBLEM' ident<<out identStr>>                                               SEM << gpDef.Name = identStr; >>
+    ['CODE' /* SourceText */                                                      SEM << SourceReader.WithNext((src) => gpDef.ClassCodeNode = new CodeNode{SrcCode = src});  >>
+    ]
+    ['INIT' /* SourceText */                                                      SEM << SourceReader.WithNext((src) => gpDef.InitCodeNode = new CodeNode{SrcCode = src});  >>
+    ]
+
+    'NONTERMINALS' { NonterminalDecl<<out ntNode>>                                SEM << gpDef.NonTerminals.Add(ntNode); >>
+    }
+    'TERMINALS' { TerminalDecl<<out tNode>>                                       SEM << gpDef.Terminals.Add(tNode); >>
+    }
+    'RULES' { RuleDef<<out ruleNode>>                                                SEM << gpDef.Rules.Add(ruleNode); >>
+    }
+                                                                                  SEM << fitnessFunNode = new FitnessFunctionNode();
+                                                                                         gpDef.FitnessFunctionNode = fitnessFunNode;
+                                                                                  >>
+    ('MAXIMIZE'                                                                   SEM << fitnessFunNode.Maximization = true; >>
+    | 'MINIMIZE'                                                                  SEM << fitnessFunNode.Maximization = false; >>
+    )
+     /* SourceText */                                                             SEM << SourceReader.WithNext((src) => fitnessFunNode.SrcCode = src);  >>
+    'END' ident<<out identStr>> '.'                                               SEM <<
+                                                                                    SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader
+                                                                                    var gen = new ProblemGenerator();
+                                                                                    problem = gen.GenerateFromAst(gpDef);
+                                                                                  >>
+  .
+
+
+  /******************************************************/
+  SemAction<<out RuleActionNode action>> =                                        LOCAL << RuleActionNode myAction = null; action = null; >>
+    'SEM' /* SourceText */                                                        SEM <<
+                                                                                    myAction = new RuleActionNode();
+                                                                                    SourceReader.WithNext((src) => {myAction.SrcCode = src;});
+                                                                                    action = myAction;
+                                                                                  >>
+  .
+
+  /******************************************************/
+  NonterminalDecl<<out NonTerminalNode ntNode>> =                                 LOCAL << string identStr = ""; ntNode = null;>>
+    ident<<out identStr>> /* FormalAttrList */                                    SEM <<
+                                                                                    var myNtNode = new NonTerminalNode();
+                                                                                    ntNode = myNtNode;
+                                                                                    myNtNode.Ident = identStr;
+                                                                                    SourceReader.WithNext((src) => {myNtNode.FormalParameters = src;});
+                                                                                  >>
+    '.'
+  .
+
+  /******************************************************/
+  TerminalDecl<<out TerminalNode tNode>> =                                        LOCAL <<
+                                                                                    string identStr = "";
+                                                                                    tNode = null;
+                                                                                    TerminalNode myTNode = null;
+                                                                                    IEnumerable<ConstraintNode> constraints = null;
+                                                                                  >>
+  ident<<out identStr>> /* FormalAttrList */                                      SEM <<
+                                                                                         myTNode = new TerminalNode();
+                                                                                         tNode = myTNode;
+                                                                                         myTNode.Ident = identStr;
+                                                                                         SourceReader.WithNext((src) => {
+                                                                                           myTNode.FormalParameters = src;
+                                                                                           myTNode.FieldDefinitions = SourceReader.ExtractFormalParameters(src);
+                                                                                         });
+
+                                                                                  >>
+  [ 'CONSTRAINTS' ConstraintDef<<out constraints>>                                SEM << myTNode.Constraints = constraints; >>
+  ]
+  '.'
+  .
+
+
+  /******************************************************/
+  ConstraintDef<<out IEnumerable<ConstraintNode> constraints>>  =             LOCAL <<
+                                                                                    List<ConstraintNode> constraintsList = new List<ConstraintNode>();
+                                                                                    ConstraintNode n = null;
+                                                                                    constraints = null;
+                                                                                  >>
+    { ConstraintRule<<out n>>                                                     SEM << constraintsList.Add(n); >>
+    }
+                                                                                  SEM << constraints = constraintsList; >>
+  .
+
+  /******************************************************/
+  ConstraintRule<<out ConstraintNode constraint>> =                               LOCAL <<
+                                                                                    string identStr = null;
+                                                                                    constraint = null;
+                                                                                  >>
+    ident<<out identStr>>                                                         SEM << constraint = new ConstraintNode(identStr); >>
+    'IN' SetDefinition<<constraint>>                                              SEM << SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader  >>
+  .
+
+  /******************************************************/
+  SetDefinition<<ConstraintNode constraint>> =
+    'SET'                                                                        SEM << constraint.Type = ConstraintNodeType.Set; >>
+    /* SourceText */                                                              SEM << SourceReader.WithNext((src) => {constraint.SetExpression = src;}); >>
+    | 
+    'RANGE'                                                                       SEM << constraint.Type = ConstraintNodeType.Range; >>
+    /* SourceText */                                                              SEM << SourceReader.WithNext((src) => {constraint.RangeMinExpression = src;}); >>
+    '..' /* SourceText */                                                         SEM << SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader 
+                                                                                         SourceReader.WithNext((src) => {constraint.RangeMaxExpression = src;}); >>    
+  .
+
+  /******************************************************/
+  RuleDef<<out RuleNode rule>> =                                                  LOCAL <<
+                                                                                    RuleExprNode expr = null;
+                                                                                    string identStr = null;
+                                                                                    RuleNode myRule = null;
+                                                                                    rule = null;
+                                                                                  >>
+  ident<<out identStr>> /* FormalAttrList */ '='                                  SEM <<
+                                                                                      myRule = new RuleNode();
+                                                                                      rule = myRule;
+                                                                                      myRule.NtSymbol = identStr;
+                                                                                  >>
+  ['LOCAL' /* SourceText */                                                       SEM <<
+                                                                                    SourceReader.WithNext((src) => {myRule.LocalCode = src;});
+                                                                                  >>
+  ]
+  SynExpr<<out expr>> '.'                                                        SEM <<
+                                                                                    myRule.RuleExpr = expr;
+                                                                                 >>
+  .
+
+  /******************************************************/
+  SynExpr<<out RuleExprNode expr >> =                                             LOCAL <<
+                                                                                    expr = null;
+                                                                                    AlternativesNode alt = null;
+                                                                                  >>
+  SynTerm<<out expr>>                                                             SEM <<
+                                                                                    alt = new AlternativesNode();
+                                                                                    alt.Add(expr);
+                                                                                   >>
+  {
+    '|' SynTerm<<out expr>>                                                       SEM << alt.Add(expr); expr = alt; >>
+  }
+  .
+
+  /******************************************************/
+  SynTerm<<out RuleExprNode expr>> =                                             LOCAL << SequenceNode seq = null; expr = null; >>
+  SynFact<<out expr>>                                                            SEM <<
+                                                                                   seq = new SequenceNode();
+                                                                                   seq.Add(expr);
+                                                                                 >>
+  {
+    SynFact<<out expr>>                                                          SEM << seq.Add(expr); expr = seq; >>
+  }
+  .
+
+  /******************************************************/
+  SynFact<<out RuleExprNode expr>> =                                             LOCAL <<
+                                                                                   string identStr = "";
+                                                                                   RuleActionNode action = null;
+                                                                                   expr = null;
+                                                                                 >>
+    ident<<out identStr>> /* ActualAttrList */                                   SEM <<
+                                                                                    var callNode = new CallSymbolNode{Ident = identStr};
+                                                                                    SourceReader.WithNext((src) => {callNode.ActualParameter = src;});
+                                                                                    expr = callNode;
+                                                                                  >>
+--    | 'EPS'
+--    | '(' SynExpr<<ref rules, mBuilder>> ')'
+--    | '[' SynExpr<<ref rules, mBuilder>> ']'
+--    | '{' SynExpr<<ref rules, mBuilder>> '}'
+    | SemAction<<out action>>                                                    SEM << expr = action; >>
+  .
+
+END GPDef.
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefLex.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefLex.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefLex.cs	(revision 9430)
@@ -0,0 +1,425 @@
+// GPDefLex.cs                                              HDO, 2006-08-28
+// -------------
+// Lexical analyzer (finite-state machine interpreter).
+// Generated by Coco-2 (SG).
+//=====================================|========================================
+
+#undef TEST_Lex
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Text;
+
+public class GPDefLex {
+
+  public const String MODULENAME = "GPDefLex";
+  public const int    EOFSPIX    = 1;
+
+  public static TextReader src;
+
+  // --- token information ---
+  public static int    token;               // current token
+  public static int    tokenLine, tokenCol; // position of current token
+  public static String tokenStr;            // token string recognized
+
+  // --- current char. info, for "power users" only ---
+  public static char   curCh;               // current input character
+  public static int    curLine, curCol;     // position of curCh
+
+
+  public static void GPDefLexMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        caseSensitive = true;
+        lt            = new LexicalTable();
+        tokenStrArr   = new char[256];
+        kwHt          = CreateHashtable();
+        nHt           = CreateHashtable();
+        nl            = new ArrayList();
+        break;
+      case Utils.ModuleAction.resetModule:
+        kwHt.Clear();
+        nHt.Clear();
+        nl.Clear();
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        lt            = null;
+        tokenStrArr   = null;
+        kwHt          = null;
+        nHt           = null;
+        nl            = null;
+        break;
+    } // switch
+  } // GPDefLexMethod
+
+  private static  Hashtable CreateHashtable() {
+    if (caseSensitive)
+      return new Hashtable();
+    else
+      return CollectionsUtil.CreateCaseInsensitiveHashtable();
+  } // CreateHashtable
+
+
+  public static void InitLex() {
+  //-----------------------------------|----------------------------------------
+    // --- initialize keyword hash table  ---
+    kwHt.Clear();
+    EnterKeyword(  1, "PROBLEM");
+    EnterKeyword(  2, "END");
+    EnterKeyword(  3, "EPS");
+    EnterKeyword(  4, "LOCAL");
+    EnterKeyword(  5, "NONTERMINALS");
+    EnterKeyword(  6, "RULES");
+    EnterKeyword(  7, "SEM");
+    EnterKeyword(  8, "MAXIMIZE");
+    EnterKeyword(  9, "MINIMIZE");
+    EnterKeyword( 10, "TERMINALS");
+    EnterKeyword( 11, "CONSTRAINTS");
+    EnterKeyword( 12, "INIT");
+    EnterKeyword( 13, "MUTATE");
+    EnterKeyword( 14, "CODE");
+    EnterKeyword( 15, "IN");
+    EnterKeyword( 16, "SET");
+    EnterKeyword( 17, "RANGE");
+    // --- initialize name data structures  ---
+    nHt.Clear();
+    nl.Clear();
+    nl.Add("");      // so spix = 0 is the empty string
+    nl.Add("!EOF!"); // so EOFSPIX = 1
+    // --- (re)set global data ---
+    curLineStr  = "";
+    curCh       = ' ';
+    curLine     = 0;
+    curCol      = 2;
+    tokenStr    = null;
+    token       = 0;
+    tokenCol    = 0;
+    tokenLine   = 0;
+    tokenStrLen = 0;
+    pendingEOLs = 0;
+    apxLen      = pendingEOLs; // to prevent warning
+  } // InitLex
+
+  private static void EnterKeyword(int token, String keyword) {
+    kwHt.Add(keyword, token);
+  } // EnterKeyword
+
+
+  // *** start of global LEX declarations from ATG ***
+  
+  // *** end of global LEX declarations from ATG ***
+
+
+  public static bool caseSensitive;
+
+  private class LexicalTable {
+    public int   header = 4;
+    public int[] startTab = {
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  4,  5,  0,  0,  0,  0, 15,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12,  2,  0,  0,
+          0, 14, 14, 14, 14, 14, 11, 14, 11, 14, 11, 11, 14, 14, 14, 14,
+         14, 11, 14, 14, 14, 14, 11, 11, 14, 11, 14,  6,  0,  7,  0,  0,
+          0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+         11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  8,  3,  9,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
+      };
+    public Sets.Set256 ignoredChars = new Sets.Set256(
+         0x0600, 0x0000, 0x0001
+      );
+    public Sets.Set256 commentStart = new Sets.Set256(
+         0x0000, 0x0000, 0x8000
+      );
+    public Sets.Set256[] cls = {
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0xfffe, 0x07ff, 0xfffe, 0x07ff),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x03ff),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0xf2be, 0x053d),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0x0d40, 0x02c2, 0xfffe, 0x07ff)
+      };
+  } // LexicalTable
+
+  private static LexicalTable lt;
+  private static Hashtable    kwHt;  // hash table for keywords: string -> token 
+  private static Hashtable    nHt;   // hash table for names: string -> null 
+  private static ArrayList    nl;    // name list  for names, index is spix
+
+  private static String curLineStr;  // current source line
+  private static char[] tokenStrArr; // token string in an array
+  private static int    tokenStrLen; // length of token string in tokenStrArr
+  private static int    state;       // current automaton state
+  private static int    apxLen;      // length of appendix in token string
+  private static int    pendingEOLs; // nr of EOLs found in comment
+
+  // --- to save and restore scanner state ---
+  private static char   savedCh;
+  private static int    savedCol, savedLine;
+
+  private static void SaveScannerState() {
+    savedCh      = curCh;
+    savedCol     = curCol;
+    savedLine    = curLine;
+  } // SaveScannerState
+
+  private static void RestoreScannerState() {
+    tokenStrLen -= apxLen;
+    apxLen       = 0;
+    curCh        = savedCh;
+    curCol       = savedCol;
+    curLine      = savedLine;
+  } // RestoreScannerState
+
+
+  public static void NextCh() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      
+      if (curCol < curLineStr.Length) {         // within line
+        curCol++;
+        curCh = curLineStr[curCol - 1];
+        return;
+      } else if (curCol == curLineStr.Length) { // end of line
+        curCol++;
+        curCh = Utils.LF; // to separate lines
+        return;
+      } else { // curCol > curLineStr.Length
+        curLineStr = src.ReadLine();
+        curLine++;
+        curCol = 0;
+        if (curLineStr == null) {               // end of file
+          curLineStr = "";
+          curCh = Utils.EF;
+          return;
+        } // if
+      } // else
+    } // for
+  } // NextCh
+
+
+  private static void CommentErr() {
+    Errors.LexError(curLine, curCol, "end of file in comment");
+  } // CommentErr
+
+  private static bool Comment() {
+    
+    int level = 1;
+    
+    SaveScannerState();
+    // --- from '/' '*' to '*' '/' nested ---
+    NextCh();
+    if (curCh == '*') {
+      NextCh();
+      for (;;)
+        switch (curCh) {
+          case '*':
+            NextCh();
+            if (curCh == '/') {
+              NextCh();
+              level--;
+              if (level == 0) {
+                return true;
+              } // if
+            } // if
+            break;
+          case '/':
+            NextCh();
+            if (curCh == '*') {
+              level++;
+              NextCh();
+            }
+            break;
+          case Utils.EF:
+            CommentErr();
+            return true;
+          default:
+            NextCh();
+            break;
+        } // switch
+    } else
+      RestoreScannerState();
+    return false;
+  } // Comment
+
+  private static void HandleLexErr() {
+    Errors.LexError(curLine, curCol, 
+                    "invalid character '{0}' (hex {1:X})", curCh, (int)curCh);
+    if (apxLen > 0)
+      RestoreScannerState();
+  } // HandleLexErr
+
+
+  public static void GetToken() {
+  //-----------------------------------|----------------------------------------
+    token = -1;
+    tokenStr = null;
+    do {
+      // --- skip ignored chars and comments ---
+      for (;;) {
+        while (Sets.member(curCh, lt.ignoredChars))
+          NextCh();
+        if (!Sets.member(curCh, lt.commentStart))
+          break;
+        if (!Comment())
+          break;
+      } // for
+      // --- scan for next token ---
+      tokenLine   = curLine;
+      tokenCol    = curCol;
+      tokenStrLen = 0;
+      apxLen      = 0;
+      state = (curCh == Utils.EF) ? 1 : lt.startTab[curCh];
+      for (;;) {
+        tokenStrArr[tokenStrLen++]= curCh;
+        NextCh();
+        switch (state) {
+          case 0:
+            Errors.LexError(tokenLine, tokenCol, "invalid token start");
+            break;
+          case 1:
+            token = 0;
+            tokenStrLen = 0;
+            break;                      // EOF recognized
+          case 2:
+            token = 18;
+            break;                      // '=' recognized
+          case 3:
+            token = 19;
+            break;                      // '|' recognized
+          case 4:
+            token = 21;
+            break;                      // '(' recognized
+          case 5:
+            token = 22;
+            break;                      // ')' recognized
+          case 6:
+            token = 23;
+            break;                      // '[' recognized
+          case 7:
+            token = 24;
+            break;                      // ']' recognized
+          case 8:
+            token = 25;
+            break;                      // '{' recognized
+          case 9:
+            token = 26;
+            break;                      // '}' recognized
+          case 10:
+            token = 27;
+            break;                      // '..' recognized
+          case 11:
+            if (Sets.member(curCh, lt.cls[0])) {
+              state = 11;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[1])) {
+              state = 11;
+              continue;
+            } // if
+            else {
+              token = KeywordCheck();
+              if (token >= 0)
+                break;                  // keyword recognized
+              token = 28;
+              break;                    // ident recognized
+            } // else
+          case 12:
+            if (curCh == '<') {
+              state = 13;
+              continue;
+            } // if
+            else {
+              HandleLexErr();
+              break;
+            } // else
+          case 13:
+            token = 29;
+            break;                      // source recognized
+          case 14:
+            if (Sets.member(curCh, lt.cls[1])) {
+              state = 11;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[2])) {
+              state = 14;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[3])) {
+              state = 11;
+              continue;
+            } // if
+            else {
+              token = KeywordCheck();
+              if (token >= 0)
+                break;                  // keyword recognized
+              token = 28;
+              break;                    // ident recognized
+            } // else
+          case 15:
+            if (curCh == '.') {
+              state = 10;
+              continue;
+            } // if
+            else {
+              token = 20;
+              break;                    // '.' recognized
+            } // else
+        } // switch
+        break;
+      } // for
+    } while (token < 0);
+    if (tokenStr == null)
+      tokenStr = new String(tokenStrArr, 0, tokenStrLen);
+  } // GetToken
+
+  private static int KeywordCheck() {
+    tokenStr = new String(tokenStrArr, 0, tokenStrLen - apxLen);
+    Object token = kwHt[tokenStr];
+    return (token == null) ? -1 : (int)token;
+  } // KeywordCheck
+
+
+  public static int Hash(String s) {
+  //-----------------------------------|----------------------------------------
+    Object spix = nHt[s];
+    if (spix == null) {
+      if (caseSensitive)
+        nl.Add(s);
+      else
+        nl.Add(s.ToUpper());
+      spix   = nl.Count - 1;
+      nHt[s] = spix;
+    } // if
+    return (int)spix;
+  } // Hash
+  
+  
+  public static String HashedStr(int spix) {
+  //-----------------------------------|----------------------------------------
+    return (String)nl[spix];
+  } // HashedStr
+
+
+  public static void GETidentAttr(out string identStr) {
+    identStr = tokenStr;
+  } // GETidentAttr
+  
+  public static void GETsourceAttr()  {
+  } // GETsourceAttr
+
+} // GPDefLex
+
+// End of GPDefLex.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSem.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSem.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSem.cs	(revision 9430)
@@ -0,0 +1,427 @@
+// GPDefSem.cs                                              HDO, 2006-08-28
+// -------------
+// Semantic evaluator for table-driven top-down parsing.
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+
+using Lex = GPDefLex;
+using Syn = GPDefSyn;
+
+public class GPDefSem {
+
+
+  public const String MODULENAME = "GPDefSem";
+
+  public static void GPDefSemMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        return;
+    } // switch
+  } // GPDefSemMethod
+
+
+  // *** start of global SYN and SEM declarations from ATG ***
+  
+  static StringBuilder srcText;
+  public static HeuristicLab.Optimization.IProblem problem;
+
+  // *** end of global SYN and SEM declarations from ATG ***
+
+  
+  private static void P_source() {
+    Lex.GETsourceAttr();
+    GPDefSem.srcText = new StringBuilder();
+    for (; ; ) {
+     switch (GPDefLex.curCh) {
+       case Utils.EF:
+         Errors.SemError(GPDefLex.curLine, GPDefLex.curCol, "end of file in source text");
+         return;
+       case '<':
+         GPDefLex.NextCh();
+         if (GPDefLex.curCh == '<') {
+           GPDefSem.srcText.Append('<');
+           Errors.Warning(GPDefLex.curLine, GPDefLex.curCol, "non closed source text before?");
+           GPDefLex.NextCh();
+         }
+         GPDefSem.srcText.Append('<');
+         break;
+       case '>':
+         GPDefLex.NextCh();
+         if (GPDefLex.curCh == '>') {
+           GPDefLex.curCh = ' ';          // force GPDefLex to get next character
+           SourceReader.Handle(GPDefSem.srcText.ToString());
+           return;
+         }
+         GPDefSem.srcText.Append('>');
+         break;
+       default:
+         GPDefSem.srcText.Append(GPDefLex.curCh);
+         GPDefLex.NextCh();
+         break;
+     }
+    }
+
+  } // P_source
+
+
+  private static void NT_GPDef() {
+    string identStr = "";
+    RuleNode ruleNode = null;
+    GPDefNode gpDef = new GPDefNode();
+    NonTerminalNode ntNode = null;
+    FitnessFunctionNode fitnessFunNode = null;
+    TerminalNode tNode = null;
+    problem = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          gpDef.Name = identStr;
+          break;
+        case 3: // SEM
+          SourceReader.WithNext((src) => gpDef.ClassCodeNode = new CodeNode{SrcCode = src});
+          break;
+        case 4: // SEM
+          SourceReader.WithNext((src) => gpDef.InitCodeNode = new CodeNode{SrcCode = src});
+          break;
+        case 5:
+          NT_NonterminalDecl(out ntNode);
+          break;
+        case 6: // SEM
+          gpDef.NonTerminals.Add(ntNode);
+          break;
+        case 7:
+          NT_TerminalDecl(out tNode);
+          break;
+        case 8: // SEM
+          gpDef.Terminals.Add(tNode);
+          break;
+        case 9:
+          NT_RuleDef(out ruleNode);
+          break;
+        case 10: // SEM
+          gpDef.Rules.Add(ruleNode);
+          break;
+        case 11: // SEM
+          fitnessFunNode = new FitnessFunctionNode();
+          gpDef.FitnessFunctionNode = fitnessFunNode;
+
+          break;
+        case 12: // SEM
+          fitnessFunNode.Maximization = true;
+          break;
+        case 13: // SEM
+          fitnessFunNode.Maximization = false;
+          break;
+        case 14: // SEM
+          SourceReader.WithNext((src) => fitnessFunNode.SrcCode = src);
+          break;
+        case 15:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 16: // SEM
+          SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader
+          var gen = new ProblemGenerator();
+          problem = gen.GenerateFromAst(gpDef);
+
+          break;
+      } // switch
+    } // for
+  } // NT_GPDef
+
+  private static void NT_SemAction(out RuleActionNode action) {
+    RuleActionNode myAction = null; action = null;
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1: // SEM
+          myAction = new RuleActionNode();
+          SourceReader.WithNext((src) => {myAction.SrcCode = src;});
+          action = myAction;
+
+          break;
+      } // switch
+    } // for
+  } // NT_SemAction
+
+  private static void NT_NonterminalDecl(out NonTerminalNode ntNode) {
+    string identStr = ""; ntNode = null;
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          var myNtNode = new NonTerminalNode();
+          ntNode = myNtNode;
+          myNtNode.Ident = identStr;
+          SourceReader.WithNext((src) => {myNtNode.FormalParameters = src;});
+
+          break;
+      } // switch
+    } // for
+  } // NT_NonterminalDecl
+
+  private static void NT_TerminalDecl(out TerminalNode tNode) {
+    string identStr = "";
+    tNode = null;
+    TerminalNode myTNode = null;
+    IEnumerable<ConstraintNode> constraints = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          myTNode = new TerminalNode();
+          tNode = myTNode;
+          myTNode.Ident = identStr;
+          SourceReader.WithNext((src) => {
+            myTNode.FormalParameters = src;
+            myTNode.FieldDefinitions = SourceReader.ExtractFormalParameters(src);
+          });
+          
+
+          break;
+        case 3:
+          NT_ConstraintDef(out constraints);
+          break;
+        case 4: // SEM
+          myTNode.Constraints = constraints;
+          break;
+      } // switch
+    } // for
+  } // NT_TerminalDecl
+
+  private static void NT_ConstraintDef(out IEnumerable<ConstraintNode> constraints) {
+    List<ConstraintNode> constraintsList = new List<ConstraintNode>();
+    ConstraintNode n = null;
+    constraints = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_ConstraintRule(out n);
+          break;
+        case 2: // SEM
+          constraintsList.Add(n);
+          break;
+        case 3: // SEM
+          constraints = constraintsList;
+          break;
+      } // switch
+    } // for
+  } // NT_ConstraintDef
+
+  private static void NT_ConstraintRule(out ConstraintNode constraint) {
+    string identStr = null;
+    constraint = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          constraint = new ConstraintNode(identStr);
+          break;
+        case 3:
+          NT_SetDefinition(constraint);
+          break;
+        case 4: // SEM
+          SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader
+          break;
+      } // switch
+    } // for
+  } // NT_ConstraintRule
+
+  private static void NT_SetDefinition(ConstraintNode constraint) {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1: // SEM
+          constraint.Type = ConstraintNodeType.Set;
+          break;
+        case 2: // SEM
+          SourceReader.WithNext((src) => {constraint.SetExpression = src;});
+          break;
+        case 3: // SEM
+          constraint.Type = ConstraintNodeType.Range;
+          break;
+        case 4: // SEM
+          SourceReader.WithNext((src) => {constraint.RangeMinExpression = src;});
+          break;
+        case 5: // SEM
+          SourceReader.Handle(GPDefSem.srcText.ToString()); // flush the source reader
+          SourceReader.WithNext((src) => {constraint.RangeMaxExpression = src;});
+          break;
+      } // switch
+    } // for
+  } // NT_SetDefinition
+
+  private static void NT_RuleDef(out RuleNode rule) {
+    RuleExprNode expr = null;
+    string identStr = null;
+    RuleNode myRule = null;
+    rule = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          myRule = new RuleNode();
+          rule = myRule;
+          myRule.NtSymbol = identStr;
+
+          break;
+        case 3: // SEM
+          SourceReader.WithNext((src) => {myRule.LocalCode = src;});
+
+          break;
+        case 4:
+          NT_SynExpr(out expr);
+          break;
+        case 5: // SEM
+          myRule.RuleExpr = expr;
+
+          break;
+      } // switch
+    } // for
+  } // NT_RuleDef
+
+  private static void NT_SynExpr(out RuleExprNode expr) {
+    expr = null;
+    AlternativesNode alt = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_SynTerm(out expr);
+          break;
+        case 2: // SEM
+          alt = new AlternativesNode();
+          alt.Add(expr);
+
+          break;
+        case 3:
+          NT_SynTerm(out expr);
+          break;
+        case 4: // SEM
+          alt.Add(expr); expr = alt;
+          break;
+      } // switch
+    } // for
+  } // NT_SynExpr
+
+  private static void NT_SynTerm(out RuleExprNode expr) {
+    SequenceNode seq = null; expr = null;
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_SynFact(out expr);
+          break;
+        case 2: // SEM
+          seq = new SequenceNode();
+          seq.Add(expr);
+
+          break;
+        case 3:
+          NT_SynFact(out expr);
+          break;
+        case 4: // SEM
+          seq.Add(expr); expr = seq;
+          break;
+      } // switch
+    } // for
+  } // NT_SynTerm
+
+  private static void NT_SynFact(out RuleExprNode expr) {
+    string identStr = "";
+    RuleActionNode action = null;
+    expr = null;
+
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr(out identStr);
+          break;
+        case 2: // SEM
+          var callNode = new CallSymbolNode{Ident = identStr};
+          SourceReader.WithNext((src) => {callNode.ActualParameter = src;});
+          expr = callNode;
+
+          break;
+        case 3:
+          NT_SemAction(out action);
+          break;
+        case 4: // SEM
+          expr = action;
+          break;
+      } // switch
+    } // for
+  } // NT_SynFact
+
+
+  public delegate void PragmaMethod();
+  public static PragmaMethod[] pragmaMethods = {
+      new PragmaMethod(P_source)
+    };
+
+
+  public static void StartSem() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_GPDef();
+          break;
+      } // switch
+    } // for
+  } // StartSem
+
+    
+} // GPDefSem
+
+// End of GPDefSem.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSyn.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSyn.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDefSyn.cs	(revision 9430)
@@ -0,0 +1,559 @@
+// GPDefSyn.cs                                              HDO, 2006-08-28
+// -------------
+// Table-driven top-down syntax analyzer (G-code interpreter).
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+// --- call pragma mehts. and exec. sem. acts. after syntax errors? ---
+#define CONTPRAGMAACTS            // !!!must be defined for SG and PGT!!! 
+#undef  CONTSEMACTS               // should not be defined 
+
+using System;
+using System.Text;
+
+using Lex = GPDefLex;
+using Sem = GPDefSem;
+
+public class GPDefSyn {
+                   
+  public static String MODULENAME = "GPDefSyn";
+
+  // --- G-code instructions ---
+  public enum Instruction {
+    T, TA, TC, TCA, NT, NTA, ANY, ANYA, EPS, EPSA, JMP, RET
+  } // Instruction
+
+  private const int ROOTPC     =  209;
+  private const int LASTTERM   =   28;
+  private const int LASTPRAGMA =   29;
+
+
+  // --- other constants ---
+  private const int MINERRDIST   =   3;
+  private const int MAXSTACKLEN  = 100;
+  private const int EOFTOK       =   0;
+  private const int FIRSTNONTERM = LASTPRAGMA + 1;
+
+  public class NTData {
+    public int          startPC;
+    public bool         del;
+    public Sets.Set256  firstSet;
+    public NTData(int startPC, bool del, Sets.Set256 firstSet) {
+      this.startPC  = startPC;
+      this.del      = del;
+      this.firstSet = firstSet;
+    } // NTData
+  } // NTData
+  
+  private class GrammarTable {
+    public int[]  header = {
+      214, 28, 29, 40, 6, 0
+    };
+    public byte[] code = {
+         0,   1,   2,  28,   1,  14,   1,  14,  12,   0,  15,   1,  12,  17,
+         0,  16,   0,   5,   5,   1,  28,   0,   5,  18,  10,  19,   0,   0,
+        10,   5,   2,  39,   0,   7,  20,  10,  30,   0,   0,   6,   5,   3,
+        50,   0,   9,  22,  10,  41,   0,   8,   1,  23,   1,   8,  70,   0,
+        24,   8,   2,  26,   0,   2,   2,  28,  15,   0,  20,  28,  11,   0,
+         9,  25,  10,  58,   0,   2,  28,   1,  14,   0,  20,  11,   2,  28,
+         1,  14,   1,  11,  95,   0,   4,   8,   3,  16,   0,  20,  11,   2,
+        28,   1,   0,  18,  14,   1,   4, 109,   0,  15,   4,   4,   4,   0,
+        20,  17,  11,   4,   5,   1,  14,   1,  19, 131,   0,   4,   5,   3,
+        16,  10, 120,   0,   8,   3,  11,   4,   6,   1,  14,   5,   6, 147,
+         0,   3,  16,  10, 138,   0,   8,   4,  11,   3,  28, 157,   0,   1,
+        14,  11,   4,   7,   3,  16,  11,   0,   7,  13,  11,   5,   9, 175,
+         0,   1,  14,  10, 166,   0,   8,   3,  15,  11,   2,  28,   1,  14,
+         0,  15,   4,  10,   3,  16,  11,   1,  16, 199,   0,  13,   8,   6,
+        14,  11,   0,  17,  15,   8,   5,  16,   0,  27,  17,  11,   4,   0,
+         1,   0,   0,  11
+    };
+    public NTData[] nts = {
+      new NTData(   1, false, new Sets.Set256(0x0002)),
+      new NTData(  76, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData(  83, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData(  98, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 116, false, new Sets.Set256(0x0080, 0x1000)),
+      new NTData( 134, false, new Sets.Set256(0x0080, 0x1000)),
+      new NTData( 150, false, new Sets.Set256(0x0080, 0x1000)),
+      new NTData( 162, false, new Sets.Set256(0x0080)),
+      new NTData( 166, true , new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 179, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 190, false, new Sets.Set256(0x0000, 0x0003))
+    };
+    public Sets.Set256[] epsSets = {
+      new Sets.Set256(0x0300),
+      new Sets.Set256(0x0004),
+      new Sets.Set256(0x0000, 0x0010),
+      new Sets.Set256(0x0000, 0x0018),
+      new Sets.Set256(0x0000, 0x0800),
+      new Sets.Set256(0x0000, 0x1010)
+    };
+    public Sets.Set256[] anySets = {
+      new Sets.Set256(0x0000)
+    };
+    public String[] names = {
+      "end of file", "PROBLEM", "END", "EPS", "LOCAL", "NONTERMINALS",
+      "RULES", "SEM", "MAXIMIZE", "MINIMIZE", "TERMINALS", "CONSTRAINTS",
+      "INIT", "MUTATE", "CODE", "IN", "SET", "RANGE", "=", "|", ".", "(",
+      ")", "[", "]", "{", "}", "..", "ident", "source", "GPDef",
+      "NonterminalDecl", "TerminalDecl", "RuleDef", "SynExpr", "SynTerm",
+      "SynFact", "SemAction", "ConstraintDef", "ConstraintRule",
+      "SetDefinition"
+    };
+  } // GrammarTable;
+
+  private static GrammarTable gt;
+
+  private static int   pc;             // G-code counter
+  private static int[] stk;            // stack of G-code return adresses
+  private static int   sp;             // stack pointer
+  private static bool  mustRead;       // next Lex.token to read
+  private static int   altRoot;        // root of alternative chain
+  private static bool  leaveOrEnter;   // leaveCnt > 0 OR enterCnt > 0
+  private static int   leaveCnt;       // nr. of sem. proc. to leave
+  private static int   enterCnt;       // nr. of sem. proc. to enter
+  private static int   errDist;        // current error distance
+  private static int[] stkAtErr;       // saved stack at error position
+  private static int[] newSP;          // new stack length
+  private static int[] newPC;          // pc after recovery
+
+
+  public static void GPDefSynMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        Errors.InstallStopParsingMethod(StopParsing);
+        gt       = new GrammarTable();
+        stk      = new int[MAXSTACKLEN];
+        stkAtErr = new int[MAXSTACKLEN];
+        newSP    = new int[LASTTERM + 1];
+        newPC    = new int[LASTTERM + 1];
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        gt       = null;
+        stk      = null;
+        stkAtErr = null;
+        newSP    = null;
+        newPC    = null;
+        break;
+    } // switch
+  } // GPDefSynMethod
+
+  private static void Push(int pc) {
+    if (sp < MAXSTACKLEN)
+      stk[sp++] = pc;
+    else
+      Errors.Restriction(MODULENAME, "Push", "parser stack overflow");
+  } // Push
+
+  private static int Pop() {
+    if (sp > 0)
+      return stk[--sp];
+    else {
+      Errors.CompilerError(MODULENAME, "Pop", "parser stack underflow");
+      return 0;
+    } // else
+  } // Pop
+
+  private static void GetNextToken() {
+    for (;;) {
+      Lex.GetToken(); // updates Lex.token
+      if (Lex.token <= LASTTERM)
+        return;
+  #if !CONTPRAGMAACTS
+      if (NumOfSynErrors() == 0)
+  #endif
+        Sem.pragmaMethods[Lex.token - LASTTERM - 1]();
+    } // for
+  } // GetNextToken
+
+  private static int AdrAt(int pc) {
+    return (gt.code[pc - 1] |
+           (gt.code[pc    ] << 8));
+  } // AdrAt
+
+  private static void AdjustPC(ref int pc) {
+    if (pc == 0)
+      return;
+    for (;;)
+      switch ((Instruction)gt.code[pc - 1]) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+        case Instruction.NT:
+        case Instruction.NTA:
+        case Instruction.ANY:
+        case Instruction.ANYA:
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          return;
+        case Instruction.JMP:
+          pc = AdrAt(pc + 1);
+          break;
+        case Instruction.RET:
+          pc = 0;
+          return;
+        default:
+          pc++; // syn. or sem. action
+          break;
+      } // switch
+  } // AdjustPC
+
+  private static void GetSymInstr(int pc, 
+                        out int opcode, out int sy, out int nextPC, out int altPC) {
+    opcode = gt.code[pc - 1];
+    nextPC = 0; // dummy init
+    altPC  = 0; // dummy init 
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.TA:
+      case Instruction.TC:
+      case Instruction.TCA:
+      case Instruction.ANYA:
+      case Instruction.EPS:
+      case Instruction.EPSA:
+        sy = gt.code[pc];
+        break;
+      case Instruction.NT:
+      case Instruction.NTA:
+        sy = gt.code[pc] + FIRSTNONTERM;
+        break;
+      default: // ANY, JMP, RET, SEM, SYN 
+        sy = 0;
+        break;
+    } // switch
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.EPS:
+        nextPC = pc + 2;
+        altPC = 0;
+        break;
+      case Instruction.TC:
+      case Instruction.NT:
+        nextPC = pc + 3;
+        altPC = 0;
+        break;
+      case Instruction.TA:
+      case Instruction.ANYA:
+      case Instruction.EPSA:
+        nextPC = pc + 4;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.TCA:
+      case Instruction.NTA:
+        nextPC = pc + 5;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.ANY:
+        nextPC = pc + 1;
+        altPC = 0;
+        break;
+    } // switch
+    AdjustPC(ref nextPC);
+    AdjustPC(ref altPC);
+  } // GetSymInstr
+
+  private static void Fill(int pc, int sp) {
+    int opcode, sy, nextPC, altPC, i;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+          newPC[sy] = pc;
+          newSP[sy] = sp;
+          break;
+        case Instruction.NT:
+        case Instruction.NTA:
+          for (i = 0; i <= LASTTERM; i++)
+            if (Sets.member((ushort)i, gt.nts[sy - FIRSTNONTERM].firstSet)) {
+              newPC[i] = pc;
+              newSP[i] = sp;
+            }
+          if (gt.nts[sy - FIRSTNONTERM].del)
+            Fill(nextPC, sp);
+          break;
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          Fill(nextPC, sp);
+          break;
+      } // switch
+      pc = altPC;
+    } // while
+  } // Fill
+
+  private static void FillSucc(int pc, int sp) {
+    int opcode, sy, nextPC, altPC;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      if (nextPC > 0)
+        Fill(nextPC, sp);
+      pc = altPC;
+    } // while
+  } // FillSucc
+
+  private static void Triple(int altRoot) {
+    for (int i = 0; i <= LASTTERM; i++) { // clear triple list
+      newPC[i] = 0;
+      newSP[i] = 0;
+    } // for
+    for (int i = 1; i <= sp; i++) {       // successors of stacked nt's
+      FillSucc(stk[i - 1], i - 1);
+      Fill(stk[i - 1], i - 1);
+    } // for
+    FillSucc(altRoot, sp);                // successors of alt. chain
+    Fill(altRoot, sp);                    // current alt. chain
+  } // Triple
+
+  private static void HandleSynErr(ref int pc, ref int altRoot) {
+    int     opcode, sy, nextPC, altPC, adjPC, nwSP, eq;
+    bool    nameInMsg;
+    String  name;
+    StringBuilder msg = new StringBuilder();
+    leaveOrEnter = false;
+    if (errDist >= MINERRDIST) { // --- primary error
+      nameInMsg = false;
+      adjPC = altRoot;
+      AdjustPC(ref adjPC);
+      while (adjPC > 0) {
+        GetSymInstr(adjPC, out opcode, out sy, out nextPC, out altPC);
+        if ( (Instruction)opcode >= Instruction.T  && 
+             (Instruction)opcode <= Instruction.NTA  ) {
+          if ( gt.names[sy].IndexOf(' ') >= 0 || 
+               !Char.IsLetter(gt.names[sy][0]) )
+            name = "\"" + gt.names[sy] + "\"";
+          else
+            name = gt.names[sy];
+          if (name.IndexOf('{') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("{", "{{");
+          if (name.IndexOf('}') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("}", "}}");
+          if (msg.Length + name.Length + 2 > 80) {
+            msg.Append(" ...");
+            break;
+          } // if
+          if (!nameInMsg) {
+            nameInMsg = true;
+            msg.Append("expected: " + name);
+          } else {
+            msg.Append(", ");
+            msg.Append(name);
+          } // else
+        } // if
+        adjPC = altPC;
+      } // while
+      if (!nameInMsg)
+        msg.Append("syntax error");
+      Errors.SynError(Lex.tokenLine, Lex.tokenCol, msg.ToString(), "");
+      Triple(altRoot);
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      leaveCnt = sp - nwSP;
+      enterCnt = 0;
+      Array.Copy(stk, stkAtErr, stk.Length); // save stack
+    } else {                 // --- spurios error
+      if (errDist == 0) {    // no token used since last error
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // if
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter) 
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      eq = 2;                // compare stkAtErr and stk
+      while (eq <= sp && eq <= nwSP && stkAtErr[eq - 1] == stk[eq - 1])
+        eq++;
+      eq--;                  // stacks are equal up to index eq
+      leaveCnt = sp - eq;
+      if (nwSP < eq) {
+        leaveCnt = sp - nwSP;
+        enterCnt = 0;
+      } else if (nwSP > eq)
+        enterCnt = nwSP - eq;
+      else // nwSP == eq
+        enterCnt = 0;
+      Array.Copy(stkAtErr, stk, stk.Length); // restore stack
+    } // else
+    leaveOrEnter = (leaveCnt + enterCnt) > 0;
+    sp = nwSP;
+    pc = newPC[Lex.token];
+    altRoot = pc;
+    errDist = 0;
+  } // HandleSynErr
+
+  public static int Interpret() {
+  //-----------------------------------|----------------------------------------
+    int actionNr, opcode, currPC;
+    for (;;) {
+      opcode = gt.code[pc - 1];
+      if ( !leaveOrEnter && mustRead && 
+           (Instruction)opcode <= Instruction.EPSA ) {
+        GetNextToken();
+        mustRead = false;
+        errDist++;
+        altRoot = pc;
+      } // if
+      if (leaveOrEnter) {
+        if (leaveCnt > 0) {
+          leaveCnt--;
+          actionNr = 0;
+        } else { // enterCnt > 0
+          enterCnt--;
+          actionNr = gt.code[stkAtErr[sp - enterCnt - 1] - 2];
+        } // else
+        leaveOrEnter = (leaveCnt + enterCnt) > 0;
+        return actionNr;
+      } // if
+      pc++;
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+          if (Lex.token == gt.code[pc - 1])
+            if (Lex.token != EOFTOK) {
+              pc++;
+              mustRead = true;
+            } else {
+              return 0;
+            } // else
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.TC:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 2;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TCA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 4;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.NT:
+          currPC = gt.code[pc - 1];
+          if ( gt.nts[currPC].del || 
+               Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet) ) {
+            pc++;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.NTA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet)) {
+            pc += 3;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.ANY:
+          mustRead = true;
+          break;
+        case Instruction.ANYA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.anySets[currPC - 1])) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.EPS:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc++;
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.EPSA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc += 3;
+          else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.JMP:
+          pc = AdrAt(pc);
+          break;
+        case Instruction.RET:
+          pc = Pop();
+          altRoot = pc;
+          return 0;
+        default:
+          if (opcode <= 128) {
+  #if !CONTSEMACTS
+          if (Errors.NumOfSynErrors() == 0)
+  #endif
+            return opcode - 12;
+          } else // opcode > 128
+            return opcode - 128;
+          break;
+      } // switch
+    } // for
+  } // Interpret
+
+
+  public static bool Parse() {
+  //-----------------------------------|----------------------------------------
+    Lex.InitLex();
+    sp           = 0;
+    pc           = ROOTPC;
+    altRoot      = pc;
+    mustRead     = true;
+    errDist      = MINERRDIST + 1;
+    leaveOrEnter = false;
+    leaveCnt     = 0;
+    enterCnt     = 0;
+    Sem.StartSem();
+    return Errors.NumOfSynErrors() == 0;
+  } // Parse
+
+
+  public static void StopParsing() {
+  //-----------------------------------|----------------------------------------
+    leaveCnt     = sp + 1;
+    enterCnt     = 0;
+    leaveOrEnter = true;
+  } // StopParsing
+
+} // GPDefSyn
+ 
+// End of GPDefSyn.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Grammar.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Grammar.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Grammar.cs	(revision 9430)
@@ -0,0 +1,147 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+public class Grammar {
+  private class Sequence : List<string> {
+    public override string ToString() {
+      var sb = new StringBuilder();
+      foreach (var e in this) {
+        sb.Append(e).Append(" ");
+      }
+      return sb.ToString();
+    }
+  }
+  private class Alternatives : List<Sequence> {
+    public override string ToString() {
+      var sb = new StringBuilder();
+      if (Count == 0)
+        sb.Append("EPS");
+      else
+        sb.Append(this[0]);
+      foreach (var e in this.Skip(1)) {
+        sb.Append("| ").Append(e);
+      }
+      return sb.ToString();
+    }
+  }
+
+  private Dictionary<string, Alternatives> alternatives = new Dictionary<string, Alternatives>();
+  private Dictionary<string, string> localDefinitions = new Dictionary<string, string>();
+  private Dictionary<string, List<IEnumerable<RuleExprNode>>> seqWithActions = new Dictionary<string, List<IEnumerable<RuleExprNode>>>();
+  public string RootSymbol { get; private set; }
+  public IEnumerable<string> Symbols { get; private set; }
+
+  public Grammar(IEnumerable<SymbolNode> ntSymbols, IEnumerable<SymbolNode> tSymbols, List<RuleNode> ruleNodes) {
+    CheckGrammarConstraints(ntSymbols, tSymbols, ruleNodes);
+    foreach (var ruleNode in ruleNodes) {
+      alternatives[ruleNode.NtSymbol] = ToAlternatives(ruleNode.RuleExpr);
+      localDefinitions[ruleNode.NtSymbol] = ruleNode.LocalCode;
+      seqWithActions[ruleNode.NtSymbol] = ToAlternativesWithActions(ruleNode.RuleExpr);
+    }
+    RootSymbol = ruleNodes.First().NtSymbol;
+    Symbols = ntSymbols.Select(n => n.Ident).Concat(tSymbols.Select(n => n.Ident)).ToList();
+  }
+
+  private List<IEnumerable<RuleExprNode>> ToAlternativesWithActions(RuleExprNode ruleExprNode) {
+    var l = new List<IEnumerable<RuleExprNode>>();
+    var altNode = ruleExprNode as AlternativesNode;
+    if (altNode != null) {
+      l.AddRange(altNode.Alternatives.Select(expr => Flatten(expr)));
+    } else {
+      l.Add(Flatten(ruleExprNode));
+    }
+    return l;
+  }
+
+  private IEnumerable<RuleExprNode> Flatten(RuleExprNode expr) {
+    var seqNode = expr as SequenceNode;
+    var callNode = expr as CallSymbolNode;
+    var actionNode = expr as RuleActionNode;
+    if (seqNode != null) {
+      return seqNode.Sequence;
+    } else if (callNode != null) {
+      return Enumerable.Repeat(callNode, 1);
+    } else if (actionNode != null) {
+      return Enumerable.Repeat(actionNode, 1);
+    } else {
+      throw new NotSupportedException();
+    }
+  }
+
+  public IEnumerable<List<string>> GetAlternatives(string sy) {
+    if (!alternatives.ContainsKey(sy)) return Enumerable.Empty<List<string>>();
+    return alternatives[sy];
+  }
+
+  public string GetLocalDefinitions(string sy) {
+    if (!localDefinitions.ContainsKey(sy)) return string.Empty;
+    return localDefinitions[sy];
+  }
+
+  private Alternatives ToAlternatives(RuleExprNode ruleExprNode) {
+    var alt = new Alternatives();
+    var altNode = ruleExprNode as AlternativesNode;
+    if (altNode != null) {
+      alt.AddRange(altNode.Alternatives.Select(expr => ToSequence(expr)));
+    } else {
+      alt.Add(ToSequence(ruleExprNode));
+    }
+    return alt;
+  }
+
+  private Sequence ToSequence(RuleExprNode ruleExprNode) {
+    var seqNode = ruleExprNode as SequenceNode;
+    var callNode = ruleExprNode as CallSymbolNode;
+    var actionNode = ruleExprNode as RuleActionNode;
+    var seq = new Sequence();
+    if (seqNode != null) {
+      // keep only the nodes refering to symbols
+      seq.AddRange(seqNode.Sequence.OfType<CallSymbolNode>().Select(n => n.Ident));
+    } else if (callNode != null) {
+      seq.Add(callNode.Ident);
+    } else if (actionNode != null) {
+      throw new NotSupportedException();
+    } else {
+      throw new NotSupportedException();
+    }
+    return seq;
+  }
+
+  public IEnumerable<RuleExprNode> GetSequenceWithSemanticActions(string sy, int altIdx) {
+    return seqWithActions[sy][altIdx];
+  }
+
+  // should be checked when reading the grammar?
+  private void CheckGrammarConstraints(IEnumerable<SymbolNode> ntSymbols, IEnumerable<SymbolNode> tSymbols, List<RuleNode> rules) {
+    /* rules: 
+     *  - one rule for each non-terminal symbol 
+     *  - LL(1)
+     *  - alternatives have to be single-symbol chains
+     *  - all symbols used on the right hand side have to be defined
+     */
+
+    //// only one rule for non-terminal symbols
+    //var dupSymbols = rules.GroupBy(r => r.NtSymbol).Where(g => g.Count() > 1);
+    //if (dupSymbols.Count() > 0) throw new ArgumentException("Two grammar rules for " + dupSymbols.Select(g => g.Key).Aggregate("", (s, s1) => s + ", " + s1));
+
+    //// a rule for all non-terminal symbols
+    //foreach (var ntSymbol in ntSymbols) {
+    //  if (rules.All(r => r.NtSymbol != ntSymbol.Ident)) throw new ArgumentException("No grammar rule for NTSymbol " + ntSymbol);
+    //}
+
+    //foreach (var r in rules) {
+
+    //}
+  }
+
+  public override string ToString() {
+    var sb = new StringBuilder();
+    foreach (var entry in alternatives) {
+      sb.Append(entry.Key).Append(" -> ").AppendLine(entry.Value.ToString());
+    }
+    return sb.ToString();
+  }
+
+}
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 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/HeuristicLab.Problems.GPDL-3.4.csproj	(revision 9430)
@@ -0,0 +1,252 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E4EE5AFB-D552-447B-8A16-6CBE7938AF32}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.GPDL</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.GPDL-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <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>
+    <Compile Include="AST.cs" />
+    <Compile Include="Grammar.cs" />
+    <Compile Include="InterpreterBuilder.cs" />
+    <Compile Include="MethodBuilder.cs" />
+    <Compile Include="ProblemGenerator.cs" />
+    <Compile Include="SourceReader.cs" />
+    <Compile Include="SymbolBuilder.cs" />
+    <None Include="GPDef.atg" />
+    <None Include="HeuristicLab.snk" />
+    <Compile Include="Coco-2\Errors.cs" />
+    <Compile Include="Coco-2\Sets.cs" />
+    <Compile Include="Coco-2\Utils.cs" />
+    <Compile Include="GPDefLex.cs" />
+    <Compile Include="GPDefSem.cs" />
+    <Compile Include="GPDefSyn.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="GPDef.pgt.lst" />
+    <Content Include="GPDef.sg.lst" />
+  </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>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+call GenerateFromAtg.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs	(revision 9430)
@@ -0,0 +1,33 @@
+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: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/MethodBuilder.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/MethodBuilder.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/MethodBuilder.cs	(revision 9430)
@@ -0,0 +1,53 @@
+using System.Collections.Generic;
+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/Plugin.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Plugin.cs.frame	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Plugin.cs.frame	(revision 9430)
@@ -0,0 +1,32 @@
+#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.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.GPDL {
+  [Plugin("HeuristicLab.Problems.GPDL","Provides classes to define genetic programming problems using GPDL.", "3.4.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.GPDL-3.4.dll", PluginFileType.Assembly)]
+  public class Plugin : PluginBase {
+  }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/ProblemGenerator.cs	(revision 9430)
@@ -0,0 +1,709 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Optimization;
+using Microsoft.CSharp;
+
+public class ProblemGenerator {
+  #region templates
+
+  private string usings = @"
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using System.Collections.Generic;
+using System.Linq;
+using System;
+using System.Threading;
+using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm;
+using HeuristicLab.SequentialEngine;
+using HeuristicLab.Selection;
+";
+
+  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? {
+  [StorableClass]
+  [Item(""?IDENT?Problem"", """")]
+  public sealed class ?IDENT?Problem : SingleObjectiveHeuristicOptimizationProblem<?IDENT?Evaluator, ISymbolicExpressionTreeCreator> {
+    public new ?IDENT?Evaluator Evaluator { 
+      get { return (?IDENT?Evaluator)base.Evaluator; }
+      set { base.Evaluator = value; }
+    }
+    public IValueParameter<ISymbolicExpressionGrammar> GrammarParameter { 
+      get { return (IValueParameter<ISymbolicExpressionGrammar>)Parameters[""SymbolicExpressionTreeGrammar""]; }
+    }
+
+    [Storable]
+    public ISymbolicExpressionGrammar Grammar { get { return GrammarParameter.Value; } }
+
+    [StorableConstructor]
+    private ?IDENT?Problem(bool deserializing) : base(deserializing) { 
+       Initialize();
+    }
+    private ?IDENT?Problem(?IDENT?Problem original, Cloner cloner) : base(original, cloner) {
+      Initialize();
+    }
+    public ?IDENT?Problem() { 
+      Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>(""SymbolicExpressionTreeGrammar"", new ?IDENT?Grammar(this)));
+      Parameters.Add(new FixedValueParameter<IntValue>(""MaximumSymbolicExpressionTreeDepth"", new IntValue(15)));
+      Parameters.Add(new FixedValueParameter<IntValue>(""MaximumSymbolicExpressionTreeLength"", new IntValue(100)));
+      Parameters.Add(new FixedValueParameter<IntValue>(""MaximumFunctionDefinitions"", new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<IntValue>(""MaximumFunctionArguments"", new IntValue(0)));
+      Initialize();
+
+      Evaluator = new ?IDENT?Evaluator(this);
+      SolutionCreator = new ProbabilisticTreeCreator();
+
+ 
+      Maximization.Value = Evaluator.Maximization;
+      MaximizationParameter.Hidden = true;
+    
+      InitializeOperators();
+    }    
+
+    private void Initialize() {
+      ?INITCODE?
+    }
+
+    private void InitializeOperators() {
+      // Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>());
+      Operators.Add(new SubtreeCrossover());
+      Operators.Add(new MultiSymbolicExpressionTreeManipulator());
+      Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
+      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
+      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
+      ParameterizeOperators();
+    }
+    private void ParameterizeOperators() {
+      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators).ToList();
+
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) {
+        op.SymbolicExpressionTreeGrammarParameter.ActualName = GrammarParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = ""MaximumSymbolicExpressionTreeDepth"";
+        op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = ""MaximumSymbolicExpressionTreeLength"";
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) {
+        op.MaximumFunctionArgumentsParameter.ActualName = ""MaximumFunctionArguments"";
+        op.MaximumFunctionDefinitionsParameter.ActualName = ""MaximumFunctionDefinitions"";
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.ChildParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?Problem(this, cloner);
+    }
+
+    public double Calculate(ISymbolicExpressionTree solution) {
+      InitSymbolStream(solution);
+      try {
+      ?FITNESSFUNCTION?
+      } catch(Exception e) {
+        var formatter = new SymbolicExpressionTreeStringFormatter();
+        Console.WriteLine(formatter.Format(solution));
+        throw;
+      }
+    }
+
+    ?ADDITIONALCODE?
+
+    private ISymbolicExpressionTreeNode rootNode;
+    private void InitSymbolStream(ISymbolicExpressionTree solution) {    
+      this.rootNode =  solution.Root.GetSubtree(0).GetSubtree(0);
+    }
+
+    ?INTERPRETERSOURCE?
+
+    ?CONSTRAINTSSOURCE?
+
+  }
+}";
+
+  private string symbolClassTemplate = @"
+namespace ?PROBLEMNAME? {
+  [StorableClass]
+  [Item(""?IDENT?"", """")]
+  public sealed class ?IDENT? : Symbol {
+    public override int MinimumArity {
+      get { return 0; }
+    }
+    public override int MaximumArity {
+      get { return byte.MaxValue; }
+    }
+
+    internal ?PROBLEMNAME?Problem problem;
+
+    [StorableConstructor]
+    private ?IDENT?(bool deserializing) : base(deserializing) { }
+    private ?IDENT?(?IDENT? original, Cloner cloner) : base(original, cloner) { 
+      this.problem = original.problem;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?(this, cloner);
+    }
+    public ?IDENT?(?PROBLEMNAME?Problem problem) : base(""?IDENT?"", string.Empty) { 
+      this.problem = problem;
+    }
+  }
+}";
+
+  private string terminalSymbolClassTemplate = @"
+namespace ?PROBLEMNAME? {
+  [StorableClass]
+  [Item(""?IDENT?"", """")]
+  public sealed class ?IDENT? : Symbol {
+    public override int MinimumArity {
+      get { return 0; }
+    }
+    public override int MaximumArity {
+      get { return 0; }
+    }
+
+    internal ?PROBLEMNAME?Problem problem;
+
+    [StorableConstructor]
+    private ?IDENT?(bool deserializing) : base(deserializing) { }
+    private ?IDENT?(?IDENT? original, Cloner cloner) : base(original, cloner) { 
+      this.problem = original.problem;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?(this, cloner);
+    }
+    public ?IDENT?(?PROBLEMNAME?Problem problem) : base(""?IDENT?"", string.Empty) { 
+      this.problem = problem;
+    }
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new ?IDENT?TreeNode(this);
+    }
+  }
+}";
+
+  private string treeNodeClassTemplate = @"
+namespace ?PROBLEMNAME? {
+  [StorableClass]
+  public sealed class ?IDENT?TreeNode : SymbolicExpressionTreeTerminalNode {
+    public new ?IDENT? Symbol {
+      get { return (?IDENT?)base.Symbol; }
+    }
+
+    ?FIELDS?
+
+    [StorableConstructor]
+    private ?IDENT?TreeNode(bool deserializing) : base(deserializing) { }
+    private ?IDENT?TreeNode(?IDENT?TreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      ?CLONECODE? 
+    }
+    public ?IDENT?TreeNode(?IDENT? symbol) : base(symbol) { }
+
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      ?RESETFIELDSCODE?
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      ?SHAKEFIELDSCODE?
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?TreeNode(this, cloner);
+    }    
+  }
+}";
+
+  private string grammarClassTemplate = @"
+namespace ?PROBLEMNAME? {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item(""?IDENT?Grammar"", """")]
+  public class ?IDENT?Grammar : SymbolicExpressionGrammar {
+    [StorableConstructor]
+    protected ?IDENT?Grammar(bool deserializing) : base(deserializing) { }
+    protected ?IDENT?Grammar(?IDENT?Grammar original, Cloner cloner) : base(original, cloner) { }
+    public ?IDENT?Grammar(?IDENT?Problem problem)
+      : base(ItemAttribute.GetName(typeof(?IDENT?Grammar)), ItemAttribute.GetDescription(typeof(?IDENT?Grammar))) {
+      Initialize(problem);
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?Grammar(this, cloner);
+    }
+
+    private void Initialize(?IDENT?Problem problem) {
+      ?CREATESYMBOLS?
+      var rootSymbol = ?ROOTSYMBOL?;
+
+      ?SETSUBTREECOUNTS?
+
+      // set start symbol
+      AddAllowedChildSymbol(StartSymbol, rootSymbol);
+
+      ?SETALLOWEDSUBTREECOUNTS?
+    }
+  }
+}
+";
+  private string evaluatorClassTemplate = @"
+namespace ?PROBLEMNAME? {
+  [StorableClass]
+  [Item(""?IDENT?Evaluator"", """")]  
+  public class ?IDENT?Evaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
+    private const string SymbolicExpressionTreeParameterName = ""SymbolicExpressionTree"";
+    private const string QualityParameterName = ""Quality"";
+
+    public override bool CanChangeName { get { return false; } }
+
+    #region parameter properties
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    public bool Maximization { get { return ?MAXIMIZATION?; }  }
+
+    public ?IDENT?Problem problem;
+
+    [StorableConstructor]
+    protected ?IDENT?Evaluator(bool deserializing) : base(deserializing) { }
+    protected ?IDENT?Evaluator(?IDENT?Evaluator original, Cloner cloner)
+      : base(original, cloner) {
+      this.problem = original.problem;
+    }
+    public ?IDENT?Evaluator(?IDENT?Problem problem)
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName));
+      this.problem = problem;
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ?IDENT?Evaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var solution = SymbolicExpressionTreeParameter.ActualValue;
+      double quality = problem.Calculate(solution);
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.Apply();
+    }
+  }
+}
+";
+  #endregion
+
+  private StringBuilder problemSourceCode;
+
+  public ProblemGenerator() {
+    problemSourceCode = new StringBuilder();
+  }
+
+  public IProblem GenerateFromAst(GPDefNode definition) {
+    problemSourceCode.AppendLine(usings);
+
+    GenerateSymbols(definition.NonTerminals);
+    GenerateSymbols(definition.Terminals);
+
+    GenerateTreeNodes(definition.Terminals);
+    GenerateGrammar(definition);
+
+    GenerateEvaluator(definition);
+    GenerateProblem(definition);
+    GenerateMain(definition);
+
+    problemSourceCode.Replace("?PROBLEMNAME?", definition.Name);
+
+    using (var stream = new StreamWriter(definition.Name + ".cs")) {
+      stream.WriteLine(problemSourceCode.ToString());
+    }
+
+    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);
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Common-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Common.Resources-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Core-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Data-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Random-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Persistence-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.PluginInfrastructure-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Optimization-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Optimization.Operators-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Operators-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Collections-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Parameters-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Problems.DataAnalysis-3.4.dll");
+      parameters.ReferencedAssemblies.Add(@"ALGLIB-3.7.0.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Problems.Instances-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.SequentialEngine-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.ParallelEngine-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll");
+      parameters.ReferencedAssemblies.Add(@"HeuristicLab.Selection-3.3.dll");
+
+      CompilerResults results = csc.CompileAssemblyFromSource(parameters, problemSourceCode.ToString());
+      results.Errors.Cast<CompilerError>().ToList().ForEach(error => Console.WriteLine(error.Line + " " + error.ErrorText));
+
+      var asm = results.CompiledAssembly;
+      AppDomain.CurrentDomain.Load(asm.GetName());
+      var problem = Activator.CreateInstance(asm.FullName, definition.Name + "." + definition.Name + "Problem").Unwrap();
+      return (HeuristicLab.Optimization.IProblem)problem;
+    }
+  }
+
+
+
+  private void GenerateEvaluator(GPDefNode definition) {
+    var evaluatorClassCode =
+      evaluatorClassTemplate
+        .Replace("?IDENT?", definition.Name)
+        .Replace("?MAXIMIZATION?", definition.FitnessFunctionNode.Maximization ? "true" : "false");
+    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) {
+    var problemClassCode =
+      problemClassTemplate
+        .Replace("?IDENT?", definition.Name)
+        .Replace("?FITNESSFUNCTION?", definition.FitnessFunctionNode.SrcCode)
+        .Replace("?INTERPRETERSOURCE?", GenerateInterpreterSource(definition))
+        .Replace("?INITCODE?", definition.InitCodeNode.SrcCode)
+        .Replace("?ADDITIONALCODE?", definition.ClassCodeNode.SrcCode)
+        .Replace("?CONSTRAINTSSOURCE?", GenerateConstraintMethods(definition.Terminals));
+
+    problemSourceCode.AppendLine(problemClassCode).AppendLine();
+  }
+
+  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();
+  }
+
+  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 IEnumerable<{0}> GetAllowed{1}_{2}() {{ return {3}; }}", fieldType, t.Ident, c.Ident, c.SetExpression).AppendLine();
+      }
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateInterpreterSource(GPDefNode definition) {
+    var sb = new StringBuilder();
+    var g = new Grammar(definition.NonTerminals, definition.Terminals, definition.Rules);
+    string formalParameter = definition.NonTerminals.Single(nt => nt.Ident == g.RootSymbol).FormalParameters;
+    var actualParameterEnumerable =
+      SourceReader.ExtractFormalParameters(formalParameter).Select(e => e.RefOrOut + " " + e.Identifier);
+    string actualParameter = string.Empty;
+    if (actualParameterEnumerable.Any()) {
+      foreach (var e in actualParameterEnumerable) {
+        actualParameter += ", " + e;
+      }
+    }
+    sb.AppendFormat("void {0}({1}) {{ {0}(rootNode {2}); }}", g.RootSymbol, formalParameter, actualParameter).AppendLine();
+
+    foreach (var s in definition.NonTerminals) {
+      sb.AppendLine(GenerateInterpreterMethod(g, s));
+    }
+    foreach (var s in definition.Terminals) {
+      sb.AppendLine(GenerateTerminalInterpreterMethod(g, (TerminalNode)s));
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateTerminalInterpreterMethod(Grammar g, TerminalNode s) {
+    var sb = new StringBuilder();
+    if (!s.FormalParameters.Any())
+      sb.AppendFormat("private void {0}(ISymbolicExpressionTreeNode tree) {{", s.Ident);
+    else
+      sb.AppendFormat("private void {0}(ISymbolicExpressionTreeNode tree, {1}) {{", s.Ident, s.FormalParameters);
+    sb.AppendFormat("if (tree.Symbol == null || tree.Symbol.Name != \"{0}\") throw new InvalidOperationException();", s.Ident).AppendLine();
+    sb.AppendFormat("var cur = ({0}TreeNode)tree;", s.Ident).AppendLine();
+    foreach (var element in s.FieldDefinitions) {
+      sb.AppendFormat("{0} = cur.{0}", element.Identifier).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}(ISymbolicExpressionTreeNode tree) {{", s.Ident);
+    else
+      sb.AppendFormat("private void {0}(ISymbolicExpressionTreeNode tree, {1}) {{", s.Ident, s.FormalParameters);
+    sb.AppendLine(g.GetLocalDefinitions(s.Ident));
+    sb.AppendFormat("ISymbolicExpressionTreeNode subtree = null;").AppendLine();
+    sb.AppendFormat("if (tree.Symbol== null || tree.Symbol.Name != \"{0}\") throw new InvalidOperationException();", s.Ident).AppendLine();
+    var alts = g.GetAlternatives(s.Ident);
+    var lookahead = alts.Select(seq => seq.First());
+    if (lookahead.Count() > 1) {
+      sb.AppendLine("System.Diagnostics.Debug.Assert(tree.SubtreeCount == 1);");
+      sb.AppendLine("subtree = tree.GetSubtree(0);");
+      int i = 0;
+      sb.AppendFormat("if(subtree.Symbol.Name == \"{0}\") {{ ", lookahead.First()).AppendLine();
+      foreach (var e in g.GetSequenceWithSemanticActions(s.Ident, i++)) {
+        sb.AppendLine(GenerateSourceForAction(e));
+      }
+      foreach (var l in lookahead.Skip(1)) {
+        sb.AppendFormat("}} else if(subtree.Symbol.Name == \"{0}\") {{ ", l).AppendLine();
+        foreach (var e in g.GetSequenceWithSemanticActions(s.Ident, i++)) {
+          sb.AppendLine(GenerateSourceForAction(e));
+        }
+      }
+      sb.AppendFormat("}} else throw new System.InvalidOperationException(\"In {0} found symbol \"+tree.Symbol.Name+\". Expected one of: {1}\");", s.Ident, lookahead.Aggregate("", (acc, l) => acc + l + " ")).AppendLine();
+    } else {
+      int eIdx = 0;
+      foreach (var e in g.GetSequenceWithSemanticActions(s.Ident, 0)) {
+        if (e is CallSymbolNode) {
+          sb.AppendFormat("subtree = tree.GetSubtree({0});", eIdx++);
+        }
+        sb.AppendLine(GenerateSourceForAction(e));
+      }
+    }
+    sb.AppendLine("}");
+    return sb.ToString();
+  }
+
+  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}(subtree);", call.Ident);
+      else
+        return string.Format("{0}(subtree, {1});", call.Ident, call.ActualParameter);
+    } else {
+      throw new ArgumentException();
+    }
+  }
+
+  private void GenerateGrammar(GPDefNode definition) {
+    IEnumerable<SymbolNode> ntSymbols = definition.NonTerminals;
+    IEnumerable<SymbolNode> tSymbols = definition.Terminals;
+    List<RuleNode> ruleNodes = definition.Rules;
+    var g = new Grammar(ntSymbols, tSymbols, ruleNodes);
+    Console.WriteLine(g);
+
+    var grammarClassCode =
+      grammarClassTemplate
+        .Replace("?IDENT?", definition.Name)
+        .Replace("?CREATESYMBOLS?", GenerateGrammarSymbolDefinitionSource(g))
+        .Replace("?ROOTSYMBOL?", "_" + g.RootSymbol)
+        .Replace("?SETSUBTREECOUNTS?", GenerateGrammarSubtreeCountDefinitionSource(g))
+        .Replace("?SETALLOWEDSUBTREECOUNTS?", GenerateGrammarAllowedSubtreeDefinitionSource(g));
+
+
+    problemSourceCode.AppendLine(grammarClassCode).AppendLine();
+  }
+
+  private string GenerateGrammarSymbolDefinitionSource(Grammar g) {
+    StringBuilder sb = new StringBuilder();
+    foreach (var sy in g.Symbols) {
+      sb.AppendFormat("var _{0} = new {0}(problem); AddSymbol(_{0});", sy).AppendLine();
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateGrammarSubtreeCountDefinitionSource(Grammar g) {
+    StringBuilder sb = new StringBuilder();
+    foreach (var sy in g.Symbols) {
+      var alt = g.GetAlternatives(sy);
+      if (alt.Count() > 0) {
+        var minSeqLength = alt.Min(seq => seq.Count);
+        var maxSeqLength = alt.Max(seq => seq.Count);
+        sb.AppendFormat("SetSubtreeCount(_{0}, {1}, {2});", sy, maxSeqLength, minSeqLength).AppendLine();
+      } else {
+        sb.AppendFormat("SetSubtreeCount(_{0}, {1}, {2});", sy, 0, 0).AppendLine();
+      }
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateGrammarAllowedSubtreeDefinitionSource(Grammar g) {
+    StringBuilder sb = new StringBuilder();
+    foreach (var sy in g.Symbols) {
+      foreach (var seq in g.GetAlternatives(sy)) {
+        for (int argIdx = 0; argIdx < seq.Count; argIdx++) {
+          var childSy = seq[argIdx];
+          sb.AppendFormat("AddAllowedChildSymbol(_{0}, _{1}, {2});", sy, childSy, argIdx).AppendLine();
+        }
+      }
+    }
+    return sb.ToString();
+  }
+
+  private void GenerateTreeNodes(IEnumerable<SymbolNode> symbols) {
+    foreach (var s in symbols.OfType<TerminalNode>()) {
+      var classCode = treeNodeClassTemplate
+        .Replace("?IDENT?", s.Ident)
+        .Replace("?RESETFIELDSCODE?", GenerateNodeInitSourceCode(s))
+        .Replace("?SHAKEFIELDSCODE?", GenerateNodeUpdateSourceCode(s))
+        ;
+
+      StringBuilder fieldSource = new StringBuilder();
+      StringBuilder cloningSource = new StringBuilder();
+      foreach (var par in s.FieldDefinitions) {
+        fieldSource.AppendLine("[Storable]");
+        fieldSource.Append("internal ").Append(par.Type).Append(" ").Append(par.Identifier).AppendLine(";");
+
+        cloningSource.Append("this.").Append(par.Identifier)
+          .Append("=").Append("(").Append(par.Type).Append(")")
+          .Append("original.").Append(par.Identifier).AppendLine(";");
+
+      }
+
+      classCode = classCode.Replace("?FIELDS?", fieldSource.ToString());
+      classCode = classCode.Replace("?CLONECODE?", cloningSource.ToString());
+
+      problemSourceCode
+        .AppendLine(classCode)
+        .AppendLine();
+    }
+  }
+
+  private string GenerateNodeInitSourceCode(TerminalNode s) {
+    var sb = new StringBuilder();
+    sb.AppendLine("var problem = Symbol.problem;");
+    foreach (var f in s.FieldDefinitions) {
+      var cType = GetConstraintTypeFor(f.Identifier, s.Constraints);
+      if (cType == ConstraintNodeType.Range) {
+        sb.AppendFormat("var max_{1} = problem.GetMax{0}_{1}();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("var min_{1} = problem.GetMin{0}_{1}();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("{0} = min_{0} + random.NextDouble() * (max_{0} - min_{0});", f.Identifier).AppendLine();
+      } else if (cType == ConstraintNodeType.Set) {
+        sb.AppendFormat("var set_{1} = problem.GetAllowed{0}_{1}().ToList();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("{0} = set_{0}[random.Next(set_{0}.Count())];", f.Identifier).AppendLine();
+      }
+    }
+    return sb.ToString();
+  }
+
+  private string GenerateNodeUpdateSourceCode(TerminalNode s) {
+    var sb = new StringBuilder();
+    sb.AppendLine("var problem = Symbol.problem;");
+    foreach (var f in s.FieldDefinitions) {
+      var cType = GetConstraintTypeFor(f.Identifier, s.Constraints);
+      if (cType == ConstraintNodeType.Range) {
+        sb.AppendFormat("var max_{1} = problem.GetMax{0}_{1}();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("var min_{1} = problem.GetMin{0}_{1}();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("{0} = min_{0} + random.NextDouble() * (max_{0} - min_{0});", f.Identifier).AppendLine();
+      } else if (cType == ConstraintNodeType.Set) {
+        sb.AppendFormat("var set_{1} = problem.GetAllowed{0}_{1}().ToList();", s.Ident, f.Identifier).AppendLine();
+        sb.AppendFormat("{0} = set_{0}[random.Next(set_{0}.Count())];", f.Identifier).AppendLine();
+      }
+    }
+    return sb.ToString();
+  }
+
+  private ConstraintNodeType GetConstraintTypeFor(string id, IEnumerable<ConstraintNode> contraints) {
+    return contraints.Single(c => c.Ident == id).Type;
+  }
+
+  private void GenerateSymbols(List<SymbolNode> symbols) {
+    foreach (var s in symbols.OfType<NonTerminalNode>()) {
+      problemSourceCode
+        .AppendLine(symbolClassTemplate.Replace("?IDENT?", s.Ident))
+        .AppendLine();
+    }
+    foreach (var s in symbols.OfType<TerminalNode>()) {
+      problemSourceCode
+        .AppendLine(terminalSymbolClassTemplate.Replace("?IDENT?", s.Ident))
+        .AppendLine();
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Properties/AssemblyInfo.cs.frame	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Properties/AssemblyInfo.cs.frame	(revision 9430)
@@ -0,0 +1,54 @@
+#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.Reflection;
+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("HeuristicLab.Problems.GPDL")]
+[assembly: AssemblyDescription("Provides classes to create genetic programming problems using GPDL.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
+[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("B3B18403-394F-423D-ADD0-C65EF47D42E2")]
+// 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 Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.0.$WCREV$")]
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SourceReader.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SourceReader.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SourceReader.cs	(revision 9430)
@@ -0,0 +1,32 @@
+using System.Collections.Generic;
+using System;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+
+public class SourceReader {
+  private static Action<string> nextAction;
+  public static void WithNext(Action<string> action) {
+    if (nextAction != null) throw new ArgumentException();
+    nextAction = action;
+  }
+  public static void Handle(string src) {
+    if (nextAction != null)
+      nextAction(src);
+    nextAction = null;
+  }
+
+  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);
+    }
+    //var nParameters = match.Groups["id"].Captures.Count;
+    //for (int i = 0; i < nParameters; i++) {
+    //  yield return new TerminalNode.FieldDefinition(match.Groups["refOrOut"].Captures[i].Value, match.Groups["type"].Captures[i].Value, match.Groups["id"].Captures[i].Value);
+    //}
+  }
+}
Index: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SymbolBuilder.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SymbolBuilder.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/SymbolBuilder.cs	(revision 9430)
@@ -0,0 +1,49 @@
+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/PreBuildEvent.cmd
===================================================================
--- branches/HeuristicLab.Problems.GPDL/PreBuildEvent.cmd	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/PreBuildEvent.cmd	(revision 9430)
@@ -0,0 +1,11 @@
+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/Coco-2/Errors.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Errors.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Errors.cs	(revision 9430)
@@ -0,0 +1,437 @@
+// Errors.cs                                                     HDO, 2006-08-28
+// ---------
+// Error handling, storage of error messages and listing generation.
+//=====================================|========================================
+
+#undef TEST_ERRORS
+
+using System;
+using System.IO;
+
+public class Errors {
+
+  public const String MODULENAME = "Errors";
+
+  public static void ErrorsMethod(Utils.ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        aps = new AbortMethod[MAXABORTPROCS];
+        sp = 0;
+        PushAbortMethod(DefaultAbort);
+        stopParsing = null;
+        eowCnt = new int[4];
+        curEoW = new ErrorWarn[4];
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        eowl = null;
+        eowCnt = null;
+        curEoW = null;
+        return;
+    } // switch
+    // --- for initModule and resetModule ---
+    eowl = null;
+    numOfErrs = 0;
+    numOfWarns = 0;
+    for (int i = 0; i < 4; i++)
+      eowCnt[i] = 0;
+  } // ErrorsMethod
+
+
+  public const int MAXABORTPROCS = 3;
+  public const int MAXNUMOFERRS = 30; // sum of lex., syn. and sem. errors
+  public const int MAXNUMOFWARNS = 50;
+
+  public delegate void StopParsingMethod();
+
+  public delegate void AbortMethod(String abortKind, String moduleName,
+                                   String methodName, String descr);
+
+  enum EoWKind {
+    lexErr,
+    synErr,
+    semErr,
+    warn
+  } // EoWKind
+
+  public class ErrorWarnInfo {
+    public String msg;
+    public int line, col;
+  } // ErrorWarnInfo
+
+  private class ErrorWarn {
+    public EoWKind kind;
+    public ErrorWarnInfo info;
+    public ErrorWarn next;
+  } // ErrorWarn
+
+  private static AbortMethod[] aps; // abort method stack
+  private static int sp;  // stack pointer for aps
+  private static StopParsingMethod stopParsing;
+
+  // --- errors and/or warnings handling ---
+
+  private static ErrorWarn eowl;        // sorted list of errors or warnings
+  private static int numOfErrs, numOfWarns;
+  private static int[] eowCnt;
+
+  private static void DefaultAbort(String abortKind, String moduleName,
+                                   String funcName, String descr) {
+    Console.WriteLine();
+    Console.WriteLine("*** {0} in module {1} function {2}",
+                      abortKind, moduleName, funcName);
+    Console.WriteLine("*** {0}", descr);
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Environment.Exit(Utils.EXIT_FAILURE);
+  } // DefaultAbort
+
+
+  // --- install stop parsing and abort functions ---
+
+  public static void InstallStopParsingMethod(StopParsingMethod spp) {
+    //-----------------------------------|----------------------------------------
+    stopParsing = spp;
+  } // InstallStopParsingMethod
+
+  public static void PushAbortMethod(AbortMethod ap) {
+    //-----------------------------------|----------------------------------------
+    if (sp == MAXABORTPROCS)
+      Restriction(MODULENAME, "PushAbortFunc", "too many abort functions");
+    aps[sp++] = ap;
+  } // PushAbortMethod
+
+
+  // --- report error or restriction and call abort functions ---
+
+  public static void CompilerError(String moduleName, String funcName,
+                                   String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    for (int i = sp - 1; i >= 0; i--)
+      aps[i]("compiler error", moduleName, funcName, msg); // should not return*
+    DefaultAbort("compiler error", moduleName, funcName, msg);
+  } // CompilerError
+
+  public static void Restriction(String moduleName, String funcName,
+                                 String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    for (int i = sp - 1; i >= 0; i--)
+      aps[i]("restriction", moduleName, funcName, msg); // should not return
+    DefaultAbort("restriction", moduleName, funcName, msg);
+  } // Restriction
+
+  public static void CallStopParsing() {
+    //-----------------------------------|----------------------------------------
+    if (stopParsing != null)
+      stopParsing();
+  } // CallStopParsing
+
+
+  // --- storage of errors found on compilation ---
+
+  private static void EnterMessage(EoWKind knd, int line, int col, String msg) {
+    ErrorWarn eow, prveow, nxteow;
+    eowCnt[(int)knd]++;
+    eow = new ErrorWarn();
+    eow.kind = knd;
+    eow.info = new ErrorWarnInfo();
+    eow.info.line = line;
+    eow.info.col = col;
+    eow.info.msg = msg;
+    prveow = null;
+    nxteow = eowl;
+    while (nxteow != null && nxteow.info.line <= line) {
+      prveow = nxteow;
+      nxteow = nxteow.next;
+    } // while
+    while (nxteow != null && nxteow.info.line == line && nxteow.info.col <= col) {
+      prveow = nxteow;
+      nxteow = nxteow.next;
+    } // while
+    if (prveow == null)
+      eowl = eow;
+    else
+      prveow.next = eow;
+    eow.next = nxteow;
+  } // EnterMessage
+
+  private static void CheckForLimits(EoWKind knd, int line, int col) {
+    if (knd == EoWKind.lexErr || knd == EoWKind.synErr || knd == EoWKind.semErr) {
+      numOfErrs++;
+      if (numOfErrs == MAXNUMOFERRS) {
+        Warning(line, col, "too many errors, parsing stopped");
+        CallStopParsing();
+      } // if
+    } else { // knd == EoWKind.warn
+      numOfWarns++;
+      if (numOfWarns == MAXNUMOFWARNS) {
+        Warning(line, col, "too many warnings, parsing stopped");
+        CallStopParsing();
+      } // if
+    } // else
+  } // CheckForLimits
+
+
+  public static void LexError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.lexErr, line, col, msg);
+    CheckForLimits(EoWKind.lexErr, line, col);
+  } // SynError
+
+  public static void SynError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.synErr, line, col, msg);
+    CheckForLimits(EoWKind.synErr, line, col);
+  } // SynError
+
+  public static void SemError(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfErrs == MAXNUMOFERRS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.semErr, line, col, msg);
+    CheckForLimits(EoWKind.semErr, line, col);
+  } // SemError
+
+  public static void Warning(int line, int col, String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    if (numOfWarns == MAXNUMOFWARNS)
+      return;
+    TextWriter w = new StringWriter();
+    w.WriteLine(fmt, p);
+    String msg = w.ToString();
+    EnterMessage(EoWKind.warn, line, col, msg);
+    CheckForLimits(EoWKind.warn, line, col);
+  } // Warning
+
+
+  // --- retrieval of stored source errors and warnings ---
+
+  public static int NumOfErrors() {
+    //-----------------------------------|----------------------------------------
+    return numOfErrs;
+  } // NumOfErrors
+
+  public static int NumOfLexErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.lexErr];
+  } // NumOfLexErrors
+
+  public static int NumOfSynErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.synErr];
+  } // NumOfSynErrors
+
+  public static int NumOfSemErrors() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.semErr];
+  } // NumOfSemErrors
+
+  public static int NumOfWarnings() {
+    //-----------------------------------|----------------------------------------
+    return eowCnt[(int)EoWKind.warn];
+  } // NumOfWarnings
+
+
+  private static ErrorWarn[] curEoW;
+
+  private static ErrorWarnInfo GetMessage(bool first, EoWKind knd) {
+    ErrorWarn eow = null;
+    ErrorWarnInfo eowi = null;
+    if (first)
+      eow = eowl;
+    else
+      eow = curEoW[(int)knd].next;
+    while (eow != null && eow.kind != knd)
+      eow = eow.next;
+    curEoW[(int)knd] = eow;
+    if (eow == null) {
+      eowi = new ErrorWarnInfo();
+      eowi.msg = "";
+      eowi.line = 0;
+      eowi.col = 0;
+    } else
+      eowi = eow.info;
+    return eowi;
+  } // GetMessage
+
+  public static ErrorWarnInfo GetLexError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.lexErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetSynError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.synErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetSemError(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.semErr);
+  } // ErrorWarnInfo
+
+  public static ErrorWarnInfo GetWarning(bool first) {
+    //-----------------------------------|----------------------------------------
+    return GetMessage(first, EoWKind.warn);
+  } // ErrorWarnInfo
+
+
+  // --- listing generation ---
+
+  private static void PutMsg(TextWriter lst, ErrorWarn eow) {
+    switch (eow.kind) {
+      case EoWKind.lexErr:
+        lst.Write("+LEX+");
+        break;
+      case EoWKind.synErr:
+        lst.Write("*SYN*");
+        break;
+      case EoWKind.semErr:
+        lst.Write("#SEM#");
+        break;
+      case EoWKind.warn:
+        lst.Write("!WRN!");
+        break;
+    } // switch 
+    for (int i = 0; i < eow.info.col; i++)
+      lst.Write(" ");
+    lst.Write(" ^{0}", eow.info.msg);
+  } // PutMsg
+
+  public enum ListingShape {
+    longListing,
+    shortListing
+  } // ListingShape
+
+  public static void GenerateListing(TextReader src, TextWriter lst,
+                                     ListingShape listShape) {
+    //-----------------------------------|----------------------------------------
+    ErrorWarn eow = null;
+    int lnr, skip;
+    String srcLine;
+
+    ((StreamReader)src).BaseStream.Seek(0, SeekOrigin.Begin);
+
+    eow = eowl;
+    if (eow != null) {
+      while (eow != null && eow.info.line < 1) {
+        PutMsg(lst, eow);
+        eow = eow.next;
+      } // while
+      lst.WriteLine();
+    } // if
+    lnr = 1;
+    for (; ; ) {
+      if (listShape == ListingShape.shortListing) {
+        if (eow == null) {
+          lst.WriteLine("...");
+          break;
+        } // if
+        skip = eow.info.line - lnr;
+        if (skip > 0) {
+          lst.WriteLine("...");
+          lnr = eow.info.line;
+          while (skip-- > 0) {
+            srcLine = src.ReadLine();
+            if (srcLine == null)
+              break;
+          } // while
+        } // if
+      } // if
+      srcLine = src.ReadLine();
+      if (srcLine == null)
+        break;
+      lst.WriteLine("{0,5}| {1}", lnr, srcLine);
+      while (eow != null && eow.info.line == lnr) {
+        PutMsg(lst, eow);
+        eow = eow.next;
+      } // while
+      lnr++;
+    } // for
+    lst.WriteLine();
+    while (eow != null) {
+      PutMsg(lst, eow);
+      eow = eow.next;
+    } // while
+    lst.WriteLine();
+    lst.WriteLine("error(s) and warning(s):");
+    lst.WriteLine("-----------------------");
+    lst.WriteLine();
+    lst.WriteLine("{0,5} lexical error(s) ", NumOfLexErrors());
+    lst.WriteLine("{0,5} syntax error(s)  ", NumOfSynErrors());
+    lst.WriteLine("{0,5} semantic error(s)", NumOfSemErrors());
+    lst.WriteLine("{0,5} warning(s)       ", NumOfWarnings());
+  } // GenerateListing
+
+
+#if TEST_ERRORS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Errors");
+
+    Console.WriteLine("installing ...");
+    Utils.InstallModule("Utils",  new Utils.ModuleMethodDelegate(Utils.UtilsMethod));
+    Utils.InstallModule("Sets",   new Utils.ModuleMethodDelegate(Sets.SetsMethod  ));
+    Utils.InstallModule("Errors", new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));
+    Console.WriteLine("initModule ...");
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    LexError(1, 1, "LexError at {0}, {1}", 1, 1);
+    SynError(3, 10, "SynError at {0}, {1}", 2, 10);
+    SemError(5, 5, "SemError at {0}, {1}", 5, 5);
+    Warning(0, 0, "Warning  at {0}, {1}", 0, 0);
+    Warning(9, 0, "Warning  at {0}, {1}", 9, 0);
+
+    String srcName;
+    Utils.GetInputFileName("source file name > ", out srcName);
+    FileStream   srcFs = new FileStream(srcName, FileMode.Open);
+    StreamReader src   = new StreamReader(srcFs);
+    FileStream   lstFs = new FileStream(srcName + ".lst", FileMode.Create);
+    StreamWriter lst   = new StreamWriter(lstFs);
+
+    lst.WriteLine("START");
+    GenerateListing(src, lst, ListingShape.longListing);
+    lst.WriteLine("END");
+
+    src.Close();
+    lst.Close();
+    
+    Console.WriteLine("resetModule ...");
+    Utils.Modules(Utils.ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Errors
+
+// End of Errors.cs
+//=====================================|========================================
+
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Sets.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Sets.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Sets.cs	(revision 9430)
@@ -0,0 +1,314 @@
+// Sets.cs                                                      HDO, 2006-08-28
+// -------
+// Definition of types BitSet and Set256 as well as methods for their manipulation.
+//=====================================|========================================
+
+#undef TEST_SETS
+
+using System;
+using System.Text;
+
+public class Sets {
+
+  public const String MODULENAME = "Sets";
+
+  public static void SetsMethod(Utils.ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        emptySet = new Set256();
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        break;
+    } // switch
+  } // SetsFunc
+
+  public const ushort BITSET_BIT = 16;
+  public const ushort BITSET_MASK = 15;
+  public const ushort ELEM_MAX = 256; // max. nr. of elems in a Set256
+  public const ushort SET256_LEN = 16;
+
+  public class Set256 {
+
+    public ushort[] ushorts;
+
+    public Set256() {
+      ushorts = new ushort[SET256_LEN];
+    } // Set256
+
+    public Set256(params ushort[] paramUshorts) {
+      ushorts = new ushort[SET256_LEN];
+      for (int i = 0; i < paramUshorts.Length; i++)
+        ushorts[i] = paramUshorts[i];
+    } // Set256
+
+    public ushort this[int i] {
+      get {
+        return ushorts[i];
+      }
+      set {
+        ushorts[i] = value;
+      }
+    }
+
+    public override String ToString() {
+      StringBuilder sb = new StringBuilder("{");
+      bool first = true;
+      for (ushort i = 0; i < ELEM_MAX; i++)
+        if (member(i, this)) {
+          if (!first)
+            sb.Append(", ");
+          sb.Append(i.ToString());
+          first = false;
+        } // if
+      sb.Append("}");
+      return sb.ToString();
+    } // ToString
+
+  } // Set256
+
+  public static Set256 emptySet; // empty set constant 
+
+  // --- operations for BitSet arrays ---
+
+  private static void checkVal(ushort x) {
+    if ((x < 0) || (x > 255)) {
+      Errors.Restriction("Sets", "setincl", "value {0} out of supported range 0..255", x);
+    } // if
+ } //checkVal
+
+  // x member of s?
+  public static bool member(ushort x, Set256 s) {
+    //-----------------------------------|----------------------------------------
+    checkVal(x);
+    return Utils.TestBit(s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // member
+
+  // include x in s 
+  public static void setincl(ref Set256 s, ushort x) {
+    //-----------------------------------|----------------------------------------
+    checkVal(x);
+    Utils.SetBit(ref s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // setincl
+
+  // exclude x from s 
+  //-----------------------------------|----------------------------------------
+  public static void setexcl(ref Set256 s, ushort x) {
+    checkVal(x);
+    Utils.ClrBit(ref s.ushorts[x / BITSET_BIT], (ushort)(x & BITSET_MASK));
+  } // setexcl
+
+
+  // --- operations for type Set256 only ---
+
+  // init s, use
+  //   e or E for an <e>lement, e.g., setinit(s, "E", e)
+  //   r or R for a  <r>ange,   e.g., setinit(s, "R", lb, ub) 
+  public static void setinit(out Set256 s, String form, params ushort[] p) {
+    //-----------------------------------|----------------------------------------
+    int pi = 0;
+    ushort e, lb, ub;
+    s = new Set256();
+    foreach (char op in form) {
+      switch (op) {
+        case 'E':
+        case 'e':
+          e = p[pi++];  // single element e
+          setincl(ref s, e);
+          break;
+        case 'R':
+        case 'r':
+          lb = p[pi++]; // range lb .. ub
+          ub = p[pi++];
+          if (lb > ub)
+            Utils.FatalError(MODULENAME, "setinit", "lb > ub");
+          e = lb;
+          while (e <= ub) {
+            setincl(ref s, e);
+            e++;
+          } // while
+          break;
+        default:
+          Utils.FatalError(MODULENAME, "setinit",
+                           "unknown operation \'{0}\'", op.ToString());
+          break;
+      } // switch
+    } // while
+  } // setinit
+
+
+  // s1 <= s2? 
+  public static bool setle(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      if ((s1.ushorts[i] & ~(s2.ushorts[i])) != 0)
+        return false;
+      i++;
+    } // while 
+    return true;
+  } // setle
+
+
+  // sets s1 and s2 disjoint?
+  public static bool setdisjoint(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      if ((s1.ushorts[i] & s2.ushorts[i]) != 0)
+        return false;
+      i++;
+    } // while
+    return true;
+  } // setdisjoint
+
+
+  // s1 = s1 inters s2 
+  public static void setinters(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] &= s2.ushorts[i];
+      i++;
+    } // while
+  } // setinters
+
+
+  // s1 = s1 union s2
+  public static void setunion(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] |= s2.ushorts[i];
+      i++;
+    } // while
+  } // setunion
+
+  // s1 = s1 - s2 
+  public static void setdiff(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    int i = 0;
+    while (i < SET256_LEN) {
+      s1.ushorts[i] &= (ushort)(~(s2.ushorts[i]));
+      i++;
+    } // while
+  } // setdiff
+
+
+  // clear s, s = {}
+  public static void setclear(ref Set256 s) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      s.ushorts[i] = 0;
+  } // setclear
+
+  // set assignment, s1 = s2
+  public static void setcpy(ref Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      s1.ushorts[i] = s2.ushorts[i];
+  } // setcpy
+
+  // set comparison, s1 == s2? 
+  public static bool seteq(Set256 s1, Set256 s2) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      if (s1.ushorts[i] != s2.ushorts[i])
+        return false;
+    return true;
+  } // seteq
+
+  // s empty?
+  public static bool setempty(Set256 s) {
+    //-----------------------------------|----------------------------------------
+    for (int i = 0; i < SET256_LEN; i++)
+      if (s.ushorts[i] != 0)
+        return false;
+    return true;
+  } // setempty
+
+
+#if TEST_SETS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Sets");
+
+    Console.WriteLine("installing ...");
+    Utils.InstallModule("Utils", new Utils.ModuleMethodDelegate(Utils.UtilsMethod));
+    Utils.InstallModule("Sets",  new Utils.ModuleMethodDelegate(Sets.SetsMethod ));
+    Console.WriteLine("initModule ...");
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    Console.WriteLine("emptySet = " + emptySet);
+
+    Set256 s = new Set256();
+    Console.WriteLine("s = " + s);
+    setincl(ref s, 177);
+    setincl(ref s, 4);
+    Console.WriteLine("after setincl(ref s, 177) and setincl(ref s, 4), s = " + s);
+    setexcl(ref s, 177);
+    setexcl(ref s, 4);
+    Console.WriteLine("after setexcl(ref s, 177) and setexcl(ref s, 4), s = " + s);
+
+    setinit(out s, "E", 4);
+    Console.WriteLine("after setinit(out s, \"E\", 4), s = " + s);
+    setinit(out s, "R", 4, 177);
+    Console.WriteLine("after setinit(out s, \"R\", 4, 177), s = " + s);
+
+    Set256 a, b;
+    setinit(out a, "E", 4);
+    setinit(out b, "E", 5);
+    Console.WriteLine("setle(a, b) = " + setle(a, b));
+
+    setinit(out a, "R",   0,   9);
+    setinit(out b, "R",   9,  100);
+    Console.WriteLine("setdisjoint(a, b) = " + setdisjoint(a, b));
+
+    setinit(out a, "R", 0, 99);
+    setinit(out b, "R", 80, 100);
+    setinters(ref a, b);
+    Console.WriteLine("setinters(ref a, b) = " + a);
+
+    setinit(out a, "R", 0, 9);
+    setinit(out b, "R", 100, 109);
+    setunion(ref a, b);
+    Console.WriteLine("setunion(ref a, b) = " + a);
+
+    setinit(out a, "R", 0, 99);
+    setinit(out b, "R", 1, 98);
+    setdiff(ref a, b);
+    Console.WriteLine("setdiff(ref a, b) = " + a);
+
+    setclear(ref a);
+    Console.WriteLine("setclear(a) = " + a);
+
+    setinit(out b, "R", 0, 9);
+    setcpy(ref a, b);
+    Console.WriteLine("setcpy(a) = " + a);
+
+    Console.WriteLine("seteq(a, b) = " + seteq(a, b));
+
+    Console.WriteLine("setempty(a) = " + setempty(a));
+    Console.WriteLine("setempty(emptySet) = " + setempty(emptySet));
+
+    Console.WriteLine("resetModule ...");
+    Utils.Modules(Utils.ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Sets
+
+// End of Sets.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Utils.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Utils.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Coco-2/Utils.cs	(revision 9430)
@@ -0,0 +1,395 @@
+// Utils.cs                                       HDO, 2006-08-28; SN, 10.9.2007
+// --------
+// Collection of useful utilities (constants, types, and methods).
+//=====================================|========================================
+
+#undef TEST_UTILS
+
+using System;
+using System.IO;
+
+public class Utils {
+
+  public const String MODULENAME = "Utils";
+
+  public static void UtilsMethod(ModuleAction action, out String moduleName) {
+    //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case ModuleAction.getModuleName:
+        return;
+      case ModuleAction.initModule:
+        timerRuns = false;
+        break;
+      case ModuleAction.resetModule:
+        timerRuns = false;
+        break;
+      case ModuleAction.cleanupModule:
+        return;
+    } // switch
+  } // UtilsMethod
+
+  // --- general char constants ---
+  public const char EF = '\0';
+  public const char LF = '\n';
+  public const char NL = '\n';
+  public const char HT = '\t';
+  public const char VT = '\v';
+  public const char BS = '\b';
+  public const char CR = '\r';
+  public const char FF = '\f';
+  public const char BEL = '\a';
+
+  public const int UCHAR_MAX = 255;
+  public const int CHAR_BIT = 8;
+  public const long INT_MAX = 2147483647;
+  public const long INT_MIN = -INT_MAX;
+  public const int BYTE_MAX = UCHAR_MAX;
+  public const int BYTE_BIT = CHAR_BIT;
+
+  // --- general integer constants ---
+  public const int EXIT_FAILURE = -1;
+  public const int EXIT_SUCCESS = 0;
+  public const int KB = 1024;
+  public const int MB = KB * KB;
+
+  // --- module handling types and program module handling ---
+
+  public enum ModuleAction {
+    getModuleName,
+    initModule,
+    resetModule,
+    cleanupModule
+  } // ModuleAction
+
+  public delegate void ModuleMethodDelegate(ModuleAction action,
+                                            out String moduleName);
+
+  private struct ModuleInfo {
+    public String moduleName;
+    public ModuleMethodDelegate moduleMethod;
+    public bool init;
+  } // ModuleInfo
+
+  private const int MAXMODULES = 20;
+  private static ModuleInfo[] mil = new ModuleInfo[MAXMODULES];
+  private static int modCnt;
+
+  public static void InstallModule(String moduleName, ModuleMethodDelegate moduleMethod) {
+    //-----------------------------------|----------------------------------------
+    if (moduleName == MODULENAME) {
+      modCnt = 0;
+      for (int i = 0; i < MAXMODULES; i++) {
+        mil[i].moduleName = "";
+        mil[i].moduleMethod = null;
+        mil[i].init = false;
+      } // for
+    } // if
+    if (modCnt == MAXMODULES)
+      FatalError(MODULENAME, "InstallModule", "too many modules");
+    String mn;
+    moduleMethod(ModuleAction.getModuleName, out mn);
+    if (moduleName != mn)
+      FatalError(MODULENAME, "InstallModule",
+                 "incorrect module name \"{0}\"", moduleName);
+    mil[modCnt].moduleName = moduleName;
+    mil[modCnt].moduleMethod = moduleMethod;
+    mil[modCnt].init = false;
+    modCnt++;
+  } // InstallModule
+
+  private static bool withinCleanUp = false;
+
+  public static void Modules(ModuleAction action) {
+    //-----------------------------------|----------------------------------------
+    String dummy;
+    switch (action) {
+      case ModuleAction.initModule:
+        for (int i = 0; i < modCnt; i++) {
+          if (!mil[i].init) {
+            mil[i].moduleMethod(ModuleAction.initModule, out dummy);
+            mil[i].init = true;
+          } else
+            FatalError(MODULENAME, "Modules",
+                       "{0} reinitialized", mil[i].moduleName);
+        } // for
+        break;
+      case ModuleAction.resetModule:
+      case ModuleAction.cleanupModule:
+        if (!withinCleanUp) {
+          withinCleanUp = true;
+          for (int i = modCnt - 1; i >= 0; i--)
+            if (mil[i].init) {
+              mil[i].moduleMethod(action, out dummy);
+              mil[i].init = action != ModuleAction.cleanupModule;
+            } else
+              FatalError(MODULENAME, "Modules",
+                         "{0} not initialized", mil[i].moduleName);
+          withinCleanUp = false;
+        } // if
+        break;
+      default:
+        FatalError(MODULENAME, "Modules",
+                   "invalid ModuleAction {0}", action.ToString());
+        break;
+    } // switch
+  } // Modules
+
+
+  // --- misc. utilities ---
+
+  public static void FatalError(String moduleName, String methodName,
+                                String fmt, params Object[] p) {
+    //-----------------------------------|----------------------------------------
+    Console.WriteLine();
+    Console.WriteLine("*** FATAL ERROR in module {0}, method {1}",
+            moduleName, methodName);
+    Console.WriteLine("*** " + fmt, p);
+    Modules(ModuleAction.cleanupModule);
+    Environment.Exit(EXIT_FAILURE);
+  } // FatalError
+
+  public static void GetInputFileName(String prompt, out String fileName) {
+    //-----------------------------------|----------------------------------------
+    Console.WriteLine();
+    Console.Write("{0}", prompt);
+    fileName = Console.ReadLine();
+  } // GetInputFileName
+
+
+  // --- timer utilities ---
+
+  private static bool timerRuns = false;
+  private static DateTime startedAt, stoppedAt;
+
+  public static void StartTimer() {
+    //-----------------------------------|----------------------------------------
+    if (timerRuns)
+      FatalError(MODULENAME, "StartTimer", "timer still running");
+    timerRuns = true;
+    startedAt = DateTime.Now;
+  } // StartTimer
+
+  public static void StopTimer() {
+    //-----------------------------------|----------------------------------------
+    if (!timerRuns)
+      FatalError(MODULENAME, "StopTimer", "timer not running");
+    stoppedAt = DateTime.Now;
+    timerRuns = false;
+  } // StopTimer
+
+  public static TimeSpan ElapsedTime() {
+    //-----------------------------------|----------------------------------------
+    TimeSpan elapsed = stoppedAt - startedAt;
+    return elapsed;
+  } // ElapsedTime
+
+
+  // --- Min/Max methods ---
+
+  public static T Min<T>(T a, T b) where T : IComparable {
+    //-----------------------------------|----------------------------------------
+    return a.CompareTo(b) < 0 ? a : b;
+  } // Min
+
+  public static T Max<T>(T a, T b) where T : IComparable {
+    //-----------------------------------|----------------------------------------
+    return a.CompareTo(b) > 0 ? a : b;
+  } // Max
+
+
+  // --- shift methods ---
+
+  public static int BSL(int x, int i) {
+    //-----------------------------------|----------------------------------------
+    return x << i;
+  } // BSL
+
+  public static int BSR(int x, int i) {
+    //-----------------------------------|----------------------------------------
+    return x >> i;
+  } // BSR
+
+
+  // --- bit manipulation methods ---
+
+  public static ushort Bit(ushort i) {
+    //-----------------------------------|----------------------------------------
+    return (ushort)(1 << i);
+  } // Bit
+
+  public static void SetBit(ref ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    x |= Bit(i);
+  } // SetBit
+
+  public static void ClrBit(ref ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    x &= (ushort)(~Bit(i));
+  } // ClrBit
+
+  public static bool TestBit(ushort x, ushort i) {
+    //-----------------------------------|----------------------------------------
+    return (x & Bit(i)) != 0;
+  } // TestBit
+
+  public static int Strquotechar(ref string s, char ch) {
+    // -------------------------------------|--------------------------------------
+    switch (ch) {
+      case EF:
+        s = "EF";
+        break;
+      case LF:
+        s = "LF";
+        break;
+      case HT:
+        s = "HT";
+        break;
+      case VT:
+        s = "VT";
+        break;
+      case BS:
+        s = "BS";
+        break;
+      case CR:
+        s = "CR";
+        break;
+      case FF:
+        s = "FF";
+        break;
+      case BEL:
+        s = "BEL";
+        break;
+      case '\\':
+      case '\'':
+      case '\"':
+        s = "\'\\" + (char)ch + "\'";
+        break;
+      default:
+        if (!Char.IsControl(ch))
+          s = "\'" + (char)ch + "\'";
+        else
+          s = "\'\\" + (char)ch + "\'";
+        break;
+    }
+    return s.Length;
+  } // Strquotechar
+
+  public static int Strquotestr(ref string s, string t) {
+    // -------------------------------------|--------------------------------------
+    char ch = ' ';
+    string s1;
+    int i = 0;
+
+    s1 = s;
+    s += '"';
+    while (i < t.Length) {
+      ch = t[i];
+      i++;
+      switch (ch) {
+        case LF:
+          s += '\\';
+          s += 'n';
+          break;
+        case HT:
+          s += '\\';
+          s += 't';
+          break;
+        case VT:
+          s += '\\';
+          s += 'v';
+          break;
+        case BS:
+          s += '\\';
+          s += 'b';
+          break;
+        case CR:
+          s += '\\';
+          s += 'r';
+          break;
+        case FF:
+          s += '\\';
+          s += 'f';
+          break;
+        case BEL:
+          s += '\\';
+          s += 'a';
+          break;
+        case '\\':
+        case '\'':
+        case '"':
+          s += '\\';
+          s += ch;
+          break;
+        default:
+          if (!Char.IsControl(ch))
+            s += ch;
+          else {
+            s = "\\" + (char)ch;
+            s += s.Length.ToString();
+          }
+          break;
+      }
+    }
+    s += '"';
+    return s1.Length;
+  } // Strquotestr
+
+#if TEST_UTILS
+
+  public static void Main(String[] args) {
+    Console.WriteLine("START: Utils");
+
+    Console.WriteLine("installing ...");
+    InstallModule("Utils", new ModuleMethodDelegate(UtilsMethod));
+    Console.WriteLine("initModule ...");
+    Modules(ModuleAction.initModule);
+
+    // FatalError(MODULENAME, "Main", 
+    //            "any {0} error {1}", "additional", "messages");
+
+    Console.WriteLine("StartTimer ...");
+    StartTimer();
+    String fn;
+    GetInputFileName("input file name > ", out fn);
+    Console.WriteLine("input file name = " + fn);
+    Console.WriteLine("StopTimer ...");
+    StopTimer();
+    Console.WriteLine(ElapsedTime());
+
+    Console.WriteLine("Min(17, 4) = " + Min(17, 4));
+    Console.WriteLine("Max(17, 4) = " + Max(17, 4));
+
+    Console.WriteLine();
+    Console.WriteLine("BSL(1, 2) = " + BSL(1, 2));
+    Console.WriteLine("BSR(4, 2) = " + BSR(4, 2));
+    Console.WriteLine("Bit(4)    = " + Bit(4));
+    ushort x = 1;
+    Console.WriteLine("x = " + x);
+    SetBit (ref x, 2);
+    Console.WriteLine("after SetBit (x, 2), x = " + x);
+    Console.WriteLine("TestBit(x, 2) = " + TestBit(x, 2));
+    ClrBit (ref x, 2);
+    Console.WriteLine("after ClrBit (x, 2), x = " + x);
+    Console.WriteLine("TestBit(x, 2) = " + TestBit(x, 2));
+
+
+    Console.WriteLine("resetModule ...");
+    Modules(ModuleAction.resetModule);
+
+    Console.WriteLine("cleanupModule ...");
+    Modules(ModuleAction.cleanupModule);
+
+    Console.WriteLine("END");
+    // Console.WriteLine("type [CR] to continue ...");
+    // Console.ReadLine();
+  } // Main
+
+#endif
+
+} // Utils
+
+// End of Utils.cs
+//=====================================|========================================
+
+
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDef.atg
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDef.atg	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDef.atg	(revision 9430)
@@ -0,0 +1,109 @@
+COMPILER GPDefSyntaxAnalyzer
+
+CHARACTER SETS
+  letter = 'A'..'Z' + 'a'..'z'.
+  digit = '0'..'9'.
+  whiteSpace = CHR(9) + EOL IGNORE. /* ' ' ignored by default */ 
+  
+COMMENTS
+  FROM '/*' TO '*/' NESTED.
+
+KEYWORDS
+  'PROBLEM'. 'END'. 'EPS'.
+  'LOCAL'. 'NONTERMINALS'. 'RULES'.
+  'SEM'. 'MAXIMIZE'. 'MINIMIZE'. 'TERMINALS'. 'CONSTRAINTS'. 'INIT'. 'CODE'. 
+  'IN'. 'SET'. 'RANGE'. 
+  
+TOKENS
+  '='. '|'. '.'. '('. ')'. '['. ']'. '{'. '}'. '>>'. '..'.
+  
+TOKEN CLASSES
+  ident = letter {letter | digit}.
+  
+PRAGMAS
+  source       = '<<' SEM <<for (; ; ) {
+                              switch (GPDefSyntaxAnalyzerLex.curCh) {
+                                case Utils.EF:
+                                  Errors.SemError(GPDefSyntaxAnalyzerLex.curLine, GPDefSyntaxAnalyzerLex.curCol, "end of file in source text");
+                                  return;
+                                case '<':
+                                  GPDefSyntaxAnalyzerLex.NextCh();
+                                  if (GPDefSyntaxAnalyzerLex.curCh == '<') {
+                                    Errors.Warning(GPDefSyntaxAnalyzerLex.curLine, GPDefSyntaxAnalyzerLex.curCol, "non closed source text before?");
+                                    GPDefSyntaxAnalyzerLex.NextCh();
+                                  }
+                                  break;
+                                case '>':
+                                  GPDefSyntaxAnalyzerLex.NextCh();
+                                  if (GPDefSyntaxAnalyzerLex.curCh == '>') {
+                                    GPDefSyntaxAnalyzerLex.curCh = ' ';          // force GPDefSyntaxAnalyzerLex to get next character 
+                                    return;
+                                  }
+                                  break;
+                                default:
+                                  GPDefSyntaxAnalyzerLex.NextCh();
+                                  break;
+                              }
+                            }>>
+  .  
+NONTERMINALS
+  GPDefSyntaxAnalyzer.   
+  SemDecl. SemAction. NonterminalDecl.
+  RuleDef. SynExpr. SynTerm. SynFact. TerminalDecl. 
+  ConstraintDef. ConstraintRule. SetDefinition.
+  
+RULES
+  GPDefSyntaxAnalyzer = 
+    'PROBLEM' ident 
+	['CODE' /* SourceText */]
+	['INIT' /* SourceText */]
+    'NONTERMINALS' { NonterminalDecl }
+    'TERMINALS' { TerminalDecl }
+    'RULES' { RuleDef } 
+    ('MAXIMIZE' | 'MINIMIZE') /* SourceText */ 
+    'END' ident '.'.
+  
+  
+  SemDecl = 'LOCAL' /* SourceText */                                               
+  .
+  
+  SemAction = 'SEM' /* SourceText */                                               
+  .
+  
+  NonterminalDecl = ident /* FormalAttrList */ '.'                                 
+                                                                                   
+																				
+                                                                                   
+  .
+  
+  TerminalDecl = ident /* FormalAttrList */   
+    [ 'CONSTRAINTS' ConstraintDef ]
+    '.'     
+  .
+  
+  ConstraintDef = { ConstraintRule }.
+  ConstraintRule = ident 'IN' SetDefinition .
+  SetDefinition = 
+    'SET' /* SourceText */
+	| 'RANGE' /* SourceText */ '..' /* SourceText */
+  .
+  
+  RuleDef = ident /* FormalAttrList */ '=' [SemDecl] SynExpr '.'                   
+  .
+  
+  SynExpr = SynTerm {'|' SynTerm}                                                 
+  .
+  
+  SynTerm = SynFact {SynFact}                                                     
+  .
+  
+  SynFact = 
+    ident /* ActualAttrList */                                                     
+    | 'EPS'                                                                        
+    | '(' SynExpr ')'                                                              
+    | '[' SynExpr ']'                                                              
+    | '{' SynExpr '}'                                                              
+    | SemAction                                                                       
+  .
+
+END GPDefSyntaxAnalyzer.
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzer.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzer.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzer.cs	(revision 9430)
@@ -0,0 +1,159 @@
+// ATTENTION: Replace all occurences of GPDefSyntaxAnalyzer by the compiler name! 
+
+// GPDefSyntaxAnalyzer.cs                                                        HDO, 2006-08-28
+// -----
+// Main program for compiler generated from GPDefSyntaxAnalyzer.atg with Coco-2.
+//=====================================|========================================
+
+using System;
+using System.IO;
+
+using Lex = GPDefSyntaxAnalyzerLex;
+using Syn = GPDefSyntaxAnalyzerSyn;
+
+public class GPDefSyntaxAnalyzer {
+
+  private static String NAME = "GPDefSyntaxAnalyzer";
+  private static bool interactiveMode;
+
+  private static void Abort(String abortKind, String moduleName,
+                            String methName,  String descr) {
+    Console.WriteLine();
+    Console.WriteLine("*** {0} in class {1} method {2}", 
+                      abortKind, moduleName, methName);
+    Console.WriteLine("*** {0}", descr);
+    Console.WriteLine();
+    Console.WriteLine();
+    Console.WriteLine(NAME + " aborted");
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    if (interactiveMode) {
+      Console.Write("type [CR] to quit");
+      string dummy = Console.ReadLine();
+    } // if
+    Environment.Exit(Utils.EXIT_FAILURE);
+  } // Abort
+
+  private static int CompileFile(String srcFileName) {
+    FileStream srcFs = null;
+    try {
+      srcFs = new FileStream(srcFileName, FileMode.Open);
+    } catch (Exception) {
+      Console.WriteLine("*** file \"{0}\" not found", srcFileName);
+      return Utils.EXIT_FAILURE;
+    } // try/catch
+    try {
+      Lex.src = new StreamReader(srcFs);
+      Console.WriteLine("parsing ...");
+      Syn.Parse();
+      Lex.src.Close();
+      Lex.src.Dispose();
+      Lex.src = null;
+      if (Errors.NumOfErrors() > 0) {
+        Console.WriteLine("listing ...");
+        String lstFileName = Path.ChangeExtension(srcFileName, ".lst");
+        FileStream lstFs = null;
+        try {
+          lstFs = new FileStream(lstFileName, FileMode.Create);
+        } catch (Exception) {
+          Utils.FatalError(NAME, "CompileFile", "file \"{0}\" not created", lstFileName);
+          return Utils.EXIT_FAILURE;
+        } // try/catch
+        StreamWriter lstWriter = null;
+        try {
+          lstWriter = new StreamWriter(lstFs);
+          StreamReader srcFsReader = null;
+          try { // open the source file a second time to generate the error listing
+            srcFsReader = new StreamReader(new FileStream(srcFileName, FileMode.Open));
+            lstWriter.WriteLine(NAME + " (file: \"{0}\")", srcFileName);
+            Errors.GenerateListing(srcFsReader, lstWriter, Errors.ListingShape.longListing);
+          } finally {
+            srcFsReader.Close();
+            srcFsReader.Dispose();
+          } // try/finally
+          Console.WriteLine("{0} error(s) detected", Errors.NumOfErrors());
+        } finally {
+          lstWriter.Close();
+          lstWriter.Dispose();
+        } // try/finally
+      } else 
+        Console.WriteLine("no errors detected");
+    } finally {
+      if (Lex.src != null) {
+        Lex.src.Close();
+        Lex.src.Dispose();
+        Lex.src = null;
+      } // if
+      Utils.Modules(Utils.ModuleAction.resetModule);
+    } // try/finally to make sure srcFs and srcReader are closed
+    return Utils.EXIT_SUCCESS;
+  } // CompileFile
+
+
+  public static void Main(String[] args) {
+  //-----------------------------------|----------------------------------------
+    int result = 0;
+
+    // --- install modules ---
+    Utils.InstallModule("Utils",   new Utils.ModuleMethodDelegate(Utils.UtilsMethod ));
+    Utils.InstallModule("Sets",    new Utils.ModuleMethodDelegate(Sets.SetsMethod  ));
+    Utils.InstallModule("Errors",  new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));
+
+    Utils.InstallModule("GPDefSyntaxAnalyzerLex",  new Utils.ModuleMethodDelegate(GPDefSyntaxAnalyzerLex.GPDefSyntaxAnalyzerLexMethod));
+    Utils.InstallModule("GPDefSyntaxAnalyzerSem",  new Utils.ModuleMethodDelegate(GPDefSyntaxAnalyzerSem.GPDefSyntaxAnalyzerSemMethod));
+    Utils.InstallModule("GPDefSyntaxAnalyzerSyn",  new Utils.ModuleMethodDelegate(GPDefSyntaxAnalyzerSyn.GPDefSyntaxAnalyzerSynMethod));
+
+    // --- initialize modules ---
+    Utils.Modules(Utils.ModuleAction.initModule);
+
+    Errors.PushAbortMethod(new Errors.AbortMethod(Abort));
+
+    Console.WriteLine("---------------------------");
+    Console.WriteLine(" {0} Compiler {1," + (5 - NAME.Length) +"} Version X  ", NAME, "");
+    Console.WriteLine(" Frontend gen. with Coco-2");
+    Console.WriteLine("---------------------------");
+    Console.WriteLine();
+
+    if (args.Length > 0) { // command line mode
+      interactiveMode = false;
+      Console.WriteLine();
+      int i = 0;
+      do {
+        Console.WriteLine("source file \"{0}\"", args[i]);
+        result = CompileFile(args[i]);
+        if (result != Utils.EXIT_SUCCESS)
+          Environment.Exit(result);
+        Console.WriteLine();
+        i++;
+      } while (i < args.Length);
+    } else { // args.Length == 0, interactive mode
+      interactiveMode = true;
+      for (;;) {
+        String srcFileName;
+        Utils.GetInputFileName("source file > ", out srcFileName);
+        if (srcFileName.Length > 0) {
+          result = CompileFile(srcFileName);
+          if (result != Utils.EXIT_SUCCESS)
+            Environment.Exit(result);
+        } // if
+        char answerCh;
+        do {
+          Console.WriteLine();
+          Console.Write("[c]ontinue or [q]uit > ");
+          answerCh = Char.ToUpper(Console.ReadKey().KeyChar);
+        } while (answerCh != 'C' && answerCh != 'Q');
+        if (answerCh == 'Q')
+          break;
+        else // answerCh == 'C'
+          Console.WriteLine();
+      } // for
+    } // else
+
+    Utils.Modules(Utils.ModuleAction.cleanupModule);
+    Environment.Exit(Utils.EXIT_SUCCESS);
+
+  } // Main
+
+} // GPDefSyntaxAnalyzer
+
+// End of GPDefSyntaxAnalyzer.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerLex.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerLex.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerLex.cs	(revision 9430)
@@ -0,0 +1,435 @@
+// GPDefSyntaxAnalyzerLex.cs                                              HDO, 2006-08-28
+// -------------
+// Lexical analyzer (finite-state machine interpreter).
+// Generated by Coco-2 (SG).
+//=====================================|========================================
+
+#undef TEST_Lex
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Text;
+
+public class GPDefSyntaxAnalyzerLex {
+
+  public const String MODULENAME = "GPDefSyntaxAnalyzerLex";
+  public const int    EOFSPIX    = 1;
+
+  public static TextReader src;
+
+  // --- token information ---
+  public static int    token;               // current token
+  public static int    tokenLine, tokenCol; // position of current token
+  public static String tokenStr;            // token string recognized
+
+  // --- current char. info, for "power users" only ---
+  public static char   curCh;               // current input character
+  public static int    curLine, curCol;     // position of curCh
+
+
+  public static void GPDefSyntaxAnalyzerLexMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        caseSensitive = true;
+        lt            = new LexicalTable();
+        tokenStrArr   = new char[256];
+        kwHt          = CreateHashtable();
+        nHt           = CreateHashtable();
+        nl            = new ArrayList();
+        break;
+      case Utils.ModuleAction.resetModule:
+        kwHt.Clear();
+        nHt.Clear();
+        nl.Clear();
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        lt            = null;
+        tokenStrArr   = null;
+        kwHt          = null;
+        nHt           = null;
+        nl            = null;
+        break;
+    } // switch
+  } // GPDefSyntaxAnalyzerLexMethod
+
+  private static  Hashtable CreateHashtable() {
+    if (caseSensitive)
+      return new Hashtable();
+    else
+      return CollectionsUtil.CreateCaseInsensitiveHashtable();
+  } // CreateHashtable
+
+
+  public static void InitLex() {
+  //-----------------------------------|----------------------------------------
+    // --- initialize keyword hash table  ---
+    kwHt.Clear();
+    EnterKeyword(  1, "PROBLEM");
+    EnterKeyword(  2, "END");
+    EnterKeyword(  3, "EPS");
+    EnterKeyword(  4, "LOCAL");
+    EnterKeyword(  5, "NONTERMINALS");
+    EnterKeyword(  6, "RULES");
+    EnterKeyword(  7, "SEM");
+    EnterKeyword(  8, "MAXIMIZE");
+    EnterKeyword(  9, "MINIMIZE");
+    EnterKeyword( 10, "TERMINALS");
+    EnterKeyword( 11, "CONSTRAINTS");
+    EnterKeyword( 12, "INIT");
+    EnterKeyword( 13, "CODE");
+    EnterKeyword( 14, "IN");
+    EnterKeyword( 15, "SET");
+    EnterKeyword( 16, "RANGE");
+    // --- initialize name data structures  ---
+    nHt.Clear();
+    nl.Clear();
+    nl.Add("");      // so spix = 0 is the empty string
+    nl.Add("!EOF!"); // so EOFSPIX = 1
+    // --- (re)set global data ---
+    curLineStr  = "";
+    curCh       = ' ';
+    curLine     = 0;
+    curCol      = 2;
+    tokenStr    = null;
+    token       = 0;
+    tokenCol    = 0;
+    tokenLine   = 0;
+    tokenStrLen = 0;
+    pendingEOLs = 0;
+    apxLen      = pendingEOLs; // to prevent warning
+  } // InitLex
+
+  private static void EnterKeyword(int token, String keyword) {
+    kwHt.Add(keyword, token);
+  } // EnterKeyword
+
+
+  // *** start of global LEX declarations from ATG ***
+  
+  // *** end of global LEX declarations from ATG ***
+
+
+  public static bool caseSensitive;
+
+  private class LexicalTable {
+    public int   header = 4;
+    public int[] startTab = {
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  4,  5,  0,  0,  0,  0, 17,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 14,  2, 10,  0,
+          0, 16, 16, 16, 16, 16, 13, 16, 13, 16, 13, 13, 16, 16, 16, 16,
+         16, 13, 16, 16, 16, 16, 13, 13, 16, 13, 16,  6,  0,  7,  0,  0,
+          0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+         13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  8,  3,  9,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
+      };
+    public Sets.Set256 ignoredChars = new Sets.Set256(
+         0x0600, 0x0000, 0x0001
+      );
+    public Sets.Set256 commentStart = new Sets.Set256(
+         0x0000, 0x0000, 0x8000
+      );
+    public Sets.Set256[] cls = {
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0xfffe, 0x07ff, 0xfffe, 0x07ff),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x03ff),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0xf2be, 0x053d),
+        new Sets.Set256( 0x0000, 0x0000, 0x0000, 0x0000, 0x0d40, 0x02c2, 0xfffe, 0x07ff)
+      };
+  } // LexicalTable
+
+  private static LexicalTable lt;
+  private static Hashtable    kwHt;  // hash table for keywords: string -> token 
+  private static Hashtable    nHt;   // hash table for names: string -> null 
+  private static ArrayList    nl;    // name list  for names, index is spix
+
+  private static String curLineStr;  // current source line
+  private static char[] tokenStrArr; // token string in an array
+  private static int    tokenStrLen; // length of token string in tokenStrArr
+  private static int    state;       // current automaton state
+  private static int    apxLen;      // length of appendix in token string
+  private static int    pendingEOLs; // nr of EOLs found in comment
+
+  // --- to save and restore scanner state ---
+  private static char   savedCh;
+  private static int    savedCol, savedLine;
+
+  private static void SaveScannerState() {
+    savedCh      = curCh;
+    savedCol     = curCol;
+    savedLine    = curLine;
+  } // SaveScannerState
+
+  private static void RestoreScannerState() {
+    tokenStrLen -= apxLen;
+    apxLen       = 0;
+    curCh        = savedCh;
+    curCol       = savedCol;
+    curLine      = savedLine;
+  } // RestoreScannerState
+
+
+  public static void NextCh() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      
+      if (curCol < curLineStr.Length) {         // within line
+        curCol++;
+        curCh = curLineStr[curCol - 1];
+        return;
+      } else if (curCol == curLineStr.Length) { // end of line
+        curCol++;
+        curCh = Utils.LF; // to separate lines
+        return;
+      } else { // curCol > curLineStr.Length
+        curLineStr = src.ReadLine();
+        curLine++;
+        curCol = 0;
+        if (curLineStr == null) {               // end of file
+          curLineStr = "";
+          curCh = Utils.EF;
+          return;
+        } // if
+      } // else
+    } // for
+  } // NextCh
+
+
+  private static void CommentErr() {
+    Errors.LexError(curLine, curCol, "end of file in comment");
+  } // CommentErr
+
+  private static bool Comment() {
+    
+    int level = 1;
+    
+    SaveScannerState();
+    // --- from '/' '*' to '*' '/' nested ---
+    NextCh();
+    if (curCh == '*') {
+      NextCh();
+      for (;;)
+        switch (curCh) {
+          case '*':
+            NextCh();
+            if (curCh == '/') {
+              NextCh();
+              level--;
+              if (level == 0) {
+                return true;
+              } // if
+            } // if
+            break;
+          case '/':
+            NextCh();
+            if (curCh == '*') {
+              level++;
+              NextCh();
+            }
+            break;
+          case Utils.EF:
+            CommentErr();
+            return true;
+          default:
+            NextCh();
+            break;
+        } // switch
+    } else
+      RestoreScannerState();
+    return false;
+  } // Comment
+
+  private static void HandleLexErr() {
+    Errors.LexError(curLine, curCol, 
+                    "invalid character '{0}' (hex {1:X})", curCh, (int)curCh);
+    if (apxLen > 0)
+      RestoreScannerState();
+  } // HandleLexErr
+
+
+  public static void GetToken() {
+  //-----------------------------------|----------------------------------------
+    token = -1;
+    tokenStr = null;
+    do {
+      // --- skip ignored chars and comments ---
+      for (;;) {
+        while (Sets.member(curCh, lt.ignoredChars))
+          NextCh();
+        if (!Sets.member(curCh, lt.commentStart))
+          break;
+        if (!Comment())
+          break;
+      } // for
+      // --- scan for next token ---
+      tokenLine   = curLine;
+      tokenCol    = curCol;
+      tokenStrLen = 0;
+      apxLen      = 0;
+      state = (curCh == Utils.EF) ? 1 : lt.startTab[curCh];
+      for (;;) {
+        tokenStrArr[tokenStrLen++]= curCh;
+        NextCh();
+        switch (state) {
+          case 0:
+            Errors.LexError(tokenLine, tokenCol, "invalid token start");
+            break;
+          case 1:
+            token = 0;
+            tokenStrLen = 0;
+            break;                      // EOF recognized
+          case 2:
+            token = 17;
+            break;                      // '=' recognized
+          case 3:
+            token = 18;
+            break;                      // '|' recognized
+          case 4:
+            token = 20;
+            break;                      // '(' recognized
+          case 5:
+            token = 21;
+            break;                      // ')' recognized
+          case 6:
+            token = 22;
+            break;                      // '[' recognized
+          case 7:
+            token = 23;
+            break;                      // ']' recognized
+          case 8:
+            token = 24;
+            break;                      // '{' recognized
+          case 9:
+            token = 25;
+            break;                      // '}' recognized
+          case 10:
+            if (curCh == '>') {
+              state = 11;
+              continue;
+            } // if
+            else {
+              HandleLexErr();
+              break;
+            } // else
+          case 11:
+            token = 26;
+            break;                      // '>>' recognized
+          case 12:
+            token = 27;
+            break;                      // '..' recognized
+          case 13:
+            if (Sets.member(curCh, lt.cls[0])) {
+              state = 13;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[1])) {
+              state = 13;
+              continue;
+            } // if
+            else {
+              token = KeywordCheck();
+              if (token >= 0)
+                break;                  // keyword recognized
+              token = 28;
+              break;                    // ident recognized
+            } // else
+          case 14:
+            if (curCh == '<') {
+              state = 15;
+              continue;
+            } // if
+            else {
+              HandleLexErr();
+              break;
+            } // else
+          case 15:
+            token = 29;
+            break;                      // source recognized
+          case 16:
+            if (Sets.member(curCh, lt.cls[1])) {
+              state = 13;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[2])) {
+              state = 16;
+              continue;
+            } // if
+            else if (Sets.member(curCh, lt.cls[3])) {
+              state = 13;
+              continue;
+            } // if
+            else {
+              token = KeywordCheck();
+              if (token >= 0)
+                break;                  // keyword recognized
+              token = 28;
+              break;                    // ident recognized
+            } // else
+          case 17:
+            if (curCh == '.') {
+              state = 12;
+              continue;
+            } // if
+            else {
+              token = 19;
+              break;                    // '.' recognized
+            } // else
+        } // switch
+        break;
+      } // for
+    } while (token < 0);
+    if (tokenStr == null)
+      tokenStr = new String(tokenStrArr, 0, tokenStrLen);
+  } // GetToken
+
+  private static int KeywordCheck() {
+    tokenStr = new String(tokenStrArr, 0, tokenStrLen - apxLen);
+    Object token = kwHt[tokenStr];
+    return (token == null) ? -1 : (int)token;
+  } // KeywordCheck
+
+
+  public static int Hash(String s) {
+  //-----------------------------------|----------------------------------------
+    Object spix = nHt[s];
+    if (spix == null) {
+      if (caseSensitive)
+        nl.Add(s);
+      else
+        nl.Add(s.ToUpper());
+      spix   = nl.Count - 1;
+      nHt[s] = spix;
+    } // if
+    return (int)spix;
+  } // Hash
+  
+  
+  public static String HashedStr(int spix) {
+  //-----------------------------------|----------------------------------------
+    return (String)nl[spix];
+  } // HashedStr
+
+
+  public static void GETidentAttr()  {
+  } // GETidentAttr
+  
+  public static void GETsourceAttr()  {
+  } // GETsourceAttr
+
+} // GPDefSyntaxAnalyzerLex
+
+// End of GPDefSyntaxAnalyzerLex.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSem.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSem.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSem.cs	(revision 9430)
@@ -0,0 +1,272 @@
+// GPDefSyntaxAnalyzerSem.cs                                              HDO, 2006-08-28
+// -------------
+// Semantic evaluator for table-driven top-down parsing.
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+
+using Lex = GPDefSyntaxAnalyzerLex;
+using Syn = GPDefSyntaxAnalyzerSyn;
+
+public class GPDefSyntaxAnalyzerSem {
+
+
+  public const String MODULENAME = "GPDefSyntaxAnalyzerSem";
+
+  public static void GPDefSyntaxAnalyzerSemMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        return;
+    } // switch
+  } // GPDefSyntaxAnalyzerSemMethod
+
+
+  // *** start of global SYN and SEM declarations from ATG ***
+  
+
+  // *** end of global SYN and SEM declarations from ATG ***
+
+  
+  private static void P_source() {
+    Lex.GETsourceAttr();
+    for (; ; ) {
+      switch (GPDefSyntaxAnalyzerLex.curCh) {
+        case Utils.EF:
+          Errors.SemError(GPDefSyntaxAnalyzerLex.curLine, GPDefSyntaxAnalyzerLex.curCol, "end of file in source text");
+          return;
+        case '<':
+          GPDefSyntaxAnalyzerLex.NextCh();
+          if (GPDefSyntaxAnalyzerLex.curCh == '<') {
+            Errors.Warning(GPDefSyntaxAnalyzerLex.curLine, GPDefSyntaxAnalyzerLex.curCol, "non closed source text before?");
+            GPDefSyntaxAnalyzerLex.NextCh();
+          }
+          break;
+        case '>':
+          GPDefSyntaxAnalyzerLex.NextCh();
+          if (GPDefSyntaxAnalyzerLex.curCh == '>') {
+            GPDefSyntaxAnalyzerLex.curCh = ' ';          // force GPDefSyntaxAnalyzerLex to get next character
+            return;
+          }
+          break;
+        default:
+          GPDefSyntaxAnalyzerLex.NextCh();
+          break;
+      }
+    }
+  } // P_source
+
+
+  private static void NT_GPDefSyntaxAnalyzer() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+        case 2:
+          NT_NonterminalDecl();
+          break;
+        case 3:
+          NT_TerminalDecl();
+          break;
+        case 4:
+          NT_RuleDef();
+          break;
+        case 5:
+          Lex.GETidentAttr();
+          break;
+      } // switch
+    } // for
+  } // NT_GPDefSyntaxAnalyzer
+
+  private static void NT_SemDecl() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+      } // switch
+    } // for
+  } // NT_SemDecl
+
+  private static void NT_SemAction() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+      } // switch
+    } // for
+  } // NT_SemAction
+
+  private static void NT_NonterminalDecl() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+      } // switch
+    } // for
+  } // NT_NonterminalDecl
+
+  private static void NT_TerminalDecl() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+        case 2:
+          NT_ConstraintDef();
+          break;
+      } // switch
+    } // for
+  } // NT_TerminalDecl
+
+  private static void NT_ConstraintDef() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_ConstraintRule();
+          break;
+      } // switch
+    } // for
+  } // NT_ConstraintDef
+
+  private static void NT_ConstraintRule() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+        case 2:
+          NT_SetDefinition();
+          break;
+      } // switch
+    } // for
+  } // NT_ConstraintRule
+
+  private static void NT_SetDefinition() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+      } // switch
+    } // for
+  } // NT_SetDefinition
+
+  private static void NT_RuleDef() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+        case 2:
+          NT_SemDecl();
+          break;
+        case 3:
+          NT_SynExpr();
+          break;
+      } // switch
+    } // for
+  } // NT_RuleDef
+
+  private static void NT_SynExpr() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_SynTerm();
+          break;
+        case 2:
+          NT_SynTerm();
+          break;
+      } // switch
+    } // for
+  } // NT_SynExpr
+
+  private static void NT_SynTerm() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_SynFact();
+          break;
+        case 2:
+          NT_SynFact();
+          break;
+      } // switch
+    } // for
+  } // NT_SynTerm
+
+  private static void NT_SynFact() {
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          Lex.GETidentAttr();
+          break;
+        case 2:
+          NT_SynExpr();
+          break;
+        case 3:
+          NT_SynExpr();
+          break;
+        case 4:
+          NT_SynExpr();
+          break;
+        case 5:
+          NT_SemAction();
+          break;
+      } // switch
+    } // for
+  } // NT_SynFact
+
+
+  public delegate void PragmaMethod();
+  public static PragmaMethod[] pragmaMethods = {
+      new PragmaMethod(P_source)
+    };
+
+
+  public static void StartSem() {
+  //-----------------------------------|----------------------------------------
+    for (;;) {
+      switch (Syn.Interpret()) {
+        case 0:
+          return;
+        case 1:
+          NT_GPDefSyntaxAnalyzer();
+          break;
+      } // switch
+    } // for
+  } // StartSem
+
+    
+} // GPDefSyntaxAnalyzerSem
+
+// End of GPDefSyntaxAnalyzerSem.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSyn.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSyn.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/GPDefSyntaxAnalyzerSyn.cs	(revision 9430)
@@ -0,0 +1,557 @@
+// GPDefSyntaxAnalyzerSyn.cs                                              HDO, 2006-08-28
+// -------------
+// Table-driven top-down syntax analyzer (G-code interpreter).
+// Generated by Coco-2 (PGT).
+//=====================================|========================================
+
+// --- call pragma mehts. and exec. sem. acts. after syntax errors? ---
+#define CONTPRAGMAACTS            // !!!must be defined for SG and PGT!!! 
+#undef  CONTSEMACTS               // should not be defined 
+
+using System;
+using System.Text;
+
+using Lex = GPDefSyntaxAnalyzerLex;
+using Sem = GPDefSyntaxAnalyzerSem;
+
+public class GPDefSyntaxAnalyzerSyn {
+                   
+  public static String MODULENAME = "GPDefSyntaxAnalyzerSyn";
+
+  // --- G-code instructions ---
+  public enum Instruction {
+    T, TA, TC, TCA, NT, NTA, ANY, ANYA, EPS, EPSA, JMP, RET
+  } // Instruction
+
+  private const int ROOTPC     =  207;
+  private const int LASTTERM   =   28;
+  private const int LASTPRAGMA =   29;
+
+
+  // --- other constants ---
+  private const int MINERRDIST   =   3;
+  private const int MAXSTACKLEN  = 100;
+  private const int EOFTOK       =   0;
+  private const int FIRSTNONTERM = LASTPRAGMA + 1;
+
+  public class NTData {
+    public int          startPC;
+    public bool         del;
+    public Sets.Set256  firstSet;
+    public NTData(int startPC, bool del, Sets.Set256 firstSet) {
+      this.startPC  = startPC;
+      this.del      = del;
+      this.firstSet = firstSet;
+    } // NTData
+  } // NTData
+  
+  private class GrammarTable {
+    public int[]  header = {
+      212, 28, 29, 41, 3, 0
+    };
+    public byte[] code = {
+         0,   1,   2,  28,   1,   1,  13,  10,   0,   1,  12,  14,   0,   0,
+         5,   5,   3,  24,   0,   2,  10,  16,   0,   0,  10,   5,   8,  34,
+         0,   3,  10,  26,   0,   0,   6,   5,   4,  44,   0,   4,  10,  36,
+         0,   1,   8,  56,   0,   0,   2,   2,  28,   5,   0,  19,  11,   0,
+         9,  10,  48,   0,   0,   4,  11,   0,   7,  11,   2,  28,   1,   0,
+        19,  11,   2,  28,   1,   0,  17,   5,   1,  83,   0,   2,   4,   5,
+         3,   0,  19,  11,   4,   6,   1,   1,  18, 102,   0,   4,   6,   2,
+        10,  92,   0,   8,   1,  11,   4,   7,   1,   5,   7, 116,   0,   2,
+        10, 108,   0,   8,   2,  11,   3,  28, 125,   0,   1,  11,   1,   3,
+       130,   0,  11,   1,  20, 140,   0,   4,   5,   2,   0,  21,  11,   1,
+        22, 150,   0,   4,   5,   3,   0,  23,  11,   1,  24, 160,   0,   4,
+         5,   4,   0,  25,  11,   4,   2,   5,  11,   2,  28,   1,   1,  11,
+       174,   0,   4,   9,   2,   0,  19,  11,   5,  10, 185,   0,   1,  10,
+       177,   0,   8,   3,  11,   2,  28,   1,   0,  14,   4,  11,   2,  11,
+         1,  15, 202,   0,  11,   0,  16,   0,  27,  11,   4,   0,   1,   0,
+         0,  11
+    };
+    public NTData[] nts = {
+      new NTData(   1, false, new Sets.Set256(0x0002)),
+      new NTData(  61, false, new Sets.Set256(0x0010)),
+      new NTData(  64, false, new Sets.Set256(0x0080)),
+      new NTData(  67, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData(  73, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData(  89, false, new Sets.Set256(0x0088, 0x1150)),
+      new NTData( 105, false, new Sets.Set256(0x0088, 0x1150)),
+      new NTData( 119, false, new Sets.Set256(0x0088, 0x1150)),
+      new NTData( 164, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 177, true , new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 188, false, new Sets.Set256(0x0000, 0x1000)),
+      new NTData( 197, false, new Sets.Set256(0x8000, 0x0001))
+    };
+    public Sets.Set256[] epsSets = {
+      new Sets.Set256(0x0000, 0x02a8),
+      new Sets.Set256(0x0000, 0x02ac),
+      new Sets.Set256(0x0000, 0x0008)
+    };
+    public Sets.Set256[] anySets = {
+      new Sets.Set256(0x0000)
+    };
+    public String[] names = {
+      "end of file", "PROBLEM", "END", "EPS", "LOCAL", "NONTERMINALS",
+      "RULES", "SEM", "MAXIMIZE", "MINIMIZE", "TERMINALS", "CONSTRAINTS",
+      "INIT", "CODE", "IN", "SET", "RANGE", "=", "|", ".", "(", ")", "[",
+      "]", "{", "}", ">>", "..", "ident", "source", "GPDefSyntaxAnalyzer",
+      "SemDecl", "SemAction", "NonterminalDecl", "RuleDef", "SynExpr",
+      "SynTerm", "SynFact", "TerminalDecl", "ConstraintDef",
+      "ConstraintRule", "SetDefinition"
+    };
+  } // GrammarTable;
+
+  private static GrammarTable gt;
+
+  private static int   pc;             // G-code counter
+  private static int[] stk;            // stack of G-code return adresses
+  private static int   sp;             // stack pointer
+  private static bool  mustRead;       // next Lex.token to read
+  private static int   altRoot;        // root of alternative chain
+  private static bool  leaveOrEnter;   // leaveCnt > 0 OR enterCnt > 0
+  private static int   leaveCnt;       // nr. of sem. proc. to leave
+  private static int   enterCnt;       // nr. of sem. proc. to enter
+  private static int   errDist;        // current error distance
+  private static int[] stkAtErr;       // saved stack at error position
+  private static int[] newSP;          // new stack length
+  private static int[] newPC;          // pc after recovery
+
+
+  public static void GPDefSyntaxAnalyzerSynMethod(Utils.ModuleAction action, out String moduleName) {
+  //-----------------------------------|----------------------------------------
+    moduleName = MODULENAME;
+    switch (action) {
+      case Utils.ModuleAction.getModuleName:
+        return;
+      case Utils.ModuleAction.initModule:
+        Errors.InstallStopParsingMethod(StopParsing);
+        gt       = new GrammarTable();
+        stk      = new int[MAXSTACKLEN];
+        stkAtErr = new int[MAXSTACKLEN];
+        newSP    = new int[LASTTERM + 1];
+        newPC    = new int[LASTTERM + 1];
+        break;
+      case Utils.ModuleAction.resetModule:
+        break;
+      case Utils.ModuleAction.cleanupModule:
+        gt       = null;
+        stk      = null;
+        stkAtErr = null;
+        newSP    = null;
+        newPC    = null;
+        break;
+    } // switch
+  } // GPDefSyntaxAnalyzerSynMethod
+
+  private static void Push(int pc) {
+    if (sp < MAXSTACKLEN)
+      stk[sp++] = pc;
+    else
+      Errors.Restriction(MODULENAME, "Push", "parser stack overflow");
+  } // Push
+
+  private static int Pop() {
+    if (sp > 0)
+      return stk[--sp];
+    else {
+      Errors.CompilerError(MODULENAME, "Pop", "parser stack underflow");
+      return 0;
+    } // else
+  } // Pop
+
+  private static void GetNextToken() {
+    for (;;) {
+      Lex.GetToken(); // updates Lex.token
+      if (Lex.token <= LASTTERM)
+        return;
+  #if !CONTPRAGMAACTS
+      if (NumOfSynErrors() == 0)
+  #endif
+        Sem.pragmaMethods[Lex.token - LASTTERM - 1]();
+    } // for
+  } // GetNextToken
+
+  private static int AdrAt(int pc) {
+    return (gt.code[pc - 1] |
+           (gt.code[pc    ] << 8));
+  } // AdrAt
+
+  private static void AdjustPC(ref int pc) {
+    if (pc == 0)
+      return;
+    for (;;)
+      switch ((Instruction)gt.code[pc - 1]) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+        case Instruction.NT:
+        case Instruction.NTA:
+        case Instruction.ANY:
+        case Instruction.ANYA:
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          return;
+        case Instruction.JMP:
+          pc = AdrAt(pc + 1);
+          break;
+        case Instruction.RET:
+          pc = 0;
+          return;
+        default:
+          pc++; // syn. or sem. action
+          break;
+      } // switch
+  } // AdjustPC
+
+  private static void GetSymInstr(int pc, 
+                        out int opcode, out int sy, out int nextPC, out int altPC) {
+    opcode = gt.code[pc - 1];
+    nextPC = 0; // dummy init
+    altPC  = 0; // dummy init 
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.TA:
+      case Instruction.TC:
+      case Instruction.TCA:
+      case Instruction.ANYA:
+      case Instruction.EPS:
+      case Instruction.EPSA:
+        sy = gt.code[pc];
+        break;
+      case Instruction.NT:
+      case Instruction.NTA:
+        sy = gt.code[pc] + FIRSTNONTERM;
+        break;
+      default: // ANY, JMP, RET, SEM, SYN 
+        sy = 0;
+        break;
+    } // switch
+    switch ((Instruction)opcode) {
+      case Instruction.T:
+      case Instruction.EPS:
+        nextPC = pc + 2;
+        altPC = 0;
+        break;
+      case Instruction.TC:
+      case Instruction.NT:
+        nextPC = pc + 3;
+        altPC = 0;
+        break;
+      case Instruction.TA:
+      case Instruction.ANYA:
+      case Instruction.EPSA:
+        nextPC = pc + 4;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.TCA:
+      case Instruction.NTA:
+        nextPC = pc + 5;
+        altPC = AdrAt(pc + 2);
+        break;
+      case Instruction.ANY:
+        nextPC = pc + 1;
+        altPC = 0;
+        break;
+    } // switch
+    AdjustPC(ref nextPC);
+    AdjustPC(ref altPC);
+  } // GetSymInstr
+
+  private static void Fill(int pc, int sp) {
+    int opcode, sy, nextPC, altPC, i;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+        case Instruction.TA:
+        case Instruction.TC:
+        case Instruction.TCA:
+          newPC[sy] = pc;
+          newSP[sy] = sp;
+          break;
+        case Instruction.NT:
+        case Instruction.NTA:
+          for (i = 0; i <= LASTTERM; i++)
+            if (Sets.member((ushort)i, gt.nts[sy - FIRSTNONTERM].firstSet)) {
+              newPC[i] = pc;
+              newSP[i] = sp;
+            }
+          if (gt.nts[sy - FIRSTNONTERM].del)
+            Fill(nextPC, sp);
+          break;
+        case Instruction.EPS:
+        case Instruction.EPSA:
+          Fill(nextPC, sp);
+          break;
+      } // switch
+      pc = altPC;
+    } // while
+  } // Fill
+
+  private static void FillSucc(int pc, int sp) {
+    int opcode, sy, nextPC, altPC;
+    AdjustPC(ref pc);
+    while (pc > 0) {
+      GetSymInstr(pc, out opcode, out sy, out nextPC, out altPC);
+      if (nextPC > 0)
+        Fill(nextPC, sp);
+      pc = altPC;
+    } // while
+  } // FillSucc
+
+  private static void Triple(int altRoot) {
+    for (int i = 0; i <= LASTTERM; i++) { // clear triple list
+      newPC[i] = 0;
+      newSP[i] = 0;
+    } // for
+    for (int i = 1; i <= sp; i++) {       // successors of stacked nt's
+      FillSucc(stk[i - 1], i - 1);
+      Fill(stk[i - 1], i - 1);
+    } // for
+    FillSucc(altRoot, sp);                // successors of alt. chain
+    Fill(altRoot, sp);                    // current alt. chain
+  } // Triple
+
+  private static void HandleSynErr(ref int pc, ref int altRoot) {
+    int     opcode, sy, nextPC, altPC, adjPC, nwSP, eq;
+    bool    nameInMsg;
+    String  name;
+    StringBuilder msg = new StringBuilder();
+    leaveOrEnter = false;
+    if (errDist >= MINERRDIST) { // --- primary error
+      nameInMsg = false;
+      adjPC = altRoot;
+      AdjustPC(ref adjPC);
+      while (adjPC > 0) {
+        GetSymInstr(adjPC, out opcode, out sy, out nextPC, out altPC);
+        if ( (Instruction)opcode >= Instruction.T  && 
+             (Instruction)opcode <= Instruction.NTA  ) {
+          if ( gt.names[sy].IndexOf(' ') >= 0 || 
+               !Char.IsLetter(gt.names[sy][0]) )
+            name = "\"" + gt.names[sy] + "\"";
+          else
+            name = gt.names[sy];
+          if (name.IndexOf('{') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("{", "{{");
+          if (name.IndexOf('}') > -1) // prevent formatting problems in Errors.SynError
+            name = name.Replace("}", "}}");
+          if (msg.Length + name.Length + 2 > 80) {
+            msg.Append(" ...");
+            break;
+          } // if
+          if (!nameInMsg) {
+            nameInMsg = true;
+            msg.Append("expected: " + name);
+          } else {
+            msg.Append(", ");
+            msg.Append(name);
+          } // else
+        } // if
+        adjPC = altPC;
+      } // while
+      if (!nameInMsg)
+        msg.Append("syntax error");
+      Errors.SynError(Lex.tokenLine, Lex.tokenCol, msg.ToString(), "");
+      Triple(altRoot);
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      leaveCnt = sp - nwSP;
+      enterCnt = 0;
+      Array.Copy(stk, stkAtErr, stk.Length); // save stack
+    } else {                 // --- spurios error
+      if (errDist == 0) {    // no token used since last error
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter)
+          return;
+      } // if
+      while (newPC[Lex.token] == 0) {
+        GetNextToken();      // may result in a call to StopParsing
+        if (leaveOrEnter) 
+          return;
+      } // while
+      nwSP = newSP[Lex.token];
+      eq = 2;                // compare stkAtErr and stk
+      while (eq <= sp && eq <= nwSP && stkAtErr[eq - 1] == stk[eq - 1])
+        eq++;
+      eq--;                  // stacks are equal up to index eq
+      leaveCnt = sp - eq;
+      if (nwSP < eq) {
+        leaveCnt = sp - nwSP;
+        enterCnt = 0;
+      } else if (nwSP > eq)
+        enterCnt = nwSP - eq;
+      else // nwSP == eq
+        enterCnt = 0;
+      Array.Copy(stkAtErr, stk, stk.Length); // restore stack
+    } // else
+    leaveOrEnter = (leaveCnt + enterCnt) > 0;
+    sp = nwSP;
+    pc = newPC[Lex.token];
+    altRoot = pc;
+    errDist = 0;
+  } // HandleSynErr
+
+  public static int Interpret() {
+  //-----------------------------------|----------------------------------------
+    int actionNr, opcode, currPC;
+    for (;;) {
+      opcode = gt.code[pc - 1];
+      if ( !leaveOrEnter && mustRead && 
+           (Instruction)opcode <= Instruction.EPSA ) {
+        GetNextToken();
+        mustRead = false;
+        errDist++;
+        altRoot = pc;
+      } // if
+      if (leaveOrEnter) {
+        if (leaveCnt > 0) {
+          leaveCnt--;
+          actionNr = 0;
+        } else { // enterCnt > 0
+          enterCnt--;
+          actionNr = gt.code[stkAtErr[sp - enterCnt - 1] - 2];
+        } // else
+        leaveOrEnter = (leaveCnt + enterCnt) > 0;
+        return actionNr;
+      } // if
+      pc++;
+      switch ((Instruction)opcode) {
+        case Instruction.T:
+          if (Lex.token == gt.code[pc - 1])
+            if (Lex.token != EOFTOK) {
+              pc++;
+              mustRead = true;
+            } else {
+              return 0;
+            } // else
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.TC:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 2;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.TCA:
+          if (Lex.token == gt.code[pc - 1]) {
+            pc += 4;
+            mustRead = true;
+            actionNr = gt.code[pc - 2];
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1); // try alternative
+          break;
+        case Instruction.NT:
+          currPC = gt.code[pc - 1];
+          if ( gt.nts[currPC].del || 
+               Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet) ) {
+            pc++;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.NTA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.nts[currPC].firstSet)) {
+            pc += 3;
+            actionNr = gt.code[pc - 1];
+            Push(pc + 1);
+            pc = gt.nts[currPC].startPC;
+            altRoot = pc;
+            return actionNr;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.ANY:
+          mustRead = true;
+          break;
+        case Instruction.ANYA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.anySets[currPC - 1])) {
+            pc += 3;
+            mustRead = true;
+          } else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.EPS:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc++;
+          else
+            HandleSynErr(ref pc, ref altRoot);
+          break;
+        case Instruction.EPSA:
+          currPC = gt.code[pc - 1];
+          if (Sets.member((ushort)Lex.token, gt.epsSets[currPC - 1]))
+            pc += 3;
+          else
+            pc = AdrAt(pc + 1);
+          break;
+        case Instruction.JMP:
+          pc = AdrAt(pc);
+          break;
+        case Instruction.RET:
+          pc = Pop();
+          altRoot = pc;
+          return 0;
+        default:
+          if (opcode <= 128) {
+  #if !CONTSEMACTS
+          if (Errors.NumOfSynErrors() == 0)
+  #endif
+            return opcode - 12;
+          } else // opcode > 128
+            return opcode - 128;
+          break;
+      } // switch
+    } // for
+  } // Interpret
+
+
+  public static bool Parse() {
+  //-----------------------------------|----------------------------------------
+    Lex.InitLex();
+    sp           = 0;
+    pc           = ROOTPC;
+    altRoot      = pc;
+    mustRead     = true;
+    errDist      = MINERRDIST + 1;
+    leaveOrEnter = false;
+    leaveCnt     = 0;
+    enterCnt     = 0;
+    Sem.StartSem();
+    return Errors.NumOfSynErrors() == 0;
+  } // Parse
+
+
+  public static void StopParsing() {
+  //-----------------------------------|----------------------------------------
+    leaveCnt     = sp + 1;
+    enterCnt     = 0;
+    leaveOrEnter = true;
+  } // StopParsing
+
+} // GPDefSyntaxAnalyzerSyn
+ 
+// End of GPDefSyntaxAnalyzerSyn.cs
+//=====================================|========================================
Index: branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Properties/AssemblyInfo.cs
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Properties/AssemblyInfo.cs	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/Properties/AssemblyInfo.cs	(revision 9430)
@@ -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("SyntaxAnalyzer")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("SyntaxAnalyzer")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 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("669b0747-1ca0-4b38-8d11-7d04b0b40efc")]
+
+// 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/SyntaxAnalyzer/SyntaxAnalyzer.csproj
===================================================================
--- branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/SyntaxAnalyzer.csproj	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/SyntaxAnalyzer/SyntaxAnalyzer.csproj	(revision 9430)
@@ -0,0 +1,78 @@
+﻿<?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>{729B818F-E1D0-4C9D-915A-775B2A4B1D27}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>SyntaxAnalyzer</RootNamespace>
+    <AssemblyName>SyntaxAnalyzer</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <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' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </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>
+    <Compile Include="Coco-2\Errors.cs" />
+    <Compile Include="Coco-2\Sets.cs" />
+    <Compile Include="Coco-2\Utils.cs" />
+    <Compile Include="GPDefSyntaxAnalyzer.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="GPDefSyntaxAnalyzerLex.cs" />
+    <Compile Include="GPDefSyntaxAnalyzerSem.cs" />
+    <Compile Include="GPDefSyntaxAnalyzerSyn.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="GPDef.atg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="GPDef.pgt.lst" />
+    <Content Include="GPDef.sg.lst" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call GenerateFromAtg.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <!-- 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/examples/Artificial Ant.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/Artificial Ant.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/Artificial Ant.txt	(revision 9430)
@@ -0,0 +1,231 @@
+PROBLEM ArtificialAnt
+
+CODE <<
+public struct Point { 
+  public int x; public int y; 
+  public Point(int x, int y) {
+    this.x = x;
+	this.y = y;
+  }
+};
+
+class World {
+
+private static string[] LosAltosTrail = new string[] {
+" ###                                          ",
+"   #                                  .###..  ",
+"   #                                  #    #  ",
+"   #                                  #    #  ",
+"   ####.#####           .############..    .  ",
+"            #           .                  #  ",
+"            #           #                  .  ",
+"            #           #                  .  ",
+"            #           #                  #  ",
+"            .           #                  .  ",
+"            #           .                  .  ",
+"            #           .                  #  ",
+"            #           #                  .  ",
+"            #           #            ...###.  ",
+"            .       .#...            #        ",
+"            .       .                .        ",
+"            #       .                .        ",
+"            #       #                .#...    ",
+"            #       #                    #    ",
+"            #       #                    .    ",
+"            #       #                    .    ",
+"            #       .                ...#.    ",
+"            #       .                #        ",
+" ..##..#####.       #                #        ",
+" #                  #                #        ",
+" #                  #                #        ",
+" #                  #                #        ",
+" #                  #                #        ",
+" #                  #                #        ",
+" #     .#####....##..                #        ",
+" #     #                             #        ",
+" .     #                             #        ",
+" .####..                             #        ",
+"                                   #.#        ",
+"                                   #          ",
+"                                   #          ",
+"                                   #          ",
+"                                   #          ",
+"                                   #          ",
+"                                   #          ",
+"                                   #          ",
+"                              ######          ",
+"                              .               ",
+"                              #               ",
+"                              #               ",
+"                              #               ",
+"                              #               ",
+"                              #               ",
+"                              #               ",
+"                            #..               ",
+"                            #                 ",
+"                            #                 ",
+"                            #                 ",
+"                            #                 ",
+"                            #                 ",
+"                      .######                 ",
+"                      .                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       ",
+"                      #                       "
+};
+  private char[][] world = LosAltosTrail.Select(l=>l.ToArray()).ToArray();
+  public int TotalFood = LosAltosTrail.Select(l=>l.Where(c=>c=='#').Count()).Sum();
+  public int Width { get { return 100; } }
+  public int Height { get { return 100; } }
+  
+  public void Reset() {
+    world = LosAltosTrail.Select(l=>l.ToArray()).ToArray();
+  }
+  
+  public bool FoodAt(Point p) {
+    if(p.x < 0 || p.y < 0) return false;
+    if(world.Length <= p.y) return false;
+	if(world[p.y].Length <= p.x) return false;
+    return world[p.y][p.x] == '#';
+  }
+  public void RemoveFoodAt(Point p) {
+    if(world.Length < p.y) return;
+	if(world[p.y].Length < p.x) return;
+    world[p.y][p.x] = ' ';
+  }
+}
+
+enum Direction {West, East, North, South};
+
+class AntState {
+  public Point Position { get; set;} 
+  public int MaxSteps { get; set;}
+  public Direction Direction { get; set; }
+  public World World { get; set; }
+  public int Steps { get; set; }
+  public int FoodEaten { get; set; }
+ 
+  public AntState() {
+    Steps = 0;	
+	FoodEaten = 0;
+  }
+ 
+  public void TurnLeft() {
+    Steps++;
+    switch(Direction) {
+	  case Direction.West: Direction = Direction.South; break;
+	  case Direction.South: Direction = Direction.East; break;
+	  case Direction.East: Direction = Direction.North; break;
+	  case Direction.North: Direction = Direction.West; break;
+	}
+  }
+  public void TurnRight() {
+    Steps++;
+    switch(Direction) {
+	  case Direction.West: Direction = Direction.North; break;
+	  case Direction.South: Direction = Direction.West; break;
+	  case Direction.East: Direction = Direction.South; break;
+	  case Direction.North: Direction = Direction.East; break;
+	}
+  }
+  public void MoveForward() { 
+    Position = NextPosition; 
+	Steps++; 
+	if(World.FoodAt(Position)) {
+    	World.RemoveFoodAt(Position);
+		FoodEaten++;
+    }
+  }
+  public Point NextPosition { 
+    get { 
+	    int x, y;
+        switch(Direction) {
+    	  case Direction.West: 
+		    x = (Position.x + World.Width - 1) % World.Width;
+			y = Position.y;
+			return new Point(x, y);
+    	  case Direction.South: 
+  		    x = Position.x;
+			y = (Position.y + World.Height + 1) % World.Height;
+			return new Point(x, y);
+    	  case Direction.East:
+  		    x = (Position.x + World.Width + 1) % World.Width;
+			y = Position.y;
+			return new Point(x, y);
+    	  case Direction.North:
+  		    x = Position.x;
+			y = (Position.y + World.Height - 1) % World.Height;
+			return new Point(x, y);
+    	}
+ 		return new Point(-1,-1);
+    } 
+  }  
+}
+
+World CreateWorld() {   
+  var w = new World();
+  Console.WriteLine("Total food: "+w.TotalFood);
+  return w;
+}
+
+World world;
+>>
+INIT <<
+  world = CreateWorld();
+>>
+
+NONTERMINALS
+  Ant<<World world, AntState state>>. 
+  IfFoodAhead<<World world, AntState state>>.
+  Prog2<<World world, AntState state>>.
+  Prog3<<World world, AntState state>>.
+
+TERMINALS
+  Left<<>> CONSTRAINTS .
+  Right<<>> CONSTRAINTS .
+  Move<<>> CONSTRAINTS .
+ 
+RULES
+  Ant<<World world, AntState state>> = 
+    IfFoodAhead<<world, state>>
+    | Prog2<<world, state>>
+    | Prog3<<world, state>>
+    | Left<<>>                                         SEM << state.TurnLeft(); >>
+    | Right<<>>                                        SEM << state.TurnRight(); >>
+    | Move<<>>                                         SEM << state.MoveForward(); >>
+    .
+    
+  IfFoodAhead<<World world, AntState state>> =     
+                                                   SEM <<
+                                                      if(world.FoodAt(state.NextPosition)) {
+                                                   >>
+                                                   
+    Ant<<world, state>>                            SEM << } else { >>
+    Ant<<world, state>>                            SEM << } >> 
+  .
+
+  Prog2<<World world, AntState state>> = 
+    Ant<<world, state>> Ant<<world, state>>
+  .
+  
+  Prog3<<World world, AntState state>> =
+    Ant<<world, state>> Ant<<world, state>> Ant<<world, state>>
+  .
+
+
+MAXIMIZE                                                   /* could also use the keyword MINIMIZE here */
+  <<    
+    world.Reset();
+    var state = new AntState() {Position = new Point(0,0), MaxSteps=400, Direction=Direction.East, World = world};
+    while(state.Steps < state.MaxSteps) {
+      Ant(world, state);
+    }
+    return (double)state.FoodEaten;
+  >>  
+END ArtitificialAnt.
Index: branches/HeuristicLab.Problems.GPDL/examples/Factorial.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/Factorial.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/Factorial.txt	(revision 9430)
@@ -0,0 +1,146 @@
+PROBLEM Factorial
+CODE<<
+  string[] allTerminals = new string[] {"a", "b", "c", "d", "e", "n"} ; 
+  SymTab symTab = new SymTab();
+
+  class SymTab {
+    private Dictionary<string, int> values = new Dictionary<string,int>();
+    public void SetValue(string id, int val) {
+      values[id] = val;
+    }
+    public int GetValue(string id) {
+      int val = 0;
+      values.TryGetValue(id, out val);      
+      return val;
+    }
+  }
+>>
+
+NONTERMINALS
+  Program<<int n, out int r>>.                                       /* return value is the result of the last statement. */
+  StatSeq<<out int r>>.                                                  
+  AssignStat<<out int r>>.                                               /* result of assignment is the assigned value */
+  IncStat<<out int r>>.
+  DecStat<<out int r>>.
+  WhileStat<<out int r>>.                                                /* result of while loop is the result of the last executed statement */
+  ReturnStat<<out int r>>.  
+  Expr<<out int r>>.
+  AdditionExpr<<out int r>>.
+  SubtractionExpr<<out int r>>.
+  DivisionExpr<<out int r>>.
+  MultiplicationExpr<<out int r>>.
+  BooleanExpr<<out bool b>>.
+  NotExpr<<out bool b>>.
+  LessThanExpr<<out bool b>>.
+  EqualExpr<<out bool b>>.
+  AssignStatAndStatSeq<<out int r>>.
+  WhileStatAndStatSeq<<out int r>>.
+  ReturnStatAndStatSeq<<out int r>>.
+
+TERMINALS
+  ident<<out string id>> 
+    CONSTRAINTS
+    id IN SET << allTerminals; >>
+  .
+  Const<<out int val>> 
+    CONSTRAINTS
+    val IN SET << Enumerable.Range(0, 100); >>
+  .
+  Nothing<<out int val>>
+     CONSTRAINTS
+     val IN SET << Enumerable.Repeat(0, 1); >>
+  .
+  
+RULES
+  Program<<int n, out int r>> = StatSeq<<out r>>                         SEM << symTab.SetValue("n", n); >>
+  .
+  StatSeq<<out int r>> =                                                 LOCAL << r = 0; >>
+    Nothing<<out r>>                                                              
+    | AssignStatAndStatSeq<<out r>>
+    | WhileStatAndStatSeq<<out r>>
+    | ReturnStatAndStatSeq<<out r>>
+	| IncStat<<out r>>
+	| DecStat<<out r>>
+  .
+  
+  AssignStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>>  AssignStat<<out r>> 
+  .
+  WhileStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>> WhileStat<<out r>> 
+  .
+  ReturnStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>>  ReturnStat<<out r>> 
+  .
+
+  AssignStat<<out int r>> =                                               LOCAL << int e; string id;>>
+    ident<<out id>> Expr<<out e>>                                         SEM  << symTab.SetValue(id, e); r = e; >>
+  .
+  IncStat<<out int r>> =                                                  LOCAL << int e; string id;>>
+    ident<<out id>>                                                       SEM  << r = symTab.GetValue(id) + 1; symTab.SetValue(id, r); >>
+  .
+  DecStat<<out int r>> =                                                  LOCAL << int e; string id;>>
+    ident<<out id>>                                                       SEM  << r = symTab.GetValue(id) - 1; symTab.SetValue(id, r); >>
+  .
+
+  WhileStat<<out int r>> =                                                LOCAL << bool b; int c = 0; >>
+                                                                          SEM  << r = 0; >>
+                                                                          SEM  << while(true && c++ < 100) { >>
+    BooleanExpr<<out b>>                                                  SEM  << if(!b) break; >>
+    StatSeq<<out r>>                                                      SEM  << } >>
+  .
+  ReturnStat<<out int r>> = Expr<<out r>>                                 SEM  << return; >>
+  .
+  Expr<<out int r>> =                                                     LOCAL << string id; >>
+    AdditionExpr<<out r>> 
+    | SubtractionExpr<<out r>> 
+    | MultiplicationExpr<<out r>> 
+    | DivisionExpr<<out r>> 
+    | Const<<out r>> 
+    | ident<<out id>>                                                      SEM  << r = symTab.GetValue(id); >>
+  .
+  AdditionExpr<<out int r>> =                                              LOCAL << int e1, e2; >>
+     Expr<<out e1>> Expr<<out e2>>                                         SEM  << r = e1 + e2; >>
+  .
+  SubtractionExpr<<out int r>> =                                           LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e1 - e2; >>
+  .
+  MultiplicationExpr<<out int r>> =                                        LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e1 * e2; >>
+  .
+  DivisionExpr<<out int r>> =                                              LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e2 == 0 ? 1 : e1 / e2; >>
+  .
+  BooleanExpr<<out bool b>> = 
+    LessThanExpr<<out b>> 
+    | EqualExpr<<out b>> 
+    | NotExpr<<out b>> 
+  .
+  NotExpr<<out bool b>> =                                                  LOCAL << bool notB; >>
+    BooleanExpr<<out notB>>                                                SEM  << b = !notB; >>
+  .
+  LessThanExpr<<out bool b>> =                                             LOCAL << int lhs, rhs; >>
+    Expr<<out lhs>> Expr<<out rhs>>                                        SEM  << b = lhs < rhs; >>
+  .
+  EqualExpr<<out bool b>> =                                                LOCAL << int lhs, rhs; >>
+    Expr<<out lhs>> Expr<<out rhs>>                                        SEM  << b = lhs == rhs; >>
+  .
+  
+  
+MINIMIZE                                                   /* could also use the keyword MAXIMIZE here */
+  <<
+    var ns = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+    var expected = new int[] { 1,1,2,6,24,120,720,5040,40320,362880,3628800 };
+    
+    double sumOfLogAbsoluteErrors = 0;
+    for(int i=0;i<ns.Length;i++) {
+      int actualResult;
+      Program(ns[i], out actualResult);
+      sumOfLogAbsoluteErrors += Math.Log(Math.Abs(expected[i] - actualResult) + 1);
+    }
+    
+    return sumOfLogAbsoluteErrors;
+  >>
+
+  
+END Factorial.
Index: branches/HeuristicLab.Problems.GPDL/examples/Fib.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/Fib.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/Fib.txt	(revision 9430)
@@ -0,0 +1,146 @@
+PROBLEM Fib
+CODE<<
+  string[] allTerminals = new string[] {"a", "b", "c", "d", "e", "n"} ; 
+  SymTab symTab = new SymTab();
+
+  class SymTab {
+    private Dictionary<string, int> values = new Dictionary<string,int>();
+    public void SetValue(string id, int val) {
+      values[id] = val;
+    }
+    public int GetValue(string id) {
+      int val = 0;
+      values.TryGetValue(id, out val);      
+      return val;
+    }
+  }
+>>
+
+NONTERMINALS
+  Program<<int n, out int r>>.                                       /* return value is the result of the last statement. */
+  StatSeq<<out int r>>.                                                  
+  AssignStat<<out int r>>.                                               /* result of assignment is the assigned value */
+  IncStat<<out int r>>.
+  DecStat<<out int r>>.
+  WhileStat<<out int r>>.                                                /* result of while loop is the result of the last executed statement */
+  ReturnStat<<out int r>>.  
+  Expr<<out int r>>.
+  AdditionExpr<<out int r>>.
+  SubtractionExpr<<out int r>>.
+  DivisionExpr<<out int r>>.
+  MultiplicationExpr<<out int r>>.
+  BooleanExpr<<out bool b>>.
+  NotExpr<<out bool b>>.
+  LessThanExpr<<out bool b>>.
+  EqualExpr<<out bool b>>.
+  AssignStatAndStatSeq<<out int r>>.
+  WhileStatAndStatSeq<<out int r>>.
+  ReturnStatAndStatSeq<<out int r>>.
+
+TERMINALS
+  ident<<out string id>> 
+    CONSTRAINTS
+    id IN SET << allTerminals; >>
+  .
+  Const<<out int val>> 
+    CONSTRAINTS
+    val IN SET << Enumerable.Range(0, 100); >>
+  .
+  Nothing<<out int val>>
+     CONSTRAINTS
+     val IN SET << Enumerable.Repeat(0, 1); >>
+  .
+  
+RULES
+  Program<<int n, out int r>> = StatSeq<<out r>>                         SEM << symTab.SetValue("n", n); >>
+  .
+  StatSeq<<out int r>> =                                                 LOCAL << r = 0; >>
+    Nothing<<out r>>                                                              
+    | AssignStatAndStatSeq<<out r>>
+    | WhileStatAndStatSeq<<out r>>
+    | ReturnStatAndStatSeq<<out r>>
+	| IncStat<<out r>>
+	| DecStat<<out r>>
+  .
+  
+  AssignStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>>  AssignStat<<out r>> 
+  .
+  WhileStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>> WhileStat<<out r>> 
+  .
+  ReturnStatAndStatSeq<<out int r>> = 
+    StatSeq<<out r>>  ReturnStat<<out r>> 
+  .
+
+  AssignStat<<out int r>> =                                               LOCAL << int e; string id;>>
+    ident<<out id>> Expr<<out e>>                                         SEM  << symTab.SetValue(id, e); r = e; >>
+  .
+  IncStat<<out int r>> =                                                  LOCAL << int e; string id;>>
+    ident<<out id>>                                                       SEM  << r = symTab.GetValue(id) + 1; symTab.SetValue(id, r); >>
+  .
+  DecStat<<out int r>> =                                                  LOCAL << int e; string id;>>
+    ident<<out id>>                                                       SEM  << r = symTab.GetValue(id) - 1; symTab.SetValue(id, r); >>
+  .
+
+  WhileStat<<out int r>> =                                                LOCAL << bool b; int c = 0; >>
+                                                                          SEM  << r = 0; >>
+                                                                          SEM  << while(true && c++ < 100) { >>
+    BooleanExpr<<out b>>                                                  SEM  << if(!b) break; >>
+    StatSeq<<out r>>                                                      SEM  << } >>
+  .
+  ReturnStat<<out int r>> = Expr<<out r>>                                 SEM  << return; >>
+  .
+  Expr<<out int r>> =                                                     LOCAL << string id; >>
+    AdditionExpr<<out r>> 
+    | SubtractionExpr<<out r>> 
+    | MultiplicationExpr<<out r>> 
+    | DivisionExpr<<out r>> 
+    | Const<<out r>> 
+    | ident<<out id>>                                                      SEM  << r = symTab.GetValue(id); >>
+  .
+  AdditionExpr<<out int r>> =                                              LOCAL << int e1, e2; >>
+     Expr<<out e1>> Expr<<out e2>>                                         SEM  << r = e1 + e2; >>
+  .
+  SubtractionExpr<<out int r>> =                                           LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e1 - e2; >>
+  .
+  MultiplicationExpr<<out int r>> =                                        LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e1 * e2; >>
+  .
+  DivisionExpr<<out int r>> =                                              LOCAL << int e1, e2; >>
+    Expr<<out e1>> Expr<<out e2>>                                          SEM  << r = e2 == 0 ? 1 : e1 / e2; >>
+  .
+  BooleanExpr<<out bool b>> = 
+    LessThanExpr<<out b>> 
+    | EqualExpr<<out b>> 
+    | NotExpr<<out b>> 
+  .
+  NotExpr<<out bool b>> =                                                  LOCAL << bool notB; >>
+    BooleanExpr<<out notB>>                                                SEM  << b = !notB; >>
+  .
+  LessThanExpr<<out bool b>> =                                             LOCAL << int lhs, rhs; >>
+    Expr<<out lhs>> Expr<<out rhs>>                                        SEM  << b = lhs < rhs; >>
+  .
+  EqualExpr<<out bool b>> =                                                LOCAL << int lhs, rhs; >>
+    Expr<<out lhs>> Expr<<out rhs>>                                        SEM  << b = lhs == rhs; >>
+  .
+  
+  
+MINIMIZE                                                   /* could also use the keyword MAXIMIZE here */
+  <<
+    var ns = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+    var expected = new int[] { 1,1,2,3,5,8,13,21,34,55, 89};
+    
+    double sumOfAbsoluteErrors = 0;
+    for(int i=0;i<ns.Length;i++) {
+      int actualResult;
+      Program(ns[i], out actualResult);
+      sumOfAbsoluteErrors += Math.Abs(expected[i] - actualResult);
+    }
+    
+    return sumOfAbsoluteErrors;
+  >>
+
+  
+END Fib.
Index: branches/HeuristicLab.Problems.GPDL/examples/multi-output-multiplier.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/multi-output-multiplier.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/multi-output-multiplier.txt	(revision 9430)
@@ -0,0 +1,102 @@
+PROBLEM MultiOutputMultiplier
+
+CODE <<
+  const int N = 4;
+  class State { public bool[] x1; public bool[] x2; public bool[] output; }
+  private void GenerateProblemData(int n, out bool[][] a, out bool[][] b, out bool[][] expectedOutput) {
+    var nConfigurations = (int)Math.Pow(2, n);
+    var e = from i in Enumerable.Range(0, nConfigurations)
+            from j in Enumerable.Range(0, i+1)
+            select new {a = ToBitArray(N, i), b = ToBitArray(N, j), res = ToBitArray(2*N, i*j) };
+    
+    a = e.Select(x=>x.a).ToArray();
+    b = e.Select(x=>x.b).ToArray();
+    expectedOutput = e.Select(x=>x.res).ToArray();
+  }
+  
+  private bool[] ToBitArray(int n, int x) {
+    var b = new bool[n];
+    for(int i=0; i<n; i++) {
+      b[n - i - 1] = (x % 2) == 0;
+      x = x / 2;
+    }
+    if(x>0) throw new ArgumentException();
+    return b;
+  }
+>>
+
+NONTERMINALS
+  Expr<<State state, out bool res>>.
+  Assign<<State state, out bool res>>.
+  AND<<State state, out bool res>>.
+  AND1<<State state, out bool res>>.
+  XOR<<State state, out bool res>>.
+  OR<<State state, out bool res>>.
+  
+
+TERMINALS
+  InputA<<out int id>> 
+    CONSTRAINTS
+      id IN SET << Enumerable.Range(0, N) >>
+  .
+  
+  InputB<<out int id>> 
+    CONSTRAINTS
+      id IN SET << Enumerable.Range(0, N) >>
+  .
+  
+  Output<<out int id>>  
+    CONSTRAINTS
+      id IN SET << Enumerable.Range(0, 2 * N) >>
+  .
+
+RULES
+  Expr<<State state, out bool res>> =                   LOCAL << int id; >>
+    Assign<<state, out res>>
+    | AND<<state, out res>>
+    | AND1<<state, out res>>
+    | XOR<<state, out res>>
+    | OR<<state, out res>>
+    | InputA<<out id>>                                                          SEM<< res = state.x1[id]; >>
+    | InputB<<out id>>                                                          SEM<< res = state.x2[id]; >>
+    | Output<<out id>>                                                          SEM<< res = state.output[id]; >>
+  .                                                                             
+                                                                                
+  Assign<<State state, out bool res>> =                 LOCAL << int outId; >>
+    Output<<out outId>>  Expr<<state, out res>>                        SEM<< state.output[outId] = res; >>
+  .
+  
+  AND<<State state, out bool res>> =                    LOCAL << bool resA, resB; >>
+    Expr<<state, out resA>> Expr<<state, out resB>>           SEM << res = resA & resB; >>
+  .
+  AND1<<State state, out bool res>> =                   LOCAL << bool resA, resB; >>
+    Expr<<state, out resA>> Expr<<state, out resB>>           SEM << res = resA & !resB; >>
+  .
+  XOR<<State state, out bool res>> =                    LOCAL << bool resA, resB; >>
+    Expr<<state, out resA>> Expr<<state, out resB>>           SEM << res = resA ^ !resB; >>
+  .
+  OR<<State state, out bool res>> =                     LOCAL << bool resA, resB; >>
+    Expr<<state, out resA>> Expr<<state, out resB>>           SEM << res = resA | resB; >>
+  .
+
+MINIMIZE
+  <<
+    bool[][] a, b, expectedOutput;
+    GenerateProblemData(N, out a, out b, out expectedOutput);
+    
+    int sumErr = 0;
+    for(int i=0; i<expectedOutput.Length; i++) {
+      bool tmp;
+      // evaluate tree for inputs a and b
+      var state = new State();
+      state.x1 = a[i]; state.x2 = b[i]; state.output = new bool[2*N];
+      Expr(state, out tmp);
+
+      // count incorrect bits
+      for(int j=0;j<state.output.Length;j++) {
+        if(state.output[j] != expectedOutput[i][j]) sumErr++;
+      }
+    }
+    return (double)sumErr;
+  >>
+END MultiOutputMultiplier.
Index: branches/HeuristicLab.Problems.GPDL/examples/symbreg HEAL.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/symbreg HEAL.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/symbreg HEAL.txt	(revision 9430)
@@ -0,0 +1,104 @@
+PROBLEM SymbReg
+
+CODE <<
+  double[,] inputValues;
+  double[] targetValues;
+  string[] variableNames;
+  Dictionary<string,int> nameToCol;
+  
+  double GetValue(double[,] data, string varName, int row) {
+    if(nameToCol == null) {
+      /* init mapping */
+      nameToCol = new Dictionary<string, int>();
+      for(int i=0; i<variableNames.Length; i++) {
+        nameToCol[variableNames[i]] = i;
+      }
+    }
+    return data[row, nameToCol[varName]];
+  }
+
+  double RSquared(IEnumerable<double> xs, IEnumerable<double> ys) {
+     HeuristicLab.Problems.DataAnalysis.OnlineCalculatorError error;
+     var r2 = HeuristicLab.Problems.DataAnalysis.OnlinePearsonsRSquaredCalculator.Calculate(xs, ys, out error);
+     if(error == HeuristicLab.Problems.DataAnalysis.OnlineCalculatorError.None) return r2;
+     else return 0.0;
+  }
+  
+
+  void LoadData(string fileName, out double[,] inputValues, out string[] variableNames, out double[] target) {
+    var prov = new HeuristicLab.Problems.Instances.DataAnalysis.RegressionRealWorldInstanceProvider();
+    var dd = prov.GetDataDescriptors().OfType<HeuristicLab.Problems.Instances.DataAnalysis.Housing>().Single();
+    var problemData = prov.LoadData(dd);    
+    
+    inputValues = new double[problemData.TrainingIndices.Count(), problemData.AllowedInputVariables.Count()];
+    foreach(var r in problemData.TrainingIndices) {
+       int i=0;
+       foreach(var v in problemData.AllowedInputVariables) {
+          inputValues[r, i++] = problemData.Dataset.GetDoubleValue(v, r);
+       }
+    }
+    variableNames = problemData.AllowedInputVariables.ToArray();
+    target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
+  }
+>>
+
+INIT <<
+  LoadData("filename.csv", out inputValues, out variableNames, out targetValues);
+>>
+
+NONTERMINALS
+  Model<<int row, out double val>>.
+  RPB<<int row, out double val>>.
+  Addition<<int row, out double val>>.
+  Subtraction<<int row, out double val>>.
+  Multiplication<<int row, out double val>>.
+  Division<<int row, out double val>>.
+
+TERMINALS
+  Const<<out double val>> 
+    CONSTRAINTS
+      val IN RANGE <<-100>> .. <<100>>
+  .
+  Var<<out string varName, out double weight>>  
+    CONSTRAINTS
+      varName IN SET <<variableNames>>
+      weight IN RANGE <<-100>> .. <<100>>
+  .
+
+RULES
+  Model<<int row, out double val>> =                       
+    RPB<<row, out val>> .
+    
+  RPB<<int row, out double val>> =                         LOCAL << string varName; double w; >> 
+    Addition<<row, out val>>
+    | Subtraction<<row, out val>>
+    | Division<<row, out val>>
+    | Multiplication<<row, out val>>                       
+    | Var<<out varName, out w>>                            SEM << val = w * GetValue(inputValues, varName, row); >>
+    | Const<<out val>>
+  .
+
+  Addition<<int row, out double val>> =                    LOCAL << double x1, x2; >>
+    RPB<<row, out x1>> RPB<<row, out x2>>                  SEM << val = x1 + x2; >>
+  .
+  Subtraction<<int row, out double val>> =                 LOCAL << double x1, x2; >>
+    RPB<<row, out x1>> RPB<<row, out x2>>                  SEM << val = x1 - x2; >>
+  .
+  Division<<int row, out double val>> =                    LOCAL << double x1, x2; >>
+    RPB<<row, out x1>> RPB<<row, out x2>>                  SEM << val = x1 / x2; >>
+  .
+  Multiplication<<int row, out double val>> =              LOCAL << double x1, x2; >>
+    RPB<<row, out x1>> RPB<<row, out x2>>                  SEM << val = x1 * x2; >>
+  .
+
+MAXIMIZE                                                   /* could also use the keyword MINIMIZE here */
+  << 
+    var rows = System.Linq.Enumerable.Range(0, inputValues.GetLength(0));
+    var predicted = rows.Select(r => {
+      double result;
+      Model(r, out result);                                /* we can call the root symbol directly */
+      return result;
+    });
+    return RSquared(predicted, targetValues);
+  >>
+END SymbReg.
Index: branches/HeuristicLab.Problems.GPDL/examples/symbreg Koza.txt
===================================================================
--- branches/HeuristicLab.Problems.GPDL/examples/symbreg Koza.txt	(revision 9430)
+++ branches/HeuristicLab.Problems.GPDL/examples/symbreg Koza.txt	(revision 9430)
@@ -0,0 +1,103 @@
+PROBLEM SymbRegKoza
+CODE <<
+  double[,] inputValues;
+  double[] targetValues;
+  string[] variableNames;
+  Dictionary<string,int> nameToCol;
+  
+  double GetValue(double[,] data, string varName, int row) {
+    if(nameToCol == null) {
+      /* init mapping */
+      nameToCol = new Dictionary<string, int>();
+      for(int i=0; i<variableNames.Length; i++) {
+        nameToCol[variableNames[i]] = i;
+      }
+    }
+    return data[row, nameToCol[varName]];
+  }
+
+  double RSquared(IEnumerable<double> xs, IEnumerable<double> ys) {
+     HeuristicLab.Problems.DataAnalysis.OnlineCalculatorError error;
+     var r2 = HeuristicLab.Problems.DataAnalysis.OnlinePearsonsRSquaredCalculator.Calculate(xs, ys, out error);
+     if(error == HeuristicLab.Problems.DataAnalysis.OnlineCalculatorError.None) return r2;
+     else return 0.0;
+  }
+  
+
+  void LoadData(string fileName, out double[,] inputValues, out string[] variableNames, out double[] target) {
+    var prov = new HeuristicLab.Problems.Instances.DataAnalysis.RegressionRealWorldInstanceProvider();
+    var dd = prov.GetDataDescriptors().OfType<HeuristicLab.Problems.Instances.DataAnalysis.Housing>().Single();
+    var problemData = prov.LoadData(dd);    
+    
+    inputValues = new double[problemData.TrainingIndices.Count(), problemData.AllowedInputVariables.Count()];
+    foreach(var r in problemData.TrainingIndices) {
+       int i=0;
+       foreach(var v in problemData.AllowedInputVariables) {
+          inputValues[r, i++] = problemData.Dataset.GetDoubleValue(v, r);
+       }
+    }
+    variableNames = problemData.AllowedInputVariables.ToArray();
+    target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
+  }
+>>
+
+INIT <<
+  LoadData("filename.csv", out inputValues, out variableNames, out targetValues);
+>>
+
+NONTERMINALS
+  Model<<int row, out double val>>.
+  RPB<<int row, out double val>>.
+  Addition<<int row, out double val>>.
+  Subtraction<<int row, out double val>>.
+  Multiplication<<int row, out double val>>.
+  Division<<int row, out double val>>.
+
+TERMINALS
+  ERC<<out double val>> 
+    CONSTRAINTS
+	  val IN RANGE <<-100>> .. <<100>>
+  .
+
+  Var<<out string varName>> 
+    CONSTRAINTS
+	  varName IN SET <<variableNames>>
+  .
+
+RULES
+  Model<<int row, out double val>> =
+    RPB<<row, out val>> .
+
+  RPB<<int row, out double val>> =                         LOCAL << string varName; >>
+    Addition<<row, out val>>
+    | Subtraction<<row, out val>>
+    | Division<<row, out val>>
+    | Multiplication<<row, out val>>
+    | Var<<out varName>>                                   SEM << val = GetValue(inputValues, varName, row); >>
+    | ERC<<out val>>
+  .
+
+  Addition<<int row, out double val>> =                    LOCAL << double x1, x2; >>
+      RPB<<row, out x1>> RPB<<row, out x2>>                SEM<< val = x1 + x2; >>
+  .
+  Subtraction<<int row, out double val>> =                 LOCAL << double x1, x2; >>
+      RPB<<row, out x1>> RPB<<row, out x2>>                SEM<< val = x1 - x2; >>
+  .
+  Division<<int row, out double val>> =                    LOCAL << double x1, x2; >>
+      RPB<<row, out x1>> RPB<<row, out x2>>                SEM<< val = x1 / x2; >>
+  .
+  Multiplication<<int row, out double val>> =              LOCAL << double x1, x2; >>
+      RPB<<row, out x1>> RPB<<row, out x2>>                SEM<< val = x1 * x2; >>
+  .
+
+MAXIMIZE                                                   /* could also use the keyword MINIMIZE here */
+  << 
+    var rows = System.Linq.Enumerable.Range(0, inputValues.GetLength(0));
+    var predicted = rows.Select(r => {
+      double result;
+      Model(r, out result);                                /* we can call the root symbol directly */
+      return result;
+    });
+    return RSquared(predicted, targetValues);
+  >>
+END SymbRegKoza.
