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
Nested ClassesModifier and TypeClassDescriptionstatic classFluent helper to build a parser containing a list of tokens.static classA token that is a call to an operator with arguments.static classAn operator token.static classstatic interfaceCallback defining the behavior of a special function.static classAn token corresponding to a special operator.static classA token: either an atom, a call to an operator with arguments, or an unmatched operator.static enumToken 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.Tokenparse()voidspecial(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)
-