.getState(newTokenOffset);
final LexerState endState = tokensContaier.getState(tokenEnd
.getEnd() + 1);
final PhpTokenContainer newContainer = new PhpTokenContainer();
final AbstractPhpLexer phpLexer = getPhpLexer(
new DocumentReader(flatnode, changes, requestStart,
lengthToReplace, newTokenOffset), startState);
Object state = startState;
try {
String yylex = phpLexer.getNextToken();
if (shouldDeprecatedKeyword
&& PhpTokenContainer.isKeyword(yylex)) {
yylex = PHPRegionTypes.PHP_STRING;
}
int yylength;
final int toOffset = offset + length;
while (yylex != null && newTokenOffset <= toOffset
&& yylex != PHPRegionTypes.PHP_CLOSETAG) {
yylength = phpLexer.getLength();
newContainer.addLast(yylex, newTokenOffset, yylength,
yylength, state);
newTokenOffset += yylength;
state = phpLexer.createLexicalStateMemento();
yylex = phpLexer.getNextToken();
}
if (yylex == PHPRegionTypes.WHITESPACE) {
yylength = phpLexer.getLength();
newContainer.adjustWhitespace(yylex, newTokenOffset,
yylength, yylength, state);
}
} catch (IOException e) {
Logger.logException(e);