findAllPaths method

Iterable<ParserPath> findAllPaths(
  1. Parser source,
  2. Predicate<ParserPath> predicate
)

Returns all paths starting at source that satisfy the given predicate.

Implementation

Iterable<ParserPath> findAllPaths(
  Parser source,
  Predicate<ParserPath> predicate,
) {
  assert(parsers.contains(source), 'source is not part of the analyzer');
  return depthFirstSearch(ParserPath([source], []), predicate);
}