Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml	(revision 9674)
@@ -0,0 +1,12 @@
+﻿<UserControl
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" x:Class="HeuristicLab.Problems.GPDL.Views.CodeEditor" 
+             mc:Ignorable="d" 
+             d:DesignHeight="300" d:DesignWidth="300">
+    <Grid>
+        <avalonedit:TextEditor Name="textEditor" SyntaxHighlighting="{Binding syntaxHighlighting}" FontFamily="Consolas" MouseWheel="textEditor_MouseWheel" KeyDown="textEditor_KeyDown" KeyUp="textEditor_KeyUp" PreviewMouseWheel="textEditor_PreviewMouseWheel" />
+    </Grid>
+</UserControl>
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml.cs	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml.cs	(revision 9674)
@@ -0,0 +1,93 @@
+﻿using System.Collections.Generic;
+using System.IO;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Xml;
+using ICSharpCode.AvalonEdit.CodeCompletion;
+using ICSharpCode.AvalonEdit.Highlighting;
+using ICSharpCode.AvalonEdit.Highlighting.Xshd;
+
+namespace HeuristicLab.Problems.GPDL.Views {
+  /// <summary>
+  /// Interaction logic for CodeEditor.xaml
+  /// </summary>
+  public partial class CodeEditor : UserControl {
+    public string syntaxHighlighting { get; set; }
+    private bool controlHeld = false;
+    private CompletionWindow completionWindow;
+    private ColorizeErrors errorLineTransformer;
+
+    public CodeEditor() {
+      InitializeComponent();
+
+      LoadSyntaxHighlighting();
+
+      // for auto-completion
+      textEditor.TextArea.TextEntered += textEditor_TextArea_TextEntered;
+      // show errors visually
+      errorLineTransformer = new ColorizeErrors();
+      textEditor.TextArea.TextView.LineTransformers.Add(errorLineTransformer);
+    }
+
+    private void textEditor_TextArea_TextEntered(object sender, TextCompositionEventArgs e) {
+      if (e.Text == ".") {
+        // Open code completion after the user has pressed dot:
+        completionWindow = new CompletionWindow(textEditor.TextArea);
+        IList<ICompletionData> data = completionWindow.CompletionList.CompletionData;
+        data.Add(new MyCompletionData("Item1"));
+        data.Add(new MyCompletionData("Item2"));
+        data.Add(new MyCompletionData("Item3"));
+        completionWindow.Show();
+        completionWindow.Closed += delegate {
+          completionWindow = null;
+        };
+      }
+    }
+
+
+    private void LoadSyntaxHighlighting() {
+      textEditor.ShowLineNumbers = true;
+
+      using (var s = new StringReader(Properties.Resources.GPDL)) {
+        using (XmlTextReader reader = new XmlTextReader(s)) {
+          textEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
+
+        }
+      }
+    }
+
+    private void textEditor_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) {
+    }
+
+    private void textEditor_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) {
+      if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) controlHeld = true;
+    }
+
+    private void textEditor_KeyUp(object sender, KeyEventArgs e) {
+      controlHeld = false;
+    }
+
+    internal void SetLexError(string msg, int line, int col) {
+      errorLineTransformer.MarkLexError(msg, line, col);
+      textEditor.InvalidateVisual();
+    }
+
+    internal void SetSynError(string msg, int line, int col) {
+      errorLineTransformer.MarkSynError(msg, line, col);
+      textEditor.InvalidateVisual();
+    }
+
+    internal void ClearErrors() {
+      errorLineTransformer.ClearErrors();
+      textEditor.InvalidateVisual();
+    }
+
+    private void textEditor_PreviewMouseWheel(object sender, MouseWheelEventArgs e) {
+      if (!controlHeld) return;
+      if (e.Delta > 0)
+        textEditor.FontSize += 1;
+      else textEditor.FontSize -= 1;
+      e.Handled = true;
+    }
+  }
+}
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/ColorizeErrors.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/ColorizeErrors.cs	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/ColorizeErrors.cs	(revision 9674)
@@ -0,0 +1,126 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Shapes;
+using ICSharpCode.AvalonEdit.Document;
+using ICSharpCode.AvalonEdit.Rendering;
+
+namespace HeuristicLab.Problems.GPDL.Views {
+  public class ColorizeErrors : DocumentColorizingTransformer {
+    private Dictionary<int, string> synErrors = new Dictionary<int, string>();
+    private Dictionary<int, string> lexErrors = new Dictionary<int, string>();
+
+    protected override void ColorizeLine(DocumentLine line) {
+      if (lexErrors.ContainsKey(line.LineNumber)) {
+        ChangeLinePart(line.Offset, line.Offset + line.Length, ChangeLexError);
+      } else if (synErrors.ContainsKey(line.LineNumber)) {
+        ChangeLinePart(line.Offset, line.Offset + line.Length, ChangeSynError);
+      }
+      //int lineStartOffset = line.Offset;
+      //string text = CurrentContext.Document.GetText(line);
+      //int start = 0;
+      //int index;
+      //while ((index = text.IndexOf("AvalonEdit", start)) >= 0) {
+      //  base.ChangeLinePart(
+      //    lineStartOffset + index, // startOffset
+      //    lineStartOffset + index + 10, // endOffset
+      //    (VisualLineElement element) => {
+      //      // This lambda gets called once for every VisualLineElement
+      //      // between the specified offsets.
+      //      Typeface tf = element.TextRunProperties.Typeface;
+      //      // Replace the typeface with a modified version of
+      //      // the same typeface
+      //      element.TextRunProperties.SetTypeface(new Typeface(
+      //        tf.FontFamily,
+      //        FontStyles.Italic,
+      //        FontWeights.Bold,
+      //        tf.Stretch
+      //      ));
+      //    });
+      //  start = index + 1; // search for next occurrence
+      //}
+    }
+
+    private void ChangeSynError(VisualLineElement element) {
+
+
+      var wigglePath = new Path();
+      wigglePath.Data = Geometry.Parse("M 0,1 C 1,0 2,2 3,1");
+      wigglePath.Stroke = Brushes.Red;
+      wigglePath.StrokeThickness = 0.2;
+      wigglePath.StrokeEndLineCap = PenLineCap.Square;
+      wigglePath.StrokeStartLineCap = PenLineCap.Square;
+
+      var wigglyBrush = new VisualBrush();
+      wigglyBrush.Viewbox = new Rect(0, 0, 3, 2);
+      wigglyBrush.ViewboxUnits = BrushMappingMode.Absolute;
+      wigglyBrush.Viewport = new Rect(0, 0.8, 6, 4);
+      wigglyBrush.ViewportUnits = BrushMappingMode.Absolute;
+      wigglyBrush.TileMode = TileMode.Tile;
+      wigglyBrush.Visual = wigglePath;
+
+
+      var wigglyPen = new Pen(wigglyBrush, 6.0);
+      var decorations = new TextDecorationCollection();
+      decorations.Add(new TextDecoration(0, wigglyPen, 0, TextDecorationUnit.Pixel, TextDecorationUnit.Pixel));
+      element.TextRunProperties.SetTextDecorations(decorations);
+      //element.TextRunProperties.SetTypeface(new Typeface(
+      //  tf.FontFamily,
+      //  FontStyles.Italic,
+      //  FontWeights.Bold,
+      //  tf.Stretch
+      //));
+    }
+
+    private void ChangeLexError(VisualLineElement element) {
+
+      var wigglePath = new Path();
+      wigglePath.Data = Geometry.Parse("M 0,1 C 1,0 2,2 3,1");
+      wigglePath.Stroke = Brushes.Red;
+      wigglePath.StrokeThickness = 0.2;
+      wigglePath.StrokeEndLineCap = PenLineCap.Square;
+      wigglePath.StrokeStartLineCap = PenLineCap.Square;
+
+      var wigglyBrush = new VisualBrush();
+      wigglyBrush.Viewbox = new Rect(0, 0, 3, 2);
+      wigglyBrush.ViewboxUnits = BrushMappingMode.Absolute;
+      wigglyBrush.Viewport = new Rect(0, 0.8, 6, 4);
+      wigglyBrush.ViewportUnits = BrushMappingMode.Absolute;
+      wigglyBrush.TileMode = TileMode.Tile;
+      wigglyBrush.Visual = wigglePath;
+
+
+      var wigglyPen = new Pen(wigglyBrush, 6.0);
+      var decorations = new TextDecorationCollection();
+      decorations.Add(new TextDecoration(0, wigglyPen, 0, TextDecorationUnit.Pixel, TextDecorationUnit.Pixel));
+      element.TextRunProperties.SetTextDecorations(decorations);
+
+      //element.TextRunProperties.SetTypeface(new Typeface(
+      //  tf.FontFamily,
+      //  FontStyles.Italic,
+      //  FontWeights.Bold,
+      //  tf.Stretch
+      //));
+    }
+
+    internal void MarkSynError(string msg, int line, int col) {
+      if (!synErrors.ContainsKey(line)) {
+        synErrors.Add(line, msg);
+      }
+    }
+
+    internal void MarkLexError(string msg, int line, int col) {
+      if (!lexErrors.ContainsKey(line)) {
+        lexErrors.Add(line, msg);
+      }
+    }
+
+    internal void ClearErrors() {
+      synErrors.Clear();
+      lexErrors.Clear();
+    }
+  }
+}
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlCompletionData.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlCompletionData.cs	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlCompletionData.cs	(revision 9674)
@@ -0,0 +1,36 @@
+﻿using System;
+using ICSharpCode.AvalonEdit.CodeCompletion;
+using ICSharpCode.AvalonEdit.Document;
+using ICSharpCode.AvalonEdit.Editing;
+
+namespace HeuristicLab.Problems.GPDL.Views {
+  /// Implements AvalonEdit ICompletionData interface to provide the entries in the
+  /// completion drop down.
+  public class MyCompletionData : ICompletionData {
+    public MyCompletionData(string text) {
+      this.Text = text;
+    }
+
+    public System.Windows.Media.ImageSource Image {
+      get { return null; }
+    }
+
+    public string Text { get; private set; }
+
+    // Use this property if you want to show a fancy UIElement in the list.
+    public object Content {
+      get { return this.Text; }
+    }
+
+    public object Description {
+      get { return "Description for " + this.Text; }
+    }
+
+    public double Priority { get; private set; }
+
+    public void Complete(TextArea textArea, ISegment completionSegment,
+        EventArgs insertionRequestEventArgs) {
+      textArea.Document.Replace(completionSegment, this.Text);
+    }
+  }
+}
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.Designer.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.Designer.cs	(revision 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.Designer.cs	(revision 9674)
@@ -28,7 +28,8 @@
     private void InitializeComponent() {
       this.compileButton = new System.Windows.Forms.Button();
-      this.gpdlTextBox = new System.Windows.Forms.TextBox();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.elementHost = new System.Windows.Forms.Integration.ElementHost();
+      this.codeEditor = new HeuristicLab.Problems.GPDL.Views.CodeEditor();
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
       this.splitContainer.Panel1.SuspendLayout();
@@ -48,19 +49,4 @@
       this.compileButton.Click += new System.EventHandler(this.compileButton_Click);
       // 
-      // gpdlTextBox
-      // 
-      this.gpdlTextBox.AcceptsReturn = true;
-      this.gpdlTextBox.AcceptsTab = true;
-      this.gpdlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.gpdlTextBox.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-      this.gpdlTextBox.Location = new System.Drawing.Point(3, 3);
-      this.gpdlTextBox.Multiline = true;
-      this.gpdlTextBox.Name = "gpdlTextBox";
-      this.gpdlTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
-      this.gpdlTextBox.Size = new System.Drawing.Size(655, 422);
-      this.gpdlTextBox.TabIndex = 1;
-      // 
       // splitContainer
       // 
@@ -77,6 +63,6 @@
       // splitContainer.Panel2
       // 
+      this.splitContainer.Panel2.Controls.Add(this.elementHost);
       this.splitContainer.Panel2.Controls.Add(this.compileButton);
-      this.splitContainer.Panel2.Controls.Add(this.gpdlTextBox);
       this.splitContainer.Size = new System.Drawing.Size(661, 487);
       this.splitContainer.SplitterDistance = 26;
@@ -97,4 +83,16 @@
       this.viewHost.ViewType = null;
       // 
+      // elementHost
+      // 
+      this.elementHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.elementHost.Location = new System.Drawing.Point(0, 0);
+      this.elementHost.Name = "elementHost";
+      this.elementHost.Size = new System.Drawing.Size(661, 425);
+      this.elementHost.TabIndex = 2;
+      this.elementHost.Text = "elementHost2";
+      this.elementHost.Child = this.codeEditor;
+      // 
       // GpdlEditor
       // 
@@ -106,5 +104,4 @@
       this.splitContainer.Panel1.ResumeLayout(false);
       this.splitContainer.Panel2.ResumeLayout(false);
-      this.splitContainer.Panel2.PerformLayout();
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
       this.splitContainer.ResumeLayout(false);
@@ -117,6 +114,7 @@
     private ViewHost viewHost;
     private System.Windows.Forms.Button compileButton;
-    private System.Windows.Forms.TextBox gpdlTextBox;
     private System.Windows.Forms.SplitContainer splitContainer;
+    private System.Windows.Forms.Integration.ElementHost elementHost;
+    private CodeEditor codeEditor;
   }
 }
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.cs	(revision 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.cs	(revision 9674)
@@ -19,11 +19,11 @@
 
     private void compileButton_Click(object sender, EventArgs e) {
-      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("Utils", Utils.UtilsMethod);
+      Utils.InstallModule("Sets", Sets.SetsMethod);
+      Utils.InstallModule("Errors", 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));
+      Utils.InstallModule("GPDefLex", GPDefLex.GPDefLexMethod);
+      Utils.InstallModule("GPDefSem", GPDefSem.GPDefSemMethod);
+      Utils.InstallModule("GPDefSyn", GPDefSyn.GPDefSynMethod);
 
       // --- initialize modules ---
@@ -32,13 +32,28 @@
       Errors.PushAbortMethod(new Errors.AbortMethod(Abort));
 
-      using (var src = new StringReader(gpdlTextBox.Text)) {
+      using (var src = new StringReader(codeEditor.textEditor.Text)) {
         GPDefLex.src = src;
         GPDefSyn.Parse();
       }
 
-      GPDefLex.InitLex();
-      GPDefSyn.Interpret();
+      codeEditor.ClearErrors();
 
-      MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem);
+      if (Errors.NumOfErrors() == 0) {
+        GPDefLex.InitLex();
+        GPDefSyn.Interpret();
+
+        MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem);
+      } else {
+        int nLexErrors = Errors.NumOfLexErrors();
+        for (int i = 0; i < nLexErrors; i++) {
+          var lexErr = Errors.GetLexError(i == 0);
+          codeEditor.SetLexError(lexErr.msg, lexErr.line, lexErr.col);
+        }
+        int nSynErrors = Errors.NumOfSynErrors();
+        for (int i = 0; i < nSynErrors; i++) {
+          var synErr = Errors.GetSynError(i == 0);
+          codeEditor.SetLexError(synErr.msg, synErr.line, synErr.col);
+        }
+      }
     }
 
@@ -48,7 +63,6 @@
 
     void IProblemInstanceConsumer<string>.Load(string data) {
-      this.gpdlTextBox.Text = data;
+      codeEditor.textEditor.Text = data;
     }
-
   }
 }
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 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/HeuristicLab.Problems.GPDL.Views-3.4.csproj	(revision 9674)
@@ -143,4 +143,11 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="ICSharpCode.AvalonEdit, Version=4.3.1.9430, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>.\ICSharpCode.AvalonEdit.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
     <Reference Include="System" />
     <Reference Include="System.Core">
@@ -150,4 +157,5 @@
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Windows.Forms.DataVisualization" />
+    <Reference Include="System.Xaml" />
     <Reference Include="System.Xml.Linq">
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -158,6 +166,13 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
+    <Reference Include="WindowsBase" />
+    <Reference Include="WindowsFormsIntegration" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CodeEditor.xaml.cs">
+      <DependentUpon>CodeEditor.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ColorizeErrors.cs" />
+    <Compile Include="GpdlCompletionData.cs" />
     <Compile Include="GpdlProblemInstanceConsumerView.cs">
       <SubType>UserControl</SubType>
@@ -182,4 +197,7 @@
     <None Include="Plugin.cs.frame" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
+    <None Include="SyntaxDefinition.xsd">
+      <SubType>Designer</SubType>
+    </None>
   </ItemGroup>
   <ItemGroup>
@@ -219,4 +237,5 @@
   </ItemGroup>
   <ItemGroup>
+    <None Include="Resources\GPDL.xshd" />
     <None Include="Resources\multi-output-multiplier.txt" />
   </ItemGroup>
@@ -233,4 +252,15 @@
       <Private>False</Private>
     </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Page Include="CodeEditor.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="ICSharpCode.AvalonEdit.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
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 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Plugin.cs.frame	(revision 9674)
@@ -28,4 +28,5 @@
   [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)]
+  [PluginFile("ICSharpCode.AvalonEdit.dll", PluginFileType.Assembly)]
   public class Plugin : PluginBase {
   }
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.Designer.cs
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.Designer.cs	(revision 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.Designer.cs	(revision 9674)
@@ -146,4 +146,26 @@
         
         /// <summary>
+        ///   Looks up a localized string similar to &lt;!-- Syntax definition of GPDL for Avalonedit syntax highlighting --&gt;
+        ///&lt;SyntaxDefinition name=&quot;GPDL&quot;
+        ///        xmlns=&quot;http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008&quot;&gt;
+        ///  &lt;Color name=&quot;Comment&quot; foreground=&quot;Green&quot; /&gt;
+        ///  &lt;Color name=&quot;String&quot; foreground=&quot;Blue&quot; /&gt;
+        ///
+        ///  &lt;!-- This is the main ruleset. --&gt;
+        ///  &lt;RuleSet&gt;
+        ///    &lt;Span color=&quot;Comment&quot; multiline=&quot;true&quot; nested=&quot;true&quot;
+        ///       begin=&quot;/\*&quot; end=&quot;\*/&quot; /&gt;
+        ///
+        ///    &lt;Span color=&quot;SourceCode&quot; multiline=&quot;true&quot;
+        ///       begin=&quot;&amp;lt;&amp;lt;&quot; end=&quot;&amp;gt;&amp;gt;&quot; /&gt;
+        ///    &lt;K [rest of string was truncated]&quot;;.
+        /// </summary>
+        internal static string GPDL {
+            get {
+                return ResourceManager.GetString("GPDL", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to PROBLEM MultiOutputMultiplier
         ///
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.resx
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.resx	(revision 9673)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.resx	(revision 9674)
@@ -128,4 +128,7 @@
     <value>..\Resources\Fib.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
   </data>
+  <data name="GPDL" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\GPDL.xshd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
   <data name="multi_output_multiplier" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\multi-output-multiplier.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/GPDL.xshd
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/GPDL.xshd	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Resources/GPDL.xshd	(revision 9674)
@@ -0,0 +1,130 @@
+﻿<!-- Syntax definition of GPDL for AvalonEdit syntax highlighting -->
+<SyntaxDefinition name="GPDL"
+        xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
+  <Color name="Comment" foreground="Green" />
+  <Color name="SourceCode" foreground="SlateGray" />
+
+  <!-- This is the main ruleset. -->
+  <RuleSet ignoreCase="true">
+    <Span color="Comment" multiline="true" begin="/\*" end="\*/" />
+    <Span color="SourceCode" multiline="true" begin="&lt;&lt;" end="&gt;&gt;">
+      <RuleSet>
+        <Span color="Comment" multiline="true" begin="/\*" end="\*/" />
+        <Span color="Comment" multiline="false" begin="//" />
+        <Keywords fontWeight="bold" foreground="Blue">
+          <!-- reduced set of allowed C# keywords -->
+          <Word>abstract</Word>
+          <Word>as</Word>
+          <Word>base</Word>
+          <Word>bool</Word>
+          <Word>break</Word>
+          <Word>byte</Word>
+          <Word>case</Word>
+          <Word>catch</Word>
+          <Word>char</Word>
+          <Word>checked</Word>
+          <Word>class</Word>
+          <Word>const</Word>
+          <Word>continue</Word>
+          <Word>decimal</Word>
+          <Word>default</Word>
+          <Word>delegate</Word>
+          <Word>do</Word>
+          <Word>double</Word>
+          <Word>else</Word>
+          <Word>enum</Word>
+          <Word>event</Word>
+          <Word>explicit</Word>
+          <Word>extern</Word>
+          <Word>false</Word>
+          <Word>finally</Word>
+          <Word>fixed</Word>
+          <Word>float</Word>
+          <Word>for</Word>
+          <Word>foreach</Word>
+          <Word>goto</Word>
+          <Word>if</Word>
+          <Word>implicit</Word>
+          <Word>in</Word>
+          <Word>int</Word>
+          <Word>interface</Word>
+          <Word>internal</Word>
+          <Word>is</Word>
+          <Word>lock</Word>
+          <Word>long</Word>
+          <Word>new</Word>
+          <Word>null</Word>
+          <Word>object</Word>
+          <Word>operator</Word>
+          <Word>out</Word>
+          <Word>override</Word>
+          <Word>params</Word>
+          <Word>private</Word>
+          <Word>protected</Word>
+          <Word>public</Word>
+          <Word>readonly</Word>
+          <Word>ref</Word>
+          <Word>return</Word>
+          <Word>sbyte</Word>
+          <Word>sealed</Word>
+          <Word>short</Word>
+          <Word>sizeof</Word>
+          <Word>stackalloc</Word>
+          <Word>static</Word>
+          <Word>string</Word>
+          <Word>struct</Word>
+          <Word>switch</Word>
+          <Word>this</Word>
+          <Word>throw</Word>
+          <Word>true</Word>
+          <Word>try</Word>
+          <Word>typeof</Word>
+          <Word>uint</Word>
+          <Word>ulong</Word>
+          <Word>unchecked</Word>
+          <Word>unsafe</Word>
+          <Word>ushort</Word>
+          <Word>using</Word>
+          <Word>virtual</Word>
+          <Word>volatile</Word>
+          <Word>void</Word>
+          <Word>while</Word>
+          <!-- GPDL beginning/end of C# source -->
+          <Word>&lt;&lt;</Word>
+          <Word>&gt;&gt;</Word>
+        </Keywords>
+      </RuleSet>
+    </Span>
+    <Keywords fontWeight="bold" foreground="Blue" >
+      <Word>PROBLEM</Word>
+      <Word>END</Word>
+      <Word>EPS</Word>
+      <Word>LOCAL</Word>
+      <Word>NONTERMINALS</Word>
+      <Word>RULES</Word>
+      <Word>SEM</Word>
+      <Word>MAXIMIZE</Word>
+      <Word>MINIMIZE</Word>
+      <Word>TERMINALS</Word>
+      <Word>CONSTRAINTS</Word>
+      <Word>INIT</Word>
+      <Word>CODE</Word>
+      <Word>IN</Word>
+      <Word>SET</Word>
+      <Word>RANGE</Word>
+      <Word>.</Word>
+    </Keywords>
+
+    <!-- Digits -->
+    <!--
+    <Rule foreground="DarkBlue">
+      \b0[xX][0-9a-fA-F]+  # hex number
+      |    \b
+      (    \d+(\.[0-9]+)?   #number with optional floating point
+      |    \.[0-9]+         #or just starting with floating point
+      )
+      ([eE][+-]?[0-9]+)? # optional exponent
+    </Rule>
+    -->
+  </RuleSet>
+</SyntaxDefinition>
Index: /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/SyntaxDefinition.xsd
===================================================================
--- /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/SyntaxDefinition.xsd	(revision 9674)
+++ /branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/SyntaxDefinition.xsd	(revision 9674)
@@ -0,0 +1,167 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema version="2" elementFormDefault="qualified" targetNamespace="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <!-- Font Weight -->
+  <xsd:simpleType name="FontWeight">
+    <xsd:union>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:integer">
+          <xsd:minInclusive value="1"/>
+          <xsd:maxInclusive value="999"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:string">
+          <xsd:enumeration value="bold"/>
+          <xsd:enumeration value="normal"/>
+          <xsd:enumeration value="regular"/>
+          <!-- should we support other font weight names? -->
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:union>
+  </xsd:simpleType>
+
+  <!-- Font Style -->
+  <xsd:simpleType name="FontStyle">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="italic"/>
+      <xsd:enumeration value="normal"/>
+      <xsd:enumeration value="oblique"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- Color -->
+  <xsd:attributeGroup name="ColorAttributes">
+    <xsd:attribute name="foreground" type="xsd:string" use="optional" />
+    <xsd:attribute name="background" type="xsd:string" use="optional" />
+    <xsd:attribute name="fontWeight" type="FontWeight" use="optional" />
+    <xsd:attribute name="fontStyle" type="FontStyle" use="optional" />
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:attributeGroup>
+
+  <xsd:attributeGroup name="ColorReferenceAttributes">
+    <xsd:attributeGroup ref="ColorAttributes" />
+    <xsd:attribute name="color" type="xsd:string" use="optional" />
+  </xsd:attributeGroup>
+
+  <xsd:element name="Color">
+    <xsd:complexType>
+      <xsd:attribute name="name" type="xsd:string" use="required" />
+      <xsd:attribute name="exampleText" type="xsd:string" use="optional" />
+      <xsd:attributeGroup ref="ColorAttributes"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="Property">
+    <xsd:complexType>
+      <xsd:attribute name="name" type="xsd:string" use="required" />
+      <xsd:attribute name="value" type="xsd:string" use="required" />
+      <xsd:anyAttribute namespace="##other" processContents="lax" />
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Regular expression -->
+  <xsd:simpleType name="regex">
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="regexIgnorePatternWhitespace">
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+  <!-- Keywords -->
+  <xsd:element name="Keywords">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="Word" minOccurs="1" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attributeGroup ref="ColorReferenceAttributes"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="Word">
+    <xsd:complexType>
+      <xsd:simpleContent>
+        <xsd:extension base="xsd:string">
+          <xsd:anyAttribute namespace="##other" processContents="lax" />
+        </xsd:extension>
+      </xsd:simpleContent>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Spans -->
+  <xsd:element name="Span">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="Begin" minOccurs="0" maxOccurs="1"/>
+        <xsd:element ref="End" minOccurs="0" maxOccurs="1"/>
+        <xsd:element ref="RuleSet" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+
+      <xsd:attributeGroup ref="ColorReferenceAttributes"/>
+      <xsd:attribute name="multiline" type="xsd:boolean" use="optional"/>
+      <xsd:attribute name="ruleSet" type="xsd:string" use="optional"/>
+      <xsd:attribute name="begin" type="regex" use="optional"/>
+      <xsd:attribute name="end" type="regex" use="optional"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <xsd:complexType name="SpanBeginEnd">
+    <xsd:simpleContent>
+      <xsd:extension base="regexIgnorePatternWhitespace">
+        <xsd:attributeGroup ref="ColorReferenceAttributes"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+  <xsd:element name="Begin" type="SpanBeginEnd"/>
+  <xsd:element name="End" type="SpanBeginEnd"/>
+
+  <!-- Imports -->
+  <xsd:element name="Import">
+    <xsd:complexType>
+      <xsd:attribute name="ruleSet" type="xsd:string" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Rules -->
+  <xsd:element name="Rule">
+    <xsd:complexType>
+      <xsd:simpleContent>
+        <xsd:extension base="regexIgnorePatternWhitespace">
+          <xsd:attributeGroup ref="ColorReferenceAttributes"/>
+        </xsd:extension>
+      </xsd:simpleContent>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Rule set -->
+  <xsd:element name="RuleSet">
+    <xsd:complexType>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+        <xsd:element ref="Keywords"/>
+        <xsd:element ref="Span"/>
+        <xsd:element ref="Import"/>
+        <xsd:element ref="Rule"/>
+        <xsd:any namespace="##other" processContents="lax" />
+      </xsd:choice>
+      <xsd:attribute name="name" type="xsd:string" use="optional" />
+      <xsd:attribute name="ignoreCase" type="xsd:boolean" use="optional" />
+      <xsd:anyAttribute namespace="##other" processContents="lax" />
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- Main syntax definition -->
+  <xsd:element name="SyntaxDefinition">
+    <xsd:complexType>
+      <xsd:choice minOccurs="1" maxOccurs="unbounded">
+        <xsd:element ref="Property"/>
+        <xsd:element ref="Color"/>
+        <xsd:element ref="RuleSet"/>
+        <xsd:any namespace="##other" processContents="lax" />
+      </xsd:choice>
+      <xsd:attribute name="name" type="xsd:string" use="optional" />
+      <xsd:attribute name="extensions" type="xsd:string" use="optional" />
+      <xsd:anyAttribute namespace="##other" processContents="lax" />
+    </xsd:complexType>
+  </xsd:element>
+</xsd:schema>
