/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * 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
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.data.oda.jdbc.ui.editors;

import java.util.ArrayList;

import org.eclipse.birt.report.data.oda.jdbc.ui.util.ColorManager;
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.MultiLineRule;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.Token;

/**
 * TODO: Please document
 * 
 * @version $Revision: 1.1 $ $Date: 2006/03/28 10:43:48 $
 */

public class SQLCommentScanner extends RuleBasedScanner
{

	/**
	 *  
	 */
	public SQLCommentScanner( )
	{
		super( );
		IToken sqlSingleLineComment1 = new Token( new TextAttribute( ColorManager.getColor(63, 127, 95) ) );
		IToken sqlSingleLineComment2 = new Token( new TextAttribute( ColorManager.getColor(63, 127, 95) ) );
		IToken sqlMultiLineComment = new Token( new TextAttribute( ColorManager.getColor(63, 127, 95) ) );
		ArrayList rules = new ArrayList( );
		rules.add( new EndOfLineRule( "//", sqlSingleLineComment1 ) ); //$NON-NLS-1$
		rules.add( new EndOfLineRule( "--", sqlSingleLineComment2 ) ); //$NON-NLS-1$
		rules.add( new MultiLineRule( "/*", "*/", sqlMultiLineComment ) ); //$NON-NLS-1$ //$NON-NLS-2$
		setRules( (IRule[]) rules.toArray( new IRule[rules.size( )] ) );
	}

}