public BinaryExpression(Expression left, Expression right, BinaryOperation operation, MjoType type) { Left = left; Right = right; Operation = operation; Type = type; }
public Assignment(Expression value, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation) { Value = value; Hash = hash; Flags = flags; Type = type; Operation = operation; }
private void ProcessBinaryExpression(Instruction instruction, BinaryOperation operation, MjoType type) { Debug.Assert(EvaluationStack.Count >= 2); var left = EvaluationStack[^ 2];
public static MjoFlags Build(MjoType type, MjoScope scope, MjoModifier modifier, MjoInvertMode invertMode, int dimension) => (MjoFlags)(dimension << 11 | (ushort)type << 8 | (ushort)scope << 5 | (ushort)invertMode << 3 | (ushort)modifier);
public static MjoType ElementType(this MjoType type) => type.Matches(MjoTypeMask.Array) ? type - 3 : throw new Exception($"Can't resolve element type of {type}");
public static MjoType Array(this MjoType type) => type.Matches(MjoTypeMask.Primitive) ? type + 3 : throw new Exception($"Can't create array type from {type}");
public static bool Matches(this MjoType type, MjoTypeMask mask) => type == MjoType.Unknown || (type.ToMask() & mask) != 0;
public static MjoTypeMask ToMask(this MjoType type) => type == MjoType.Unknown ? MjoTypeMask.All : (MjoTypeMask)(1 << (byte)type);
public UnaryExpression(Expression operand, UnaryOperation operation, MjoType type) { Operand = operand; Operation = operation; Type = type; }
public ArrayAssignment(Expression value, Expression[] indices, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation) : base(value, hash, flags, type, operation) { Indices = indices; }
public Cast(Expression value, MjoType targetType) { Value = value; TargetType = targetType; }