Contents
Class ASTOperator
java.lang.Object
com.hypixel.hytale.server.npc.util.expression.compile.ast.AST
com.hypixel.hytale.server.npc.util.expression.compile.ast.ASTOperator
- Direct Known Subclasses:
ASTOperatorBinary, ASTOperatorFunctionCall, ASTOperatorTuple, ASTOperatorUnary
ASTOperator have at least one child.
- Since:
- 2017-11-22
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(AST argument) static voidfromParsedOperator(Parser.ParsedToken operand, CompileContext compileContext) genCode(List<ExecutionContext.Instruction> list, Scope scope) Generate an instruction list from AST.Methods inherited from class AST
asOperand, getBoolean, getCodeGen, getNumber, getParent, getString, getToken, getTokenPosition, getValueType, isConstant, returnType, setParent
-
Constructor Details
-
ASTOperator
-
-
Method Details
-
addArgument
-
getArguments
-
genCode
Description copied from class:ASTGenerate an instruction list from AST.If provided a scope as argument any references to function and variables are resolved to suppliers/functions from this scope, making the instructions only run with the same scope/context. This makes it possible to bind instructions to a specific object and eliminates the need to update the symbol table, as values can be read directly from the bound objects(s) using the suppliers.
If the provided scope is null then variables and functions are looked up in the scope passed as argument when executing the instructions.
-
fromParsedOperator
public static void fromParsedOperator(@Nonnull Parser.ParsedToken operand, @Nonnull CompileContext compileContext) throws ParseException - Throws:
ParseException
-