gt: 						isDocString = areas.isInCommentBlock(rowIndex);
context: ///////////////////////////////////////////////////////////////////////////////
  //
  // PACKAGE   : com.astra.ses.spell.gui.presentation.code.syntax
  // 
  // FILE      : SyntaxParser.java
  //
  // DATE      : 2008-11-21 08:55
  //
  // Copyright (C) 2008, 2015 SES ENGINEERING, Luxembourg S.A.R.L.
  //
  // By using this software in any way, you are agreeing to be bound by
  // the terms of this license.
  //
  // All rights reserved. This program and the accompanying materials
  // are made available under the terms of the Eclipse Public License v1.0
  // which accompanies this distribution, and is available at
  // http://www.eclipse.org/legal/epl-v10.html
  //
  // NO WARRANTY
  // EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
  // ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
  // EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
  // CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
  // PARTICULAR PURPOSE. Each Recipient is solely responsible for determining
  // the appropriateness of using and distributing the Program and assumes all
  // risks associated with its exercise of rights under this Agreement ,
  // including but not limited to the risks and costs of program errors,
  // compliance with applicable laws, damage to or loss of data, programs or
  // equipment, and unavailability or interruption of operations.
  //
  // DISCLAIMER OF LIABILITY
  // EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
  // CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
  // LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  // ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
  // EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
  // POSSIBILITY OF SUCH DAMAGES.
  //
  // Contributors:
  //    SES ENGINEERING - initial API and implementation and/or initial documentation
  //
  // PROJECT   : SPELL
  //
  // SUBPROJECT: SPELL GUI Client
  //
  ///////////////////////////////////////////////////////////////////////////////
  package com.astra.ses.spell.gui.presentation.code.syntax;
  
  import java.util.Map;
  import java.util.TreeMap;
  import java.util.Vector;
  
  import org.eclipse.swt.graphics.TextLayout;
  import org.eclipse.swt.graphics.TextStyle;
  
  import com.astra.ses.spell.gui.core.model.types.Level;
  import com.astra.ses.spell.gui.core.utils.Logger;
  import com.astra.ses.spell.language.SpellProgrammingLanguage;
  
  import de.susebox.jtopas.Flags;
  import de.susebox.jtopas.StandardTokenizer;
  import de.susebox.jtopas.StandardTokenizerProperties;
  import de.susebox.jtopas.StringSource;
  import de.susebox.jtopas.Token;
  import de.susebox.jtopas.TokenizerException;
  import de.susebox.jtopas.TokenizerProperties;
  
  /*******************************************************************************
   * @brief Source code parser based on JTOPAS package. Implements a basic token
   *        recognition algorithm for SPELL. Requires JTOPAS runtime package.
   * @date 27/03/08
   ******************************************************************************/
  public class SyntaxParser implements ISyntaxParser
  {
  	// =========================================================================
  	// # STATIC DATA MEMBERS
  	// =========================================================================
  
  	// PRIVATE -----------------------------------------------------------------
  	// PROTECTED ---------------------------------------------------------------
  	// PUBLIC ------------------------------------------------------------------
  
  	// =========================================================================
  	// # INSTANCE DATA MEMBERS
  	// =========================================================================
  
  	// PRIVATE -----------------------------------------------------------------
  	/** Currently configured scheme */
  	private IStyleScheme m_scheme = null;
  	// PROTECTED ---------------------------------------------------------------
  	/** Holds the list of defined functions */
  	protected Vector<String> m_listFunctions;
  	/** Holds the list of defined critical functions */
  	protected Vector<String> m_listCriticalFunctions;
  	/** Holds the list of defined modifiers */
  	protected Vector<String> m_listModifiers;
  	/** Holds the list of defined constants */
  	protected Vector<String> m_listConstants;
  	/** Holds the list of defined language keywords */
  	protected Vector<String> m_listKeywords;
  	/** Holds the list of defined language entities */
  	protected Vector<String> m_listEntities;
  	/** Holds the JTOPAS tokenizer configuration */
  	protected TokenizerProperties m_properties = null;
  	/** Holds the map of syntax-relevant areas */
  	protected Map<String, ISyntaxAreas> m_syntaxAreas;
  	/** Holds the current code id */
  	protected String m_currentCodeId;
  
  	// PUBLIC ------------------------------------------------------------------
  
  	// =========================================================================
  	// # INNER CLASSES
  	// =========================================================================
  
  	/***************************************************************************
  	 * Holds the applicability range for a text style
  	 **************************************************************************/
  	private class Range
  	{
  		/** Start position */
  		int start;
  		/** End position */
  		int end;
  	}
  
  	// =========================================================================
  	// # ACCESSIBLE METHODS
  	// =========================================================================
  
  	/***************************************************************************
  	 * Constructor
  	 * 
  	 * @param scheme
  	 *            Initial color scheme
  	 **************************************************************************/
  	public SyntaxParser(IStyleScheme scheme)
  	{
  		Logger.debug("Reading word list", Level.GUI, this);
  		m_listFunctions = new Vector<String>();
  		m_listCriticalFunctions = new Vector<String>();
  		m_listModifiers = new Vector<String>();
  		m_listConstants = new Vector<String>();
  		m_listKeywords = new Vector<String>();
  		m_listEntities = new Vector<String>();
  
  		String[] functions = SpellProgrammingLanguage.getInstance().getSpellFunctions();
  		for (String f : functions)
  		{
  			if (SpellProgrammingLanguage.getInstance().isCriticalFunction(f))
  			{
  				m_listCriticalFunctions.addElement(f);
  			}
  			m_listFunctions.addElement(f);
  		}
  
  
  		String[] modifiers = SpellProgrammingLanguage.getInstance().getSpellModifiers();
  		for (String m : modifiers)
  			m_listModifiers.addElement(m);
  		
  		String[] keywords = SpellProgrammingLanguage.getInstance().getSpellKeywords();
  		for (String l : keywords)
  			m_listKeywords.addElement(l);
  		
  		String[] constants = SpellProgrammingLanguage.getInstance().getSpellConstants();
  		for (String c : constants)
  			m_listConstants.addElement(c);
  		
  		String[] entities = SpellProgrammingLanguage.getInstance().getSpellEntities();
  		for (String e : entities)
  			m_listEntities.addElement(e);
  		
  		Logger.debug("Word list read", Level.GUI, this);
  		m_scheme = scheme;
  		m_syntaxAreas = new TreeMap<String, ISyntaxAreas>();
  		m_currentCodeId = null;
  		// Configure the JTOPAS tokenizer to recognise SPELL
  		configureTokenizer();
  	}
  
  	/*
  	 * (non-Javadoc)
  	 * 
  	 * @see
  	 * com.astra.ses.spell.gui.presentation.code.syntax.ISyntaxParser#parseSyntax
  	 * (org.eclipse.swt.graphics.TextLayout, int)
  	 */
  	@Override
  	public void parseSyntax(TextLayout layout, int rowIndex, boolean selected, boolean highlighted )
  	{
  		// Obtain the text to parse
  		String text = layout.getText();
  		// Do not process null or blank text
  		if (text == null || text.length() == 0)
  			return;
  		// Default style
  		
  		if (selected)
  		{
  			layout.setStyle(m_scheme.getSelectedStyle(), 0, text.length());
  			return;
  		}
  		else if (highlighted)
  		{
  			layout.setStyle(m_scheme.getHighlightedStyle(), 0, text.length());
  			return;
  		}
  		else
  		{
  			layout.setStyle(m_scheme.getDefaultStyle(), 0, text.length());
  		}
  
  		// Create a source for the tokenizer with the text
  		StringSource source = new StringSource(text);
  		// Create the tokenizer using the current configuration
  		StandardTokenizer tokenizer = new StandardTokenizer(m_properties);
  		// Assign the source
  		tokenizer.setSource(source);
  		try
  		{
  			// For each token recognised in the text
  			while (tokenizer.hasMoreToken())
  			{
  				Token token = tokenizer.nextToken();
  				int type = token.getType();
  				// This is the token text
  				String word = tokenizer.currentImage();
  				// When the image is null, we are processing EOL
  				if (word == null)
  					break;
  				boolean isDocStringTag1 = (type == Token.SPECIAL_SEQUENCE && word.equals("\"\"\""));
  				boolean isDocStringTag2 = (type == Token.SPECIAL_SEQUENCE && word.equals("'''"));
  				boolean isDocString = false;
  				if (m_currentCodeId != null)
  				{
  					ISyntaxAreas areas = m_syntaxAreas.get(m_currentCodeId);
  					if (areas != null)
  					{
  