public class CollectParser extends java.lang.Object implements Parser
Tree.offer(Tree)
uses Tree.pop()
. The children of the trees
that was created by some parser implementations that returns a tree with pre-included
children wont be added when offered to the primary tree structure. So, this parser is
parsing using another parser and taking the trees and separates their relatives and
returned them.Modifier and Type | Field and Description |
---|---|
protected @NotNull Parser |
parser
The wrapped parser.
|
Constructor and Description |
---|
CollectParser(@NotNull Parser parser)
Construct a new parser wrapping the given
parser and splitting the results
returned by it. |
Modifier and Type | Method and Description |
---|---|
@NotNull java.util.Set<Tree> |
parse(@NotNull Compilation compilation,
@NotNull Tree tree)
Parse the given
sketch with respect to the given compilation . |
@NotNull protected final @NotNull Parser parser
public CollectParser(@NotNull @NotNull Parser parser)
parser
and splitting the results
returned by it.parser
- the parser to be wrapped.java.lang.NullPointerException
- if the given parser
is null.@NotNull public @NotNull java.util.Set<Tree> parse(@NotNull @NotNull Compilation compilation, @NotNull @NotNull Tree tree)
Parser
sketch
with respect to the given compilation
.