/*
 *    Debrief - the Open Source Maritime Analysis Application
 *    http://debrief.info
 *
 *    (C) 2000-20016, PlanetMayo Ltd
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the Eclipse Public License v1.0
 *    (http://www.eclipse.org/legal/epl-v10.html)
 *
 *    This library 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. 
 */
package org.mwc.debrief.dis.editor;

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;

public class InputFileRuleScanner extends RuleBasedScanner
{
  private static Color COMMENT_COLOR = new Color(Display.getCurrent(), new RGB(
      0, 200, 0));

  public InputFileRuleScanner()
  {
    IToken commentToken = new Token(new TextAttribute(COMMENT_COLOR));

    IRule[] rules = new IRule[1];
    rules[0] = (new EndOfLineRule("//", commentToken));
    setRules(rules);
  }
}
@@ -831,24 +831,52 @@
 ules.Token;%0A
+import org.eclipse.swt.SWT;%0A
 import org.e
@@ -1131,57 +1131,370 @@
     
-0, 200, 0));%0A%0A  public InputFileRuleScanner()%0A  %7B
+63, 127, 95));%0A  private static Color BLOCK_COLOR = new Color(Display.getCurrent(), new RGB(%0A      95, 2, 8));%0A  private static Color BLOCK_BACK_COLOR = new Color(Display.getCurrent(),%0A      new RGB(195, 192, 228));%0A%0A  // the color%0A%0A  public InputFileRuleScanner()%0A  %7B%0A    // get ready for list%0A    IRule%5B%5D rules = new IRule%5B2%5D;%0A%0A    // start with comment marker
 %0A   
@@ -1515,16 +1515,24 @@
 tToken =
+%0A       
  new Tok
@@ -1569,45 +1569,213 @@
 OLOR
+, null, SWT.ITALIC
 ));%0A
-%0A
     
-IRule%5B%5D rules = new IRule%5B1%5D
+rules%5B0%5D = (new EndOfLineRule(%22//%22, commentToken));%0A%0A    // and a block token%0A    IToken blockToken =%0A        new Token(new TextAttribute(BLOCK_COLOR, BLOCK_BACK_COLOR, SWT.NONE))
 ;%0A  
@@ -1774,33 +1774,33 @@
 NE));%0A    rules%5B
-0
+1
 %5D = (new EndOfLi
@@ -1803,36 +1803,34 @@
 OfLineRule(%22
-//%22, comment
+%3C%3C%22, block
 Token));%0A   
@@ -1822,24 +1822,25 @@
 ockToken));%0A
+%0A
     setRules
@@ -1853,8 +1853,9 @@
 );%0A  %7D%0A%7D
+%0A

introduce new rule