public ParsingResult<V> run(InputBuffer inputBuffer) { checkArgNotNull(inputBuffer, "inputBuffer"); resetValueStack(); totalRuns++; MatcherContext<V> rootContext = createRootContext(inputBuffer, this, true); rootContext.getMatcher().accept(new DoWithMatcherVisitor(new DoWithMatcherVisitor.Action() { public void process(Matcher matcher) { RuleStats ruleStats = (RuleStats) matcher.getTag(); if (ruleStats == null) { ruleStats = new RuleStats(); matcher.setTag(ruleStats); } else { ruleStats.clear(); } } })); runMatches = 0; long timeStamp = System.nanoTime() - timeCorrection; boolean matched = rootContext.runMatcher(); totalNanoTime += System.nanoTime() - timeCorrection - timeStamp; getRootMatcher().accept(new DoWithMatcherVisitor(updateStatsAction)); return createParsingResult(matched, rootContext); }