forked from JavaTX/JavaCompilerCore
Bytecodegenerierung angepasst. Tests erstellt
This commit is contained in:
parent
931e90e7f2
commit
d7e6a7848d
@ -5,12 +5,15 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.Attribute.8529.import
|
// ino.module.Attribute.8529.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.Attribute.21446.declaration
|
// ino.class.Attribute.21446.declaration
|
||||||
public abstract class Attribute
|
public abstract class Attribute implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.Attribute.21446.body
|
// ino.class.Attribute.21446.body
|
||||||
{
|
{
|
||||||
@ -44,7 +47,8 @@ public abstract class Attribute
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21461.declaration
|
// ino.method.codegen.21461.declaration
|
||||||
public abstract void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public abstract void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws JVMCodeException, IOException;
|
throws JVMCodeException, IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
|
@ -4,8 +4,10 @@ package mycompiler.mybytecode;
|
|||||||
|
|
||||||
// ino.module.AttributeInfo.8530.import
|
// ino.module.AttributeInfo.8530.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
@ -70,7 +72,8 @@ public class AttributeInfo extends Attribute
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21489.definition
|
// ino.method.codegen.21489.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws JVMCodeException, java.io.IOException
|
throws JVMCodeException, java.io.IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21489.body
|
// ino.method.codegen.21489.body
|
||||||
|
@ -5,6 +5,7 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CONSTANT_Class_info.8533.import
|
// ino.module.CONSTANT_Class_info.8533.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.CONSTANT_Class_info.21763.declaration
|
// ino.class.CONSTANT_Class_info.21763.declaration
|
||||||
@ -35,7 +36,8 @@ public class CONSTANT_Class_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21776.definition
|
// ino.method.codegen.21776.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21776.body
|
// ino.method.codegen.21776.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_Double_info.21782.declaration
|
// ino.class.CONSTANT_Double_info.21782.declaration
|
||||||
public class CONSTANT_Double_info extends CPInfo
|
public class CONSTANT_Double_info extends CPInfo
|
||||||
@ -46,7 +47,8 @@ public class CONSTANT_Double_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21804.definition
|
// ino.method.codegen.21804.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21804.body
|
// ino.method.codegen.21804.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_Fieldref_info.21810.declaration
|
// ino.class.CONSTANT_Fieldref_info.21810.declaration
|
||||||
public class CONSTANT_Fieldref_info extends CPInfo
|
public class CONSTANT_Fieldref_info extends CPInfo
|
||||||
@ -57,7 +58,8 @@ public class CONSTANT_Fieldref_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21832.definition
|
// ino.method.codegen.21832.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21832.body
|
// ino.method.codegen.21832.body
|
||||||
|
@ -5,6 +5,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_Float_info.21838.declaration
|
// ino.class.CONSTANT_Float_info.21838.declaration
|
||||||
public class CONSTANT_Float_info extends CPInfo
|
public class CONSTANT_Float_info extends CPInfo
|
||||||
@ -29,7 +30,8 @@ public class CONSTANT_Float_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21851.definition
|
// ino.method.codegen.21851.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21851.body
|
// ino.method.codegen.21851.body
|
||||||
|
@ -4,6 +4,7 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CONSTANT_Integer_info.8537.import
|
// ino.module.CONSTANT_Integer_info.8537.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
|
|
||||||
@ -32,7 +33,8 @@ public class CONSTANT_Integer_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21870.definition
|
// ino.method.codegen.21870.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21870.body
|
// ino.method.codegen.21870.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_InterfaceMethodref_info.21876.declaration
|
// ino.class.CONSTANT_InterfaceMethodref_info.21876.declaration
|
||||||
public class CONSTANT_InterfaceMethodref_info extends CPInfo
|
public class CONSTANT_InterfaceMethodref_info extends CPInfo
|
||||||
@ -57,7 +58,8 @@ public class CONSTANT_InterfaceMethodref_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21898.definition
|
// ino.method.codegen.21898.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21898.body
|
// ino.method.codegen.21898.body
|
||||||
|
@ -5,6 +5,7 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CONSTANT_Long_info.8539.import
|
// ino.module.CONSTANT_Long_info.8539.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.CONSTANT_Long_info.21904.declaration
|
// ino.class.CONSTANT_Long_info.21904.declaration
|
||||||
@ -57,7 +58,8 @@ public class CONSTANT_Long_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21926.definition
|
// ino.method.codegen.21926.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21926.body
|
// ino.method.codegen.21926.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_Methodref_info.21932.declaration
|
// ino.class.CONSTANT_Methodref_info.21932.declaration
|
||||||
public class CONSTANT_Methodref_info extends CPInfo
|
public class CONSTANT_Methodref_info extends CPInfo
|
||||||
@ -57,7 +58,8 @@ public class CONSTANT_Methodref_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21954.definition
|
// ino.method.codegen.21954.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21954.body
|
// ino.method.codegen.21954.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_NameAndType_info.21960.declaration
|
// ino.class.CONSTANT_NameAndType_info.21960.declaration
|
||||||
public class CONSTANT_NameAndType_info extends CPInfo
|
public class CONSTANT_NameAndType_info extends CPInfo
|
||||||
@ -57,7 +58,8 @@ public class CONSTANT_NameAndType_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21982.definition
|
// ino.method.codegen.21982.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21982.body
|
// ino.method.codegen.21982.body
|
||||||
|
@ -6,6 +6,7 @@ package mycompiler.mybytecode;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
// ino.class.CONSTANT_String_info.21988.declaration
|
// ino.class.CONSTANT_String_info.21988.declaration
|
||||||
public class CONSTANT_String_info extends CPInfo
|
public class CONSTANT_String_info extends CPInfo
|
||||||
@ -35,7 +36,8 @@ public class CONSTANT_String_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22001.definition
|
// ino.method.codegen.22001.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22001.body
|
// ino.method.codegen.22001.body
|
||||||
|
@ -5,6 +5,7 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CONSTANT_Utf8_info.8543.import
|
// ino.module.CONSTANT_Utf8_info.8543.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
@ -36,7 +37,8 @@ public class CONSTANT_Utf8_info extends CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22020.definition
|
// ino.method.codegen.22020.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22020.body
|
// ino.method.codegen.22020.body
|
||||||
|
@ -5,11 +5,13 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CPInfo.8544.import
|
// ino.module.CPInfo.8544.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.CPInfo.22026.declaration
|
// ino.class.CPInfo.22026.declaration
|
||||||
public abstract class CPInfo
|
public abstract class CPInfo implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.CPInfo.22026.body
|
// ino.class.CPInfo.22026.body
|
||||||
{
|
{
|
||||||
@ -43,7 +45,8 @@ public abstract class CPInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22041.declaration
|
// ino.method.codegen.22041.declaration
|
||||||
public abstract void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public abstract void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
package mycompiler.mybytecode;
|
package mycompiler.mybytecode;
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.module.ClassFile.8531.import
|
// ino.module.ClassFile.8531.import
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myclass.ParameterList;
|
import mycompiler.myclass.ParameterList;
|
||||||
import mycompiler.myclass.UsedId;
|
import mycompiler.myclass.UsedId;
|
||||||
import mycompiler.MyCompiler;
|
import mycompiler.MyCompiler;
|
||||||
@ -16,6 +19,7 @@ import mycompiler.mystatement.Assign;
|
|||||||
import mycompiler.mystatement.Block;
|
import mycompiler.mystatement.Block;
|
||||||
import mycompiler.mytype.Type;
|
import mycompiler.mytype.Type;
|
||||||
import mycompiler.SourceFile;
|
import mycompiler.SourceFile;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
@ -34,6 +38,7 @@ public class ClassFile
|
|||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.ClassFile.21492.body
|
// ino.class.ClassFile.21492.body
|
||||||
{
|
{
|
||||||
|
//Beschreibung des Classfiles: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
|
||||||
public boolean hamaAload0 = false; //hama: f<EFBFBD>gt in Konstruktor und set Methode ein aload_0 ein wird f<EFBFBD>r StoreSomethingParmCon ben<EFBFBD>tigt
|
public boolean hamaAload0 = false; //hama: f<EFBFBD>gt in Konstruktor und set Methode ein aload_0 ein wird f<EFBFBD>r StoreSomethingParmCon ben<EFBFBD>tigt
|
||||||
|
|
||||||
// ino.attribute.codegenlog.21495.decldescription type=line
|
// ino.attribute.codegenlog.21495.decldescription type=line
|
||||||
@ -794,7 +799,7 @@ public class ClassFile
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.writeInt.21669.definition
|
// ino.method.writeInt.21669.definition
|
||||||
public void writeInt(FileOutputStream f, int i)
|
public void writeInt(OutputStream f, int i)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.writeInt.21669.body
|
// ino.method.writeInt.21669.body
|
||||||
@ -807,7 +812,7 @@ public class ClassFile
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.writeShort.21672.definition
|
// ino.method.writeShort.21672.definition
|
||||||
public void writeShort(FileOutputStream f, short i)
|
public void writeShort(OutputStream f, short i)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.writeShort.21672.body
|
// ino.method.writeShort.21672.body
|
||||||
@ -818,7 +823,7 @@ public class ClassFile
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.writeByte.21675.definition
|
// ino.method.writeByte.21675.definition
|
||||||
public void writeByte(FileOutputStream f, byte i)
|
public void writeByte(OutputStream f, byte i)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.writeByte.21675.body
|
// ino.method.writeByte.21675.body
|
||||||
@ -828,7 +833,7 @@ public class ClassFile
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.writeByteArray.21678.definition
|
// ino.method.writeByteArray.21678.definition
|
||||||
public void writeByteArray(FileOutputStream f, byte[] b)
|
public void writeByteArray(OutputStream f, byte[] b)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.writeByteArray.21678.body
|
// ino.method.writeByteArray.21678.body
|
||||||
@ -836,6 +841,78 @@ public class ClassFile
|
|||||||
for(int i = 0; i < Array.getLength(b); i++) f.write(b[i]);
|
for(int i = 0; i < Array.getLength(b); i++) f.write(b[i]);
|
||||||
}
|
}
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
|
public byte[] getBytecode() {
|
||||||
|
ByteArrayOutputStream f = new ByteArrayOutputStream();
|
||||||
|
try {
|
||||||
|
// Schreiben der Header-Infos
|
||||||
|
writeInt(f, magic);
|
||||||
|
|
||||||
|
writeShort(f, minor_version);
|
||||||
|
writeShort(f, major_version);
|
||||||
|
codegenlog.debug("Header: magic=" + Integer.toHexString(magic));
|
||||||
|
codegenlog.debug("Header: minor_version=" + minor_version);
|
||||||
|
codegenlog.debug("Header: major_version=" + major_version);
|
||||||
|
codegenlog.info("Verarbeite Konstanten-Pool: " + (constant_pool.size()+1));
|
||||||
|
|
||||||
|
// Constant-Pool verarbeiten
|
||||||
|
writeShort(f, (short)(constant_pool.size() + 1));
|
||||||
|
for(int i = 0; i < constant_pool.size(); i++)
|
||||||
|
{
|
||||||
|
codegenlog.debug((i+1) +". " +
|
||||||
|
constant_pool.elementAt(i).toString());
|
||||||
|
constant_pool.elementAt(i).codegen(this, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Informationen ueber die Klasse selbst verarbeiten
|
||||||
|
writeShort(f, access_flags);
|
||||||
|
writeShort(f, this_class);
|
||||||
|
writeShort(f, super_class);
|
||||||
|
codegenlog.debug("Klasseninfos: access_flags=" + access_flags);
|
||||||
|
codegenlog.debug("Klasseninfos: this_class=" + this_class);
|
||||||
|
codegenlog.debug("Klasseninfos: super_class=" + super_class);
|
||||||
|
|
||||||
|
// Interfaces verarbeiten
|
||||||
|
codegenlog.info("Verarbeite Interfaces: " + interfaces.size());
|
||||||
|
writeShort(f, (short)interfaces.size());
|
||||||
|
for (int i=0; i<interfaces.size(); i++) {
|
||||||
|
writeShort(f, interfaces.elementAt(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Felder verarbeiten
|
||||||
|
codegenlog.info("Verarbeite Fields: " + fields.size());
|
||||||
|
writeShort(f, (short)fields.size());
|
||||||
|
for(int i = 0; i < fields.size(); i++)
|
||||||
|
{
|
||||||
|
fields.elementAt(i).codegen(this, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methodenvektor
|
||||||
|
codegenlog.info("Verarbeite Methodenliste: " + methods.size());
|
||||||
|
writeShort(f, (short)methods.size());
|
||||||
|
for(int i = 0; i < methods.size(); i++)
|
||||||
|
{
|
||||||
|
codegenlog.debug("Verarbeite Methode " + (i+1));
|
||||||
|
methods.elementAt(i).codegen(this, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attribut-Vektor
|
||||||
|
codegenlog.info("Verarbeite Attribute: " + attributes.size());
|
||||||
|
writeShort(f, (short)attributes.size());
|
||||||
|
for(int i = 0; i < attributes.size(); i++)
|
||||||
|
{
|
||||||
|
attributes.elementAt(i).codegen(this, f);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (JVMCodeException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return f.toByteArray();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// ino.end
|
// ino.end
|
||||||
|
10
src/mycompiler/mybytecode/ClassFileMember.java
Normal file
10
src/mycompiler/mybytecode/ClassFileMember.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package mycompiler.mybytecode;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import mycompiler.myexception.JVMCodeException;
|
||||||
|
|
||||||
|
public interface ClassFileMember {
|
||||||
|
public void codegen(ClassFile cf, OutputStream out) throws JVMCodeException, IOException;
|
||||||
|
}
|
@ -5,8 +5,10 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.CodeAttribute.8532.import
|
// ino.module.CodeAttribute.8532.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
import mycompiler.mytype.Type;
|
import mycompiler.mytype.Type;
|
||||||
// ino.end
|
// ino.end
|
||||||
@ -231,7 +233,8 @@ public class CodeAttribute extends Attribute
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.21757.definition
|
// ino.method.codegen.21757.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws JVMCodeException, IOException
|
throws JVMCodeException, IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.21757.body
|
// ino.method.codegen.21757.body
|
||||||
|
@ -5,11 +5,13 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.ExceptionTable.8545.import
|
// ino.module.ExceptionTable.8545.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.ExceptionTable.22047.declaration
|
// ino.class.ExceptionTable.22047.declaration
|
||||||
public class ExceptionTable
|
public class ExceptionTable implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.ExceptionTable.22047.body
|
// ino.class.ExceptionTable.22047.body
|
||||||
{
|
{
|
||||||
@ -36,7 +38,8 @@ public class ExceptionTable
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22065.definition
|
// ino.method.codegen.22065.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException
|
throws IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22065.body
|
// ino.method.codegen.22065.body
|
||||||
|
@ -5,13 +5,16 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.FieldInfo.8546.import
|
// ino.module.FieldInfo.8546.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.FieldInfo.22068.declaration
|
// ino.class.FieldInfo.22068.declaration
|
||||||
public class FieldInfo
|
public class FieldInfo implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.FieldInfo.22068.body
|
// ino.class.FieldInfo.22068.body
|
||||||
{
|
{
|
||||||
@ -177,7 +180,8 @@ public class FieldInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22137.definition
|
// ino.method.codegen.22137.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws IOException, JVMCodeException
|
throws IOException, JVMCodeException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22137.body
|
// ino.method.codegen.22137.body
|
||||||
|
@ -4,11 +4,13 @@ package mycompiler.mybytecode;
|
|||||||
|
|
||||||
// ino.module.Key.8548.import
|
// ino.module.Key.8548.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.Key.22890.declaration
|
// ino.class.Key.22890.declaration
|
||||||
public class Key
|
public class Key implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.Key.22890.body
|
// ino.class.Key.22890.body
|
||||||
{
|
{
|
||||||
@ -87,7 +89,8 @@ public class Key
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22920.definition
|
// ino.method.codegen.22920.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22920.body
|
// ino.method.codegen.22920.body
|
||||||
{
|
{
|
||||||
|
@ -5,13 +5,16 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.MethodInfo.8549.import
|
// ino.module.MethodInfo.8549.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.class.MethodInfo.22923.declaration
|
// ino.class.MethodInfo.22923.declaration
|
||||||
public class MethodInfo
|
public class MethodInfo implements ClassFileMember
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.class.MethodInfo.22923.body
|
// ino.class.MethodInfo.22923.body
|
||||||
{
|
{
|
||||||
@ -111,7 +114,7 @@ public class MethodInfo
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22965.definition
|
// ino.method.codegen.22965.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws JVMCodeException, IOException
|
throws JVMCodeException, IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22965.body
|
// ino.method.codegen.22965.body
|
||||||
|
@ -5,7 +5,9 @@ package mycompiler.mybytecode;
|
|||||||
// ino.module.SignatureInfo.8550.import
|
// ino.module.SignatureInfo.8550.import
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import mycompiler.myclass.ParameterList;
|
import mycompiler.myclass.ParameterList;
|
||||||
import mycompiler.myclass.UsedId;
|
import mycompiler.myclass.UsedId;
|
||||||
import mycompiler.myexception.JVMCodeException;
|
import mycompiler.myexception.JVMCodeException;
|
||||||
@ -13,6 +15,7 @@ import mycompiler.mytype.BoundedGenericTypeVar;
|
|||||||
import mycompiler.mytype.GenericTypeVar;
|
import mycompiler.mytype.GenericTypeVar;
|
||||||
import mycompiler.mytype.RefType;
|
import mycompiler.mytype.RefType;
|
||||||
import mycompiler.mytype.Type;
|
import mycompiler.mytype.Type;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
@ -175,7 +178,8 @@ public class SignatureInfo extends Attribute
|
|||||||
// ino.end
|
// ino.end
|
||||||
|
|
||||||
// ino.method.codegen.22987.definition
|
// ino.method.codegen.22987.definition
|
||||||
public void codegen(ClassFile classfile, FileOutputStream f)
|
@Override
|
||||||
|
public void codegen(ClassFile classfile, OutputStream f)
|
||||||
throws JVMCodeException, IOException
|
throws JVMCodeException, IOException
|
||||||
// ino.end
|
// ino.end
|
||||||
// ino.method.codegen.22987.body
|
// ino.method.codegen.22987.body
|
||||||
|
@ -328,7 +328,9 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
//geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen:
|
//geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen:
|
||||||
classfile.add_class(getName(), pkgName.get_Name_1Element(), superClass, getAccessFlags());
|
String packageName = "";
|
||||||
|
if(pkgName != null) packageName = pkgName.get_Name_1Element();
|
||||||
|
classfile.add_class(getName(), packageName, superClass, getAccessFlags());
|
||||||
|
|
||||||
// Handling fuer Superinterfaces
|
// Handling fuer Superinterfaces
|
||||||
classfile.addSuperInterfaces(getSuperInterfaces());
|
classfile.addSuperInterfaces(getSuperInterfaces());
|
||||||
|
45
test/bytecode/BytecodeTester.java
Normal file
45
test/bytecode/BytecodeTester.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import mycompiler.MyCompiler;
|
||||||
|
import mycompiler.MyCompilerAPI;
|
||||||
|
import mycompiler.mybytecode.ClassFile;
|
||||||
|
import mycompiler.myexception.JVMCodeException;
|
||||||
|
|
||||||
|
public class BytecodeTester{
|
||||||
|
|
||||||
|
//Web-Disassembler: http://hakurai.github.io/javap.js/web/
|
||||||
|
|
||||||
|
public static final String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
||||||
|
|
||||||
|
public static Vector<ClassFile> testCodegen(String sourceCode){
|
||||||
|
MyCompilerAPI compiler = MyCompiler.getAPI();
|
||||||
|
compiler.parse("class EmptyClass{}");
|
||||||
|
Vector<ClassFile> ret = null;
|
||||||
|
try {
|
||||||
|
ret = compiler.codeGeneration(null);
|
||||||
|
} catch (NullPointerException | JVMCodeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
TestCase.fail();
|
||||||
|
}
|
||||||
|
TestCase.assertTrue("Es wurden keine ClassFiles generiert",ret != null && ret.size()>0);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector<ClassFile> readFileAndTestCodegen(String fileName) throws IOException{
|
||||||
|
return testCodegen(getFileContent(rootDirectory + fileName));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getFileContent(String path)throws IOException
|
||||||
|
{
|
||||||
|
byte[] encoded = Files.readAllBytes(Paths.get(path));
|
||||||
|
return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString();
|
||||||
|
}
|
||||||
|
}
|
@ -14,15 +14,7 @@ public class EmptyClassTest extends TestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test(){
|
public void test(){
|
||||||
MyCompilerAPI compiler = MyCompiler.getAPI();
|
BytecodeTester.testCodegen("class EmptyClass{}");
|
||||||
compiler.parse("class EmptyClass{}");
|
|
||||||
try {
|
|
||||||
compiler.codeGeneration(null);
|
|
||||||
} catch (NullPointerException | JVMCodeException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
assertTrue("Test erfolgreich",true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
6
test/bytecode/FieldTest.jav
Normal file
6
test/bytecode/FieldTest.jav
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class FieldTest{
|
||||||
|
String var;
|
||||||
|
String methode(String para1){
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
}
|
35
test/bytecode/GeneralTest.java
Normal file
35
test/bytecode/GeneralTest.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import sun.misc.IOUtils;
|
||||||
|
import mycompiler.mybytecode.ClassFile;
|
||||||
|
|
||||||
|
public class GeneralTest extends TestCase{
|
||||||
|
@Test
|
||||||
|
public void test(){
|
||||||
|
Vector<ClassFile> cfs = null;
|
||||||
|
try {
|
||||||
|
cfs = BytecodeTester.readFileAndTestCodegen("FieldTest.jav");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1);
|
||||||
|
try {
|
||||||
|
FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"target-file"));
|
||||||
|
output.write(cfs.firstElement().getBytecode());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
test/bytecode/MethodTest.java
Normal file
12
test/bytecode/MethodTest.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class MethodTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test(){
|
||||||
|
BytecodeTester.testCodegen("class MethodTest{ public void method(){} }");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
3
test/mycompiler/test/lambda/TestInterface.jav
Normal file
3
test/mycompiler/test/lambda/TestInterface.jav
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
interface TestInterface{
|
||||||
|
|
||||||
|
}
|
24
test/mycompiler/test/lambda/TestInterface.java
Normal file
24
test/mycompiler/test/lambda/TestInterface.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package mycompiler.test.lambda;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mycompiler.mytest.LambdaTest;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class TestInterface {
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
//Testet nur ob ein Interface ohne Fehler geparst und inferiert wird.
|
||||||
|
executeTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String exampleJavFile = "TestInterface.jav";
|
||||||
|
|
||||||
|
private HashMap<String,String> variableTypeAssumptions = new HashMap<String,String>();
|
||||||
|
|
||||||
|
public void executeTest(){
|
||||||
|
LambdaTest tester = new LambdaTest(exampleJavFile);
|
||||||
|
tester.runTest();
|
||||||
|
}
|
||||||
|
}
|
@ -1,165 +1,123 @@
|
|||||||
Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse2Method Assumptions:
|
Class DEBUG [Typeinference] Erstellte Assumptions: this: MatrixMethod Assumptions:
|
||||||
[MethodAssumption: TPH B null { [(var1 = NEW Klasse1), null Return null (var1.getVar1( [ ]))], MethodAssumption: Klasse2 null { []]
|
[MethodAssumption: Matrix null { []]
|
||||||
FieldVar Assumptions:
|
FieldVar Assumptions:
|
||||||
[typinferenz.assumptions.FieldAssumption@3ea4e3ae]
|
[typinferenz.assumptions.FieldAssumption@cd7e6ef]
|
||||||
LocalVar Assumptions:
|
LocalVar Assumptions:
|
||||||
[]
|
[]
|
||||||
Parameter Assumptions:
|
Parameter Assumptions:
|
||||||
[]
|
[]
|
||||||
|
|
||||||
Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse1Method Assumptions:
|
Block DEBUG [Typeinference] Prozessing statement: null Return null (( [ f, ]) -> null { [null Return null (f.apply( [ null (this(null)), m, ]))])
|
||||||
[MethodAssumption: int int { [null Return var1], MethodAssumption: Klasse1 null { []]
|
Block DEBUG [Typeinference] Prozessing statement: null Return null (f.apply( [ null (this(null)), m, ]))
|
||||||
FieldVar Assumptions:
|
Block DEBUG [Typeinference] Prozessing statement: TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ]))
|
||||||
[typinferenz.assumptions.FieldAssumption@1799e2e2]
|
Block DEBUG [Typeinference] Prozessing statement: TPH CK Return TPH CE (( [ TPH CD f, ]) -> TPH CJ { [TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ]))])
|
||||||
LocalVar Assumptions:
|
Class DEBUG [Typeinference] Erstellte Constraints: TPH BZ < TPH BZ
|
||||||
[]
|
[(TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), ]
|
||||||
Parameter Assumptions:
|
TPH CF < TPH CJ
|
||||||
[]
|
Fun1< TPH CJ, TPH CD > < TPH CE
|
||||||
|
TPH CE < TPH CK
|
||||||
|
Fun1< TPH CK, TPH CB > < TPH CC
|
||||||
|
TPH CC < TPH BZ
|
||||||
|
|
||||||
Block DEBUG [Typeinference] Prozessing statement: (var1 = NEW Klasse1)
|
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH BZ <. TPH BZ), (TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), (TPH CF <. TPH CJ), (Fun1< TPH CJ, TPH CD > <. TPH CE), (TPH CE <. TPH CK), (Fun1< TPH CK, TPH CB > <. TPH CC), (TPH CC <. TPH BZ)]]
|
||||||
Block DEBUG [Typeinference] Prozessing statement: null Return null (var1.getVar1( [ ]))
|
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]]
|
||||||
Block DEBUG [Typeinference] Prozessing statement: TPH K Return TPH J (var1: TPH A.getVar1( [ ]))
|
|
||||||
Block DEBUG [Typeinference] Prozessing statement: void(var1: TPH A = NEW Klasse1)
|
|
||||||
Class DEBUG [Typeinference] Erstellte Constraints: TPH A < TPH A
|
|
||||||
[(Klasse1 <. Klasse1), (Klasse1 <. Klasse1), ]
|
|
||||||
Klasse1 < TPH A
|
|
||||||
TPH A < TPH I
|
|
||||||
[(int <. TPH J), (TPH A <. Klasse1), (int <. TPH J), (TPH A <. Klasse1), ]
|
|
||||||
TPH J < TPH K
|
|
||||||
TPH K < TPH B
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)]]
|
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]]
|
|
||||||
SourceFile DEBUG [Typeinference]
|
SourceFile DEBUG [Typeinference]
|
||||||
JavaFiles:
|
JavaFiles:
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse2 extends Object
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
{
|
{
|
||||||
Klasse1 var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int testMethode()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
var1 = new Klasse1();
|
};
|
||||||
return var1.getVar1();;
|
};
|
||||||
}
|
Matrix Matrix()
|
||||||
Klasse2 Klasse2()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]]
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
SourceFile DEBUG [Typeinference]
|
|
||||||
JavaFiles:
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse2 extends Object
|
|
||||||
{
|
{
|
||||||
Klasse1 var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int testMethode()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
var1 = new Klasse1();
|
};
|
||||||
return var1.getVar1();;
|
};
|
||||||
}
|
Matrix Matrix()
|
||||||
Klasse2 Klasse2()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]]
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
SourceFile DEBUG [Typeinference]
|
|
||||||
JavaFiles:
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse2 extends Object
|
|
||||||
{
|
{
|
||||||
Klasse1 var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int testMethode()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
var1 = new Klasse1();
|
};
|
||||||
return var1.getVar1();;
|
};
|
||||||
}
|
Matrix Matrix()
|
||||||
Klasse2 Klasse2()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]]
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
SourceFile DEBUG [Typeinference]
|
|
||||||
JavaFiles:
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse2 extends Object
|
|
||||||
{
|
{
|
||||||
Klasse1 var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int testMethode()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
var1 = new Klasse1();
|
};
|
||||||
return var1.getVar1();;
|
};
|
||||||
}
|
Matrix Matrix()
|
||||||
Klasse2 Klasse2()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Block DEBUG [Typeinference] Prozessing statement: null Return var1
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
Block DEBUG [Typeinference] Prozessing statement: TPH L Return var1: TPH D
|
|
||||||
Class DEBUG [Typeinference] Erstellte Constraints: TPH D < TPH D
|
|
||||||
TPH D < TPH L
|
|
||||||
TPH L < int
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH D <. TPH D), (TPH D <. TPH L), (TPH L <. int)]]
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH D = int), (TPH L = int)]]
|
|
||||||
SourceFile DEBUG [Typeinference]
|
|
||||||
JavaFiles:
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH D = int), (TPH L = int)]
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse1 extends Object
|
|
||||||
{
|
{
|
||||||
int var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int getVar1()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
return var1;
|
};
|
||||||
}
|
};
|
||||||
Klasse1 Klasse1()
|
Matrix Matrix()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse1Method Assumptions:
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
[MethodAssumption: int int { [null Return var1], MethodAssumption: Klasse1 null { []]
|
|
||||||
FieldVar Assumptions:
|
|
||||||
[typinferenz.assumptions.FieldAssumption@744578e0]
|
|
||||||
LocalVar Assumptions:
|
|
||||||
[]
|
|
||||||
Parameter Assumptions:
|
|
||||||
[]
|
|
||||||
|
|
||||||
Block DEBUG [Typeinference] Prozessing statement: null Return var1
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
Block DEBUG [Typeinference] Prozessing statement: TPH M Return var1: TPH F
|
|
||||||
Class DEBUG [Typeinference] Erstellte Constraints: TPH F < TPH F
|
|
||||||
TPH F < TPH M
|
|
||||||
TPH M < int
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH F <. TPH F), (TPH F <. TPH M), (TPH M <. int)]]
|
|
||||||
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH F = int), (TPH M = int)]]
|
|
||||||
SourceFile DEBUG [Typeinference]
|
|
||||||
JavaFiles:
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH F = int), (TPH M = int)]
|
|
||||||
|
|
||||||
SourceFile DEBUG [Typeinference] class Klasse1 extends Object
|
|
||||||
{
|
{
|
||||||
int var1;
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
int getVar1()
|
return (FunN f) -> {
|
||||||
{
|
return f.apply(this, m);;
|
||||||
return var1;
|
};
|
||||||
}
|
};
|
||||||
Klasse1 Klasse1()
|
Matrix Matrix()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
|
||||||
|
|
||||||
|
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
|
||||||
|
{
|
||||||
|
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
|
||||||
|
return (FunN f) -> {
|
||||||
|
return f.apply(this, m);;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Matrix Matrix()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user