Contents
Class Parser
java.lang.Object
com.hypixel.hytale.server.npc.util.expression.compile.Parser
Parser to convert expression string using a parser to RPN sequence fed into ParserTokenConsumer interface.
Parser is using an expanded Shunting Yard algorithm to convert the expression into a Reverse Polish Notation operand/operator sequence. (see https://en.wikipedia.org/wiki/Shunting-yard_algorithm)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfaceInterface parser uses to emit operands and operators in RPN order. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidparse(String expression, Parser.ParsedTokenConsumer tokenConsumer) Parse expression string and feed parsed values to a token consumer object for evaluation.
-
Field Details
-
MISMATCHED_CLOSING_BRACKET
- See Also:
-
TOO_MANY_OPERANDS
- See Also:
-
NOT_ENOUGH_OPERANDS
- See Also:
-
EXPECTED_UNARY_OPERATOR
- See Also:
-
EXPECTED_BINARY_OPERATOR
- See Also:
-
MISSING_CLOSING_BRACKET
- See Also:
-
ILLEGAL_USE_OF_ARGUMENT_LIST
- See Also:
-
-
Constructor Details
-
Parser
-
-
Method Details
-
parse
public void parse(@Nonnull String expression, @Nonnull Parser.ParsedTokenConsumer tokenConsumer) throws ParseException Parse expression string and feed parsed values to a token consumer object for evaluation.- Parameters:
expression- Expression stringtokenConsumer- Consumer object- Throws:
ParseException
-
peekOperator
-