Package: com.hypixel.hytale.server.npc.util.expression
public class ExecutionContext
Stack-based virtual machine that executes compiled expression instruction sequences. Maintains an operand stack of Operand slots (auto-growing by increments of 8), a current Scope , and optional combat config / interaction variable context. Provides pre-defined static Instruction constants for all arithmetic, logical, bitwise, and comparison operators, plus factory methods for generating PUSH, READ, CALL, and PACK instructions.
Name Operation UNARY_PLUSNo-op (identity). UNARY_MINUSNegate top number. LOGICAL_NOTNegate top boolean. BITWISE_NOTBitwise complement of top int. EXPONENTIATIONpow(a, b)REMAINDERa % bDIVIDEa / bMULTIPLYa * bMINUSa - bPLUSa + bGREATER_EQUAL, GREATER, LESS_EQUAL, LESSNumeric comparisons. NOT_EQUAL, EQUALNumeric equality. NOT_EQUAL_BOOL, EQUAL_BOOLBoolean equality. BITWISE_AND, BITWISE_XOR, BITWISE_ORBitwise integer ops. LOGICAL_AND, LOGICAL_ORShort-circuit boolean ops.
Modifier Type Name public static finalintSTACK_GROW_INCREMENTprotectedScope scopeprotectedOperand[]operandStackprotectedintstackTopprotectedValueType lastPushedTypeprotectedStringcombatConfigprotectedMap<String, String>interactionVars
Signature public ExecutionContext(Scope scope)public ExecutionContext()
Modifier Return Type Signature publicValueType execute(@Nonnull List<Instruction> instructions, Scope scope)publicValueType execute(@Nonnull List<Instruction> instructions)publicValueType execute(@Nonnull Instruction[] instructions, Scope scope)publicValueType execute(@Nonnull Instruction[] instructions)
Modifier Return Type Signature publicvoidpush(String value)publicvoidpush(double value)publicvoidpush(int value)publicvoidpush(boolean value)publicvoidpush(String[] value)publicvoidpush(double[] value)publicvoidpush(boolean[] value)publicvoidpushEmptyArray()publicdoublepopNumber()publicintpopInt()publicStringpopString()publicbooleanpopBoolean()publicdouble[]popNumberArray()@Nullable publicString[]popStringArray()publicboolean[]popBooleanArray()publicStringpopAsString()publicvoidpopPush(String value, int popCount)publicvoidpopPush(double value, int popCount)publicvoidpopPush(int value, int popCount)publicvoidpopPush(boolean value, int popCount)publicvoidpopPush(String[] value, int popCount)publicvoidpopPush(double[] value, int popCount)publicvoidpopPush(boolean[] value, int popCount)publicvoidpopPushEmptyArray(int popCount)
Modifier Return Type Signature @Nonnull public staticInstructiongenPUSH(String value)@Nonnull public staticInstructiongenPUSH(double value)@Nonnull public staticInstructiongenPUSH(boolean value)@Nonnull public staticInstructiongenPUSH(String[] value)@Nonnull public staticInstructiongenPUSH(double[] value)@Nonnull public staticInstructiongenPUSH(boolean[] value)@Nonnull public staticInstructiongenPUSHEmptyArray()@Nonnull public staticInstructiongenREAD(String ident, @Nonnull ValueType type, @Nullable Scope scope)@Nonnull public staticInstructiongenCALL(String ident, int numArgs, @Nullable Scope scope)@Nonnull public staticInstructiongenNumberPACK(int size)@Nonnull public staticInstructiongenStringPACK(int size)@Nonnull public staticInstructiongenBooleanPACK(int size)@Nonnull public staticInstructiongenPACK(@Nonnull ValueType arrayType, int size)
public interface Instruction {
void execute ( ExecutionContext var1 ) ;
A single executable step in a compiled expression. All operator constants, PUSH/READ/CALL/PACK generators, and user-defined functions implement this interface.
public static class Operand
Mutable value holder on the operand stack. Stores one value of any supported type (string, number, bool, numberArray, stringArray, boolArray) plus a ValueType discriminant. Reused across evaluations to minimize allocation.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.