Class ProfilingParseRunner<V>

  • Type Parameters:
    V -
    All Implemented Interfaces:
    MatchHandler, ParseRunner<V>

    public class ProfilingParseRunner<V>
    extends AbstractParseRunner<V>
    implements MatchHandler

    The ProfilingParseRunner is a special ParseRunner implementation that "watches" a parser digest a number of inputs and collects all sorts of statistical data on the what rules have matched how many times, the number of reincovations of rules at identical input locations, and so on.

    The ProfilingParseRunner is typically used during parser debugging and optimization, not in production.

    • Constructor Detail

      • ProfilingParseRunner

        public ProfilingParseRunner​(Rule rule)
        Creates a new ProfilingParseRunner instance for the given rule.
        Parameters:
        rule - the parser rule
    • Method Detail

      • run

        public ParsingResult<V> run​(InputBuffer inputBuffer)
        Description copied from interface: ParseRunner
        Performs the actual parse and creates a corresponding ParsingResult instance.
        Specified by:
        run in interface ParseRunner<V>
        Parameters:
        inputBuffer - the inputBuffer to use
        Returns:
        the ParsingResult for the run
      • match

        public boolean match​(MatcherContext<?> context)
        Description copied from interface: MatchHandler
        Runs the given MatcherContext.
        Specified by:
        match in interface MatchHandler
        Parameters:
        context - the MatcherContext
        Returns:
        true if matched