package net.sourceforge.phpeclipse.editors; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.rules.*; public class PHPPartitionScanner extends RuleBasedPartitionScanner { public final static String HTML_COMMENT = "__html_comment"; public final static String HTML_TAG = "__tag"; public final static String PHP_COMMENT = "__php_comment"; public final static String PHP_STRING = "__php_string"; public PHPPartitionScanner() { List rules = new ArrayList(); IToken php_tag = new Token(HTML_TAG); IToken php_comment = new Token(PHP_COMMENT); IToken html_comment = new Token(HTML_COMMENT); rules.add(new MultiLineRule("", html_comment)); rules.add(new MultiLineRule("/*", "*/", php_comment)); rules.add(new MultiLineRule("", php_tag)); // rules.add(new TagRule(tag)); IPredicateRule[] result = new IPredicateRule[rules.size()]; rules.toArray(result); setPredicateRules(result); } }