|
@@ -1,32 +1,45 @@
|
1
|
1
|
package org.openzen.zenscript.javabytecode.compiler.definitions;
|
2
|
2
|
|
3
|
|
-import org.openzen.zenscript.codemodel.member.MethodMember;
|
4
|
|
-import org.openzen.zenscript.javashared.*;
|
5
|
3
|
import org.objectweb.asm.ClassWriter;
|
6
|
4
|
import org.objectweb.asm.Opcodes;
|
7
|
|
-import org.openzen.zenscript.codemodel.definition.*;
|
|
5
|
+import org.openzen.zenscript.codemodel.definition.AliasDefinition;
|
|
6
|
+import org.openzen.zenscript.codemodel.definition.ClassDefinition;
|
|
7
|
+import org.openzen.zenscript.codemodel.definition.DefinitionVisitor;
|
|
8
|
+import org.openzen.zenscript.codemodel.definition.EnumDefinition;
|
|
9
|
+import org.openzen.zenscript.codemodel.definition.ExpansionDefinition;
|
|
10
|
+import org.openzen.zenscript.codemodel.definition.FunctionDefinition;
|
|
11
|
+import org.openzen.zenscript.codemodel.definition.InterfaceDefinition;
|
|
12
|
+import org.openzen.zenscript.codemodel.definition.StructDefinition;
|
|
13
|
+import org.openzen.zenscript.codemodel.definition.VariantDefinition;
|
8
|
14
|
import org.openzen.zenscript.codemodel.generic.TypeParameter;
|
9
|
15
|
import org.openzen.zenscript.codemodel.member.IDefinitionMember;
|
|
16
|
+import org.openzen.zenscript.codemodel.member.ImplementationMember;
|
10
|
17
|
import org.openzen.zenscript.codemodel.type.BasicTypeID;
|
11
|
18
|
import org.openzen.zenscript.codemodel.type.GenericTypeID;
|
|
19
|
+import org.openzen.zenscript.codemodel.type.StoredType;
|
12
|
20
|
import org.openzen.zenscript.javabytecode.JavaBytecodeContext;
|
13
|
|
-import org.openzen.zenscript.javabytecode.compiler.*;
|
|
21
|
+import org.openzen.zenscript.javabytecode.compiler.CompilerUtils;
|
|
22
|
+import org.openzen.zenscript.javabytecode.compiler.JavaClassWriter;
|
|
23
|
+import org.openzen.zenscript.javabytecode.compiler.JavaStatementVisitor;
|
|
24
|
+import org.openzen.zenscript.javabytecode.compiler.JavaWriter;
|
|
25
|
+import org.openzen.zenscript.javashared.JavaClass;
|
|
26
|
+import org.openzen.zenscript.javashared.JavaMethod;
|
|
27
|
+import org.openzen.zenscript.javashared.JavaModifiers;
|
|
28
|
+import org.openzen.zenscript.javashared.JavaTypeGenericVisitor;
|
|
29
|
+import org.openzen.zenscript.javashared.JavaVariantOption;
|
14
|
30
|
|
15
|
|
-import java.io.FileNotFoundException;
|
16
|
31
|
import java.io.FileOutputStream;
|
17
|
32
|
import java.io.IOException;
|
18
|
33
|
import java.util.ArrayList;
|
19
|
34
|
import java.util.List;
|
20
|
|
-import org.openzen.zenscript.codemodel.member.ImplementationMember;
|
21
|
|
-import org.openzen.zenscript.codemodel.type.StoredType;
|
22
|
35
|
|
23
|
36
|
|
24
|
37
|
public class JavaDefinitionVisitor implements DefinitionVisitor<byte[]> {
|
25
|
|
- private static final JavaMethod CLASS_FORNAME
|
|
38
|
+ private final JavaMethod CLASS_FORNAME
|
26
|
39
|
= JavaMethod.getNativeStatic(JavaClass.CLASS, "forName", "(Ljava/lang/String;)Ljava/lang/Class;");
|
27
|
|
- private static final JavaMethod ENUM_VALUEOF
|
|
40
|
+ private final JavaMethod ENUM_VALUEOF
|
28
|
41
|
= JavaMethod.getNativeStatic(JavaClass.CLASS, "valueOf", "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;");
|
29
|
|
- private static final JavaMethod ARRAY_CLONE
|
|
42
|
+ private final JavaMethod ARRAY_CLONE
|
30
|
43
|
= JavaMethod.getNativeVirtual(JavaClass.ARRAYS, "clone", "()Ljava/lang/Object;");
|
31
|
44
|
|
32
|
45
|
private final JavaClassWriter outerWriter;
|