Class FunctionExpression
java.lang.Object
org.openzen.zenscript.codemodel.expression.Expression
org.openzen.zenscript.codemodel.expression.FunctionExpression
- All Implemented Interfaces:
IPartialExpression
-
Field Summary
FieldsFields inherited from class org.openzen.zenscript.codemodel.expression.Expression
NONE, position, thrownType, type -
Constructor Summary
ConstructorsConstructorDescriptionFunctionExpression(CodePosition position, TypeID type, LambdaClosure closure, FunctionHeader header, Statement body) -
Method Summary
Modifier and TypeMethodDescription<C,R> R accept(C context, ExpressionVisitorWithContext<C, R> visitor) <T> Taccept(ExpressionVisitor<T> visitor) asReturnExpression(Expression... arguments) voidforEachStatement(Consumer<Statement> consumer) booleanisSimple()Checks if this is a simple function expression.transform(ExpressionTransformer transformer) Methods inherited from class org.openzen.zenscript.codemodel.expression.Expression
aborts, binaryThrow, call, castExplicit, castImplicit, eval, evaluateEnumConstant, evaluateStringConstant, getAssignHints, getMember, getPossibleFunctionHeaders, getTypeArguments, multiThrow, predictCallTypes, transform, transformMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openzen.zenscript.codemodel.partial.IPartialExpression
assign, capture, getMember
-
Field Details
-
header
-
closure
-
body
-
-
Constructor Details
-
Method Details
-
accept
- Specified by:
acceptin classExpression
-
accept
- Specified by:
acceptin classExpression
-
transform
- Specified by:
transformin classExpression
-
forEachStatement
- Overrides:
forEachStatementin classExpression
-
isSimple
public boolean isSimple()Checks if this is a simple function expression. A simple function expression consists of a body with just a expression or return statement.- Returns:
-
asReturnExpression
-
normalize
- Specified by:
normalizein classExpression
-