validate(lexer);
this.parserInput.incrementDepth();
// avoid infinite loops
if (this.parserInput.getDepth() > 100) {
String topicName = (!StringUtils.isBlank(this.parserInput.getTopicName())) ? this.parserInput.getTopicName() : null;
throw new ParserException("Infinite parsing loop - over " + this.parserInput.getDepth() + " parser iterations while parsing topic " + topicName);
}
long previous, current = 0;
String line;
try {
previous = System.currentTimeMillis();
while ((line = lexer.yylex()) != null) {
lexer.append(line);
current = System.currentTimeMillis();
if ((current - previous) > 10) {
// took longer than ten milliseconds, log warning
logger.fine("WARNING: slow parsing (" + ((current - previous) / 1000.000) + " s) for input: " + lexer.yytext() + " (state: " + lexer.yystate() + ") result: " + line);
}
previous = current;
}
} catch (Exception e) {
throw new ParserException(e);
}
this.parserInput.decrementDepth();
return lexer.popAllTags();
}