public class MergeByOrderParser extends java.lang.Object implements Parser
Modifier and Type | Field and Description |
---|---|
protected @NotNull Parser |
parser
The parser this parser is wrapping.
|
Constructor and Description |
---|
MergeByOrderParser(@NotNull Parser parser)
Construct a sequential clash merging parser merging the results of invoking the
given
parser . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
check(@NotNull Tree previous,
@NotNull Tree next)
Check if the down-structure of the given
next can be alongside with the
given previous in its structure. |
@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 MergeByOrderParser(@NotNull @NotNull Parser parser)
parser
.parser
- the parser the constructed parser is wrapping.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
.@Contract(pure=true) protected boolean check(@NotNull @NotNull Tree previous, @NotNull @NotNull Tree next)
next
can be alongside with the
given previous
in its structure.previous
- the previous tree that is always wins.next
- the slave tree that might win or might lose depending on if it
clashes with the previous or not.next
can be with the given previous
.java.lang.NullPointerException
- if the given previous
or next
is
null.