public class MergeFlatByWeightParser extends MergeByWeightParser
MergeByWeightParser
that does not allow any dominance between the results.parsers
Constructor and Description |
---|
MergeFlatByWeightParser(@NotNull java.util.List<Parser> parsers)
Construct a new parser that uses the given
parsers preferring the results
from the parsers at the start that the results from the parsers that at the end
when a clash occur between their results. |
MergeFlatByWeightParser(Parser... parsers)
Construct a new parser that uses the given
parsers preferring the results
from the parsers at the start that the results from the parsers that at the end
when a clash occur between their results. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
check(@NotNull Tree primary,
@NotNull Tree secondary)
Check if the down-structure of the given
secondary can be alongside with
the given primary in its structure. |
parse
public MergeFlatByWeightParser(@Nullable Parser... parsers)
parsers
preferring the results
from the parsers at the start that the results from the parsers that at the end
when a clash occur between their results.
parsers
- the parsers to be used by the constructed parser.java.lang.NullPointerException
- if the given parsers
is null.public MergeFlatByWeightParser(@NotNull @NotNull java.util.List<Parser> parsers)
parsers
preferring the results
from the parsers at the start that the results from the parsers that at the end
when a clash occur between their results.
parsers
- the parsers to be used by the constructed parser.java.lang.NullPointerException
- if the given parsers
is null.protected boolean check(@NotNull @NotNull Tree primary, @NotNull @NotNull Tree secondary)
MergeByWeightParser
secondary
can be alongside with
the given primary
in its structure.check
in class MergeByWeightParser
primary
- the primary tree that is always wins.secondary
- the slave tree that might win or might lose depending on if it
clashes with the primary or not.secondary
can be with the given primary
.