// System.err.println("REGION: " + System.identityHashCode(r) + " => " + r.getOffset() + "/" + r.getLength());
if( scanner != null ) {
int lastStart= r.getOffset();
int length= 0;
boolean firstToken= true;
TextAttribute lastAttribute = null;
scanner.setRange(document, r.getOffset(), r.getLength());
while( true ) {
IToken token= scanner.nextToken();
if (token.isEOF())
break;
TextAttribute attribute = getTokenTextAttribute(token);
if (lastAttribute != null && lastAttribute.equals(attribute)) {
length += scanner.getTokenLength();
firstToken= false;
} else {
if (!firstToken) {