}
public static void add(final Rule rule, final Type type, ITokenFactory factory, final List rules) {
final IToken token = factory.makeToken(type);
final Mode mode = rule.getMode();
final boolean ignoreCase = rule.getIgnoreCase();
type.accept(new IVisitor() {
public void acceptSpan(Span span) {
IToken defaultToken = token;
if(span.hasDelegate()) {
Rule delegateRule = mode.getRule(span.getDelegate());
defaultToken = new DelegateToken(type, delegateRule, span.getEnd());