|
@@ -5,9 +5,13 @@
|
5
|
5
|
*/
|
6
|
6
|
package org.openzen.zenscript.codemodel.type.member;
|
7
|
7
|
|
|
8
|
+import org.openzen.zenscript.codemodel.FunctionHeader;
|
|
9
|
+import org.openzen.zenscript.codemodel.FunctionParameter;
|
8
|
10
|
import org.openzen.zenscript.codemodel.Modifiers;
|
|
11
|
+import org.openzen.zenscript.codemodel.OperatorType;
|
9
|
12
|
import org.openzen.zenscript.codemodel.expression.ConstantIntExpression;
|
10
|
13
|
import org.openzen.zenscript.codemodel.member.CasterMember;
|
|
14
|
+import org.openzen.zenscript.codemodel.member.OperatorMember;
|
11
|
15
|
import org.openzen.zenscript.codemodel.member.builtin.ConstantGetterMember;
|
12
|
16
|
import org.openzen.zenscript.codemodel.type.BasicTypeID;
|
13
|
17
|
import org.openzen.zenscript.shared.CodePosition;
|
|
@@ -20,6 +24,29 @@ public class BuiltinTypeMembers {
|
20
|
24
|
public static final ConstantGetterMember INT_GET_MIN_VALUE = new ConstantGetterMember("MIN_VALUE", position -> new ConstantIntExpression(position, Integer.MIN_VALUE));
|
21
|
25
|
public static final ConstantGetterMember INT_GET_MAX_VALUE = new ConstantGetterMember("MAX_VALUE", position -> new ConstantIntExpression(position, Integer.MAX_VALUE));
|
22
|
26
|
|
|
27
|
+ public static final OperatorMember INT_ADD_INT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.ADD, new FunctionHeader(BasicTypeID.INT, new FunctionParameter(BasicTypeID.INT)));
|
|
28
|
+ public static final OperatorMember INT_ADD_LONG = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.ADD, new FunctionHeader(BasicTypeID.LONG, new FunctionParameter(BasicTypeID.LONG)));
|
|
29
|
+ public static final OperatorMember INT_ADD_FLOAT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.ADD, new FunctionHeader(BasicTypeID.FLOAT, new FunctionParameter(BasicTypeID.FLOAT)));
|
|
30
|
+ public static final OperatorMember INT_ADD_DOUBLE = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.ADD, new FunctionHeader(BasicTypeID.DOUBLE, new FunctionParameter(BasicTypeID.DOUBLE)));
|
|
31
|
+
|
|
32
|
+ public static final OperatorMember INT_SUB_INT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.SUB, new FunctionHeader(BasicTypeID.INT, new FunctionParameter(BasicTypeID.INT)));
|
|
33
|
+ public static final OperatorMember INT_SUB_LONG = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.SUB, new FunctionHeader(BasicTypeID.LONG, new FunctionParameter(BasicTypeID.LONG)));
|
|
34
|
+ public static final OperatorMember INT_SUB_FLOAT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.SUB, new FunctionHeader(BasicTypeID.FLOAT, new FunctionParameter(BasicTypeID.FLOAT)));
|
|
35
|
+ public static final OperatorMember INT_SUB_DOUBLE = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.SUB, new FunctionHeader(BasicTypeID.DOUBLE, new FunctionParameter(BasicTypeID.DOUBLE)));
|
|
36
|
+
|
|
37
|
+ public static final OperatorMember INT_MUL_INT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MUL, new FunctionHeader(BasicTypeID.INT, new FunctionParameter(BasicTypeID.INT)));
|
|
38
|
+ public static final OperatorMember INT_MUL_LONG = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MUL, new FunctionHeader(BasicTypeID.LONG, new FunctionParameter(BasicTypeID.LONG)));
|
|
39
|
+ public static final OperatorMember INT_MUL_FLOAT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MUL, new FunctionHeader(BasicTypeID.FLOAT, new FunctionParameter(BasicTypeID.FLOAT)));
|
|
40
|
+ public static final OperatorMember INT_MUL_DOUBLE = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MUL, new FunctionHeader(BasicTypeID.DOUBLE, new FunctionParameter(BasicTypeID.DOUBLE)));
|
|
41
|
+
|
|
42
|
+ public static final OperatorMember INT_DIV_INT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.DIV, new FunctionHeader(BasicTypeID.INT, new FunctionParameter(BasicTypeID.INT)));
|
|
43
|
+ public static final OperatorMember INT_DIV_LONG = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.DIV, new FunctionHeader(BasicTypeID.LONG, new FunctionParameter(BasicTypeID.LONG)));
|
|
44
|
+ public static final OperatorMember INT_DIV_FLOAT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.DIV, new FunctionHeader(BasicTypeID.FLOAT, new FunctionParameter(BasicTypeID.FLOAT)));
|
|
45
|
+ public static final OperatorMember INT_DIV_DOUBLE = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.DIV, new FunctionHeader(BasicTypeID.DOUBLE, new FunctionParameter(BasicTypeID.DOUBLE)));
|
|
46
|
+
|
|
47
|
+ public static final OperatorMember INT_MOD_INT = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MOD, new FunctionHeader(BasicTypeID.INT, new FunctionParameter(BasicTypeID.INT)));
|
|
48
|
+ public static final OperatorMember INT_MOD_LONG = new OperatorMember(CodePosition.BUILTIN, 0, OperatorType.MOD, new FunctionHeader(BasicTypeID.LONG, new FunctionParameter(BasicTypeID.LONG)));
|
|
49
|
+
|
23
|
50
|
public static final CasterMember INT_TO_BYTE = new CasterMember(CodePosition.BUILTIN, 0, BasicTypeID.BYTE);
|
24
|
51
|
public static final CasterMember INT_TO_SBYTE = new CasterMember(CodePosition.BUILTIN, 0, BasicTypeID.SBYTE);
|
25
|
52
|
public static final CasterMember INT_TO_SHORT = new CasterMember(CodePosition.BUILTIN, 0, BasicTypeID.SHORT);
|