2 * $RCSfile: JSStringScanner.java,v $
5 * CH-1700 Fribourg, Switzerland
8 *========================================================================
9 * Modifications history
10 *========================================================================
11 * $Log: not supported by cvs2svn $
12 * Revision 1.1 2004/02/26 02:25:42 agfitzp
13 * renamed packages to match xml & css
15 * Revision 1.1 2004/02/05 03:10:08 agfitzp
18 * Revision 1.1.2.1 2003/12/12 21:37:24 agfitzp
19 * Experimental work for Classes view
21 * Revision 1.1 2003/05/28 15:17:11 agfitzp
22 * net.sourceforge.phpeclipse.js.core 0.0.1 code base
24 *========================================================================
27 package net.sourceforge.phpeclipse.js.core.parser;
29 import org.eclipse.jface.text.*;
31 import org.eclipse.jface.text.rules.*;
33 import org.eclipse.swt.graphics.Color;
39 * @author $Author: jsurfer $, $Date: 2004-09-02 18:14:38 $
41 * @version $Revision: 1.1 $
43 public class JSStringScanner extends RuleBasedScanner
46 * Creates a new JSFuncScanner object.
50 public JSStringScanner(Color aColor)
52 IToken string = new Token(new TextAttribute(aColor));
53 Vector rules = new Vector();
55 // Add rule for single and double quotes
56 rules.add(new SingleLineRule("\"", "\"", string, '\\'));
57 rules.add(new SingleLineRule("'", "'", string, '\\'));
60 // Add generic whitespace rule.
61 rules.add(new WhitespaceRule(new JSWhitespaceDetector()));
63 IRule[] result = new IRule[rules.size()];
64 rules.copyInto(result);
73 public IToken nextToken()
75 return super.nextToken();