Package org.apache.calcite.util
Class PrecedenceClimbingParser
java.lang.Object
org.apache.calcite.util.PrecedenceClimbingParser
Parser that takes a collection of tokens (atoms and operators)
and groups them together according to the operators' precedence
and associativity.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fluent helper to build a parser containing a list of tokens.static class
A token that is a call to an operator with arguments.static class
An operator token.static class
static interface
Callback defining the behavior of a special function.static class
An token corresponding to a special operator.static class
A token: either an atom, a call to an operator with arguments, or an unmatched operator.static enum
Token type. -
Method Summary
Modifier and TypeMethodDescriptionall()
Returns a list of all tokens.call
(PrecedenceClimbingParser.Op op, com.google.common.collect.ImmutableList<PrecedenceClimbingParser.Token> args) copy
(int start, Predicate<PrecedenceClimbingParser.Token> predicate) @Nullable PrecedenceClimbingParser.Token
parse()
void
special
(Object o, int leftPrec, int rightPrec, PrecedenceClimbingParser.Special special) toString()
-
Method Details
-
atom
-
call
public PrecedenceClimbingParser.Call call(PrecedenceClimbingParser.Op op, com.google.common.collect.ImmutableList<PrecedenceClimbingParser.Token> args) -
infix
-
prefix
-
postfix
-
special
public PrecedenceClimbingParser.SpecialOp special(Object o, int leftPrec, int rightPrec, PrecedenceClimbingParser.Special special) -
parse
-
partialParse
public void partialParse() -
toString
-
all
Returns a list of all tokens. -
print
-
copy
public PrecedenceClimbingParser copy(int start, Predicate<PrecedenceClimbingParser.Token> predicate)
-