mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
ZoneCodeGenerator: Add bitwise and, or, xor operations
This commit is contained in:
parent
86f754bdd7
commit
49883bfce3
@ -17,8 +17,11 @@ namespace ZoneCodeGenerator.Domain.Evaluation
|
|||||||
BitwiseShift = 3,
|
BitwiseShift = 3,
|
||||||
RelationalGreaterLessThan = 4,
|
RelationalGreaterLessThan = 4,
|
||||||
RelationalEquals = 5,
|
RelationalEquals = 5,
|
||||||
LogicalAnd = 6,
|
BitwiseAnd = 6,
|
||||||
LogicalOr = 7
|
BitwiseXor = 7,
|
||||||
|
BitwiseOr = 8,
|
||||||
|
LogicalAnd = 9,
|
||||||
|
LogicalOr = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate int EvaluationFunction(int operand1, int operand2);
|
public delegate int EvaluationFunction(int operand1, int operand2);
|
||||||
@ -69,6 +72,24 @@ namespace ZoneCodeGenerator.Domain.Evaluation
|
|||||||
(operand1, operand2) => operand1 % operand2
|
(operand1, operand2) => operand1 % operand2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public static OperationType OperationBitwiseAnd = new OperationType(
|
||||||
|
"&",
|
||||||
|
OperationPrecedence.BitwiseAnd,
|
||||||
|
(operand1, operand2) => operand1 & operand2
|
||||||
|
);
|
||||||
|
|
||||||
|
public static OperationType OperationBitwiseXor = new OperationType(
|
||||||
|
"^",
|
||||||
|
OperationPrecedence.BitwiseXor,
|
||||||
|
(operand1, operand2) => operand1 ^ operand2
|
||||||
|
);
|
||||||
|
|
||||||
|
public static OperationType OperationBitwiseOr = new OperationType(
|
||||||
|
"|",
|
||||||
|
OperationPrecedence.BitwiseOr,
|
||||||
|
(operand1, operand2) => operand1 | operand2
|
||||||
|
);
|
||||||
|
|
||||||
public static OperationType OperationShiftLeft = new OperationType(
|
public static OperationType OperationShiftLeft = new OperationType(
|
||||||
"<<",
|
"<<",
|
||||||
OperationPrecedence.BitwiseShift,
|
OperationPrecedence.BitwiseShift,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user