1 package net.sourceforge.phpeclipse.editors;
3 import org.eclipse.jface.text.*;
5 import org.eclipse.jface.text.rules.*;
7 public class PHPTagScanner extends RuleBasedScanner {
9 public PHPTagScanner(ColorManager manager) {
12 new TextAttribute(manager.getColor(IPHPColorConstants.STRING)));
14 Vector rules = new Vector();
16 // Add rule for single and double quotes
17 rules.add(new SingleLineRule("\"", "\"", string, '\\'));
18 rules.add(new SingleLineRule("'", "'", string, '\\'));
20 // Add generic whitespace rule.
21 rules.add(new WhitespaceRule(new WhitespaceDetector()));
23 IRule[] result = new IRule[rules.size()];
24 rules.copyInto(result);
27 public IToken nextToken() {
28 return super.nextToken();