Uses of Interface
com.gengoai.parsing.Expression
-
Packages that use Expression Package Description com.gengoai.parsing -
-
Uses of Expression in com.gengoai.parsing
Classes in com.gengoai.parsing that implement Expression Modifier and Type Class Description class
BaseExpression
Abstract Base Class for Expressions to implement.class
BinaryInfixOperatorExpression
AnExpression
representing a binary operation, eg.class
ListExpression
The type List expression.class
TokenExpression
class
UnaryOperatorExpression
AnExpression
unary operator which contains a single expression valueclass
ValueExpression
Generic value expression in which the value is stored using aVal
to support arbitrary types.Methods in com.gengoai.parsing with type parameters of type Expression Modifier and Type Method Description protected <E extends Expression>
voidEvaluator. $(@NonNull Class<E> expressionClass, @NonNull Tag type, @NonNull CheckedFunction<E,? extends O> function)
Adds a switch statement where the condition is that the expression is of typeexpressionClass
and the expressions's token type is an instance oftype
.protected <E extends Expression>
voidEvaluator. $(Class<E> expressionClass, CheckedFunction<E,? extends O> function)
Adds a switch statement where the condition is that the expression is of typeexpressionClass
.default <T extends Expression,O>
OExpression. apply(Class<T> tClass, Function<T,O> function)
Applies the given function to this Expression treating it as an Expression of typeT
.default <T extends Expression>
TExpression. as(Class<T> tClass)
Casts this Expression as the given Expression type<E extends Expression>
List<E>ListExpression. elementsAs(Class<E> eClass)
Generates the list of elements casting them to the desired expression type<T extends Expression>
TParser. parseExpression(int precedence, Class<T> tClass)
<T extends Expression>
TParser. parseExpression(ParserToken precedence, Class<T> tClass)
<T extends Expression>
TParser. parseExpression(Class<T> tClass)
<T extends Expression>
List<T>Parser. parseExpressionList(Tag endOfList, Tag separator)
Parses a list of tokens ending with theendOfList
tag and values separated using theseparator
tag.<T extends Expression>
List<T>Parser. parseExpressionList(Tag startOfList, Tag endOfList, Tag separator)
Parses a list of tokens ending with theendOfList
tag and values separated using theseparator
tag.<E extends Expression>
GrammarGrammar. postfix(Tag tag, PostfixHandler handler, int precedence, SerializablePredicate<E> validator)
Registers aPostfixHandler
with the given precedence for the givenTag
<E extends Expression>
GrammarGrammar. prefix(Tag tag, PrefixHandler handler, SerializablePredicate<E> validator)
Registers aPrefixHandler
for the givenTag
<E extends Expression>
Stream<Expression>ListExpression. stream(Class<E> eClass)
Streams the elements as the given type.default <T extends Expression>
booleanExpression. when(Class<T> tClass, Consumer<T> consumer)
Applies the given consumer to the expression when it is an instance of the given expression typedefault <T extends Expression,O>
Optional<O>Expression. when(Class<T> tClass, Function<T,O> function)
Applies the given function to the expression when it is an instance of the given expression typeMethods in com.gengoai.parsing that return Expression Modifier and Type Method Description Expression
ListExpression. get(int index)
Get expression.Expression
BinaryInfixOperatorExpression. getLeft()
Gets the left-hand expressionExpression
BinaryInfixOperatorExpression. getRight()
Gets the right-hand expression.Expression
UnaryOperatorExpression. getValue()
Gets theExpression
representing the value of the operator.Expression
PostfixHandler. handle(Parser parser, ParserToken token, Expression left)
Handles the given postfix (or infix) token using the given parserExpression
PrefixHandler. handle(Parser parser, ParserToken token)
Handles the given prefix token using the given parserExpression
Parser. parseExpression()
Parses the token stream to get the next expressionExpression
Parser. parseExpression(int precedence)
Parses the token stream to get the next expressionExpression
Parser. parseExpression(int precedence, boolean isRightAssociative)
Parses the token stream to get the next expressionExpression
Parser. parseExpression(ParserToken precedence)
Parses the token stream to get the next expressionExpression
Parser. parseExpression(ParserToken token, boolean isRightAssociative)
Parses the token stream to get the next expressionMethods in com.gengoai.parsing that return types with arguments of type Expression Modifier and Type Method Description Iterator<Expression>
ListExpression. iterator()
List<Expression>
Parser. parseAllExpressions()
Parse all expressions list.Stream<Expression>
ListExpression. stream()
Streams the elements.<E extends Expression>
Stream<Expression>ListExpression. stream(Class<E> eClass)
Streams the elements as the given type.Methods in com.gengoai.parsing with parameters of type Expression Modifier and Type Method Description O
Evaluator. eval(Expression expression)
Evaluates the given expressionExpression
PostfixHandler. handle(Parser parser, ParserToken token, Expression left)
Handles the given postfix (or infix) token using the given parservoid
Grammar. validatePostfix(Expression expression)
Validates the given expression as if it were generated from a postfix handler.void
Grammar. validatePrefix(Expression expression)
Validates the given expression as if it were generated from a prefix handler.Method parameters in com.gengoai.parsing with type arguments of type Expression Modifier and Type Method Description default boolean
Expression. isInstance(Class<? extends Expression> tClass)
Checks if this Expression is an instance of the given Expression typedefault boolean
Expression. isInstance(Class<? extends Expression> tClass, Tag type)
Checks if this Expression is an instance of the given Expression type and the given Tag typeConstructors in com.gengoai.parsing with parameters of type Expression Constructor Description BinaryInfixOperatorExpression(ParserToken token, Expression left, Expression right)
Instantiates a new BinaryInfixOperatorExpression.UnaryOperatorExpression(ParserToken token, Expression value, boolean isPrefix)
Instantiates a new Prefix operator expression.Constructor parameters in com.gengoai.parsing with type arguments of type Expression Constructor Description ListExpression(Tag type, Collection<Expression> expressions, String separator, String startOfList, String endOfList)
Instantiates a new List expression.
-