Umstrukturierung zu de.dhbwstuttgart-Packagenamen
This commit is contained in:
parent
c90f1404ab
commit
9f97bef6cd
7
bin/.gitignore
vendored
7
bin/.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
/bytecode
|
||||
/de
|
||||
/myJvmDisassembler
|
||||
/mycompiler
|
||||
/parser
|
||||
/plugindevelopment
|
||||
/mycompiler
|
||||
/mytypereconstruction
|
||||
/syntaxTree
|
||||
/userinterface
|
||||
|
6
bin/bytecode/FieldTest.jav
Normal file
6
bin/bytecode/FieldTest.jav
Normal file
@ -0,0 +1,6 @@
|
||||
class FieldTest{
|
||||
String var;
|
||||
String methode(String para1){
|
||||
return var;
|
||||
}
|
||||
}
|
3
bin/parser/BoundedParameter.jav
Normal file
3
bin/parser/BoundedParameter.jav
Normal file
@ -0,0 +1,3 @@
|
||||
class Matrix{
|
||||
<A extends B, C extends B> String op = "String";
|
||||
}
|
3
bin/parser/FieldInitializationTest.jav
Normal file
3
bin/parser/FieldInitializationTest.jav
Normal file
@ -0,0 +1,3 @@
|
||||
class FieldInitializationTest{
|
||||
String var = "hallo";
|
||||
}
|
3
bin/parser/GenericFieldVarTest.jav
Normal file
3
bin/parser/GenericFieldVarTest.jav
Normal file
@ -0,0 +1,3 @@
|
||||
class Test{
|
||||
<A> A var;
|
||||
}
|
4
bin/parser/ImportTest.jav
Normal file
4
bin/parser/ImportTest.jav
Normal file
@ -0,0 +1,4 @@
|
||||
import java.util.*;
|
||||
|
||||
class ImportTest{
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package myJvmDisassembler;
|
||||
package de.dhbwstuttgart.JvmDisassembler;
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package myJvmDisassembler;
|
||||
package de.dhbwstuttgart.JvmDisassembler;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.*;
|
@ -6,17 +6,18 @@ package de.dhbwstuttgart.core;
|
||||
// ino.module.AClassOrInterface.8526.import
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
|
||||
// ino.class.AClassOrInterface.21186.description type=javadoc
|
||||
/**
|
||||
|
@ -1,16 +1,13 @@
|
||||
package userinterface;
|
||||
package de.dhbwstuttgart.core;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.varia.NullAppender;
|
||||
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
import de.dhbwstuttgart.core.MyCompilerAPI;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
public class ConsoleInterface {
|
@ -22,6 +22,9 @@ import com.sun.org.apache.xerces.internal.impl.xs.identity.Field;
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.parser.JavaParser;
|
||||
import de.dhbwstuttgart.parser.Scanner;
|
||||
import de.dhbwstuttgart.parser.JavaParser.yyException;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassBody;
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
@ -45,9 +48,6 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.ParserError;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaParser;
|
||||
import de.dhbwstuttgart.typeinference.parser.Scanner;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaParser.yyException;
|
||||
|
||||
|
||||
|
||||
|
@ -11,12 +11,12 @@ import java.util.Vector;
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.parser.JavaParser;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.ParserError;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaParser;
|
||||
|
||||
// ino.class.MyCompilerAPI.21328.description type=javadoc
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
|
||||
import java.util.Vector;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ino.module.ClassAndParameter.8613.package
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
// ino.end
|
||||
|
||||
// ino.module.ClassAndParameter.8613.import
|
@ -1,4 +1,4 @@
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
|
||||
import java.util.Vector;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ino.module.InterfaceAndParameter.8614.package
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
// ino.end
|
||||
|
||||
// ino.module.InterfaceAndParameter.8614.import
|
@ -1,5 +1,5 @@
|
||||
// ino.module.InterfaceList.8615.package
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
// ino.end
|
||||
|
||||
// ino.module.InterfaceList.8615.import
|
@ -1,4 +1,4 @@
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
|
||||
import java.util.Vector;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* *
|
||||
********************************************/
|
||||
// user code:
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
|
||||
|
||||
public class JavaLexer {
|
@ -6,7 +6,7 @@
|
||||
Backup von JavaParser.jay 10.April 17 Uhr
|
||||
*/
|
||||
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
@ -28,6 +28,14 @@ import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Abstract;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Final;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifier;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Private;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Protected;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Public;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Static;
|
||||
import de.dhbwstuttgart.syntaxtree.operator.AndOp;
|
||||
import de.dhbwstuttgart.syntaxtree.operator.DivideOp;
|
||||
import de.dhbwstuttgart.syntaxtree.operator.EqualOp;
|
||||
@ -98,14 +106,6 @@ import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Void;
|
||||
import de.dhbwstuttgart.syntaxtree.type.WildcardType;
|
||||
import mycompiler.mymodifier.Abstract;
|
||||
import mycompiler.mymodifier.Final;
|
||||
import mycompiler.mymodifier.Modifier;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
import mycompiler.mymodifier.Private;
|
||||
import mycompiler.mymodifier.Protected;
|
||||
import mycompiler.mymodifier.Public;
|
||||
import mycompiler.mymodifier.Static;
|
||||
|
||||
public class JavaParser{
|
||||
public Vector path = new Vector();
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Scanner.8618.package
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
// ino.end
|
||||
// ino.class.Scanner.24842.declaration
|
||||
public class Scanner extends JavaLexer implements JavaParser.yyInput
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Token.8619.package
|
||||
package de.dhbwstuttgart.typeinference.parser;
|
||||
package de.dhbwstuttgart.parser;
|
||||
// ino.end
|
||||
// ino.class.Token.24859.declaration
|
||||
public class Token
|
@ -3,8 +3,7 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
// ino.end
|
||||
|
||||
// ino.module.BasicAssumptionClass.8552.import
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
// ino.end
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
|
||||
// ino.class.BasicAssumptionClass.23000.declaration
|
||||
public class BasicAssumptionClass extends Class
|
||||
|
@ -9,72 +9,13 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mybytecode.ClassFile;
|
||||
import mycompiler.myexception.CTypeReconstructionException;
|
||||
import mycompiler.myexception.JVMCodeException;
|
||||
import mycompiler.myexception.SCClassBodyException;
|
||||
import mycompiler.myexception.SCClassException;
|
||||
import mycompiler.myexception.SCExcept;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
import mycompiler.mystatement.*;
|
||||
import mycompiler.mytypereconstruction.CReconstructionTuple;
|
||||
import mycompiler.mytypereconstruction.CSubstitution;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CReconstructionTupleSet;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.set.IHashSetKey;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumptionkey.CMethodKey;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.core.AClassOrInterface;
|
||||
import de.dhbwstuttgart.core.IItemWithOffset;
|
||||
import de.dhbwstuttgart.core.SourceFile;
|
||||
import de.dhbwstuttgart.core.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Statement;
|
||||
@ -90,7 +31,6 @@ import de.dhbwstuttgart.typeinference.assumptions.ClassAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import de.dhbwstuttgart.typeinference.unify.FC_TTO;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
@ -387,23 +327,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
|
||||
return classfile;
|
||||
}
|
||||
*/
|
||||
public void codegen(ClassFile classfile, Vector paralist)
|
||||
throws JVMCodeException
|
||||
{
|
||||
for(int i=0 ; i < this.getFields().size() ; i++)
|
||||
{
|
||||
/*
|
||||
* if(this.fielddecl.elementAt(i) instanceof InstVarDecl)
|
||||
{
|
||||
((InstVarDecl)this.fielddecl.elementAt(i)).codegen(classfile, paralist);
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
this.fielddecl.elementAt(i).codegen(classfile, paralist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void set_UsedId (UsedId uid)
|
||||
// ino.end
|
||||
@ -655,7 +578,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
|
||||
// ino.end
|
||||
// ino.method.TRProg.23110.definition
|
||||
public ConstraintsSet typeReconstruction(FC_TTO supportData, TypeAssumptions globalAssumptions)
|
||||
throws CTypeReconstructionException
|
||||
// ino.end
|
||||
// ino.method.TRProg.23110.body
|
||||
{
|
||||
@ -911,30 +833,7 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
// ino.method.clear.23113.defdescription type=javadoc
|
||||
/**
|
||||
* Entfernt Annahmen f�r lokale Variablen, die f�r Methodenparameter erzeugt
|
||||
* worden sind. (siehe Algorithmus 5.17 TRProg, Martin Pl�micke)
|
||||
* <br/>Author: J�rg B�uerle
|
||||
* @param V
|
||||
* @param locals
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.clear.23113.definition
|
||||
void clear(CTypeAssumptionSet V, Vector<CTypeAssumption> locals)
|
||||
// ino.end
|
||||
// ino.method.clear.23113.body
|
||||
{
|
||||
Iterator<CTypeAssumption> localsIt = locals.iterator();
|
||||
while(localsIt.hasNext()){
|
||||
CTypeAssumption local = localsIt.next();
|
||||
CTypeAssumption assum = V.getElement(local.getHashSetKey());
|
||||
if(assum!=null){
|
||||
V.removeElement(local.getHashSetKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.RetType.23119.defdescription type=javadoc
|
||||
/**
|
||||
@ -1037,127 +936,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
|
||||
//
|
||||
// }
|
||||
|
||||
// ino.method.addOffsetsToAssumption.23131.defdescription type=javadoc
|
||||
/**
|
||||
* Methode f�gt zu einer CTypeAssumption alle
|
||||
* Offsets hinzu, wo die Variable benutzt wird.
|
||||
* <br/>Author: Thomas Hornberger 07.04.2006
|
||||
* <br/>Author: Arne Lüdtke 20.01.2007, Auf Polymorphie erweitert.
|
||||
* Wird nicht mehr verwendet. In Block ausgelagert.
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToAssumption.23131.definition
|
||||
public static void addOffsetsToAssumption(CTypeAssumption localAssumption, Block localBlock,String NameVariable,boolean isMemberVariable)
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToAssumption.23131.body
|
||||
{
|
||||
/*if(localBlock!=null){
|
||||
for(Object vectorObjekt : localBlock.statements) //durchlaufe alle Statements dieses Blocks
|
||||
{
|
||||
if(vectorObjekt instanceof Block) //Bei Block
|
||||
{
|
||||
Block b = (Block)vectorObjekt;
|
||||
addOffsetsToAssumption(localAssumption,b,NameVariable,isMemberVariable);//rekursiver Aufruf
|
||||
}
|
||||
else
|
||||
{
|
||||
String Name_Superklasse = vectorObjekt.getClass().getSuperclass().getSimpleName();
|
||||
if(Name_Superklasse.equals("Statement")) //Bei Statement
|
||||
{
|
||||
Statement s = (Statement)vectorObjekt;
|
||||
try{
|
||||
if(addOffsetsToStatement(localAssumption,s,NameVariable,isMemberVariable)==false)
|
||||
{break;}}
|
||||
catch(NullPointerException NPE){}
|
||||
}
|
||||
else if(Name_Superklasse.equals("Expr") || Name_Superklasse.equals("BinaryExpr") || Name_Superklasse.equals("UnaryExpr")) //Bei Expression
|
||||
{
|
||||
Expr e = (Expr)vectorObjekt;
|
||||
try{
|
||||
addOffsetsToExpression(localAssumption,e,NameVariable,isMemberVariable);}
|
||||
catch(NullPointerException NPE){}
|
||||
}
|
||||
}
|
||||
|
||||
}}*/
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.addOffsetsToStatement.23134.defdescription type=javadoc
|
||||
/**
|
||||
* Hilfs-Methode f�r die Offset-Zuweisung
|
||||
* durchsucht ein Statement rekursiv
|
||||
* <br/>Author: Thomas Hornberger 08.04.2006
|
||||
* <br/>Author: Arne Lüdtke 20.10.2007, Auf Polymorphie umgebaut.
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToStatement.23134.definition
|
||||
public static boolean addOffsetsToStatement(CTypeAssumption localAssumption,Statement statement, String NameVariable, boolean isMemberVariable)
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToStatement.23134.body
|
||||
{
|
||||
return statement.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
/*if(statement instanceof Block) //Wenn Block
|
||||
{
|
||||
Block b = (Block)statement;
|
||||
addOffsetsToAssumption(localAssumption,b,NameVariable,isMemberVariable);
|
||||
}
|
||||
else if(statement instanceof IfStmt)//Wenn if
|
||||
{
|
||||
IfStmt i = (IfStmt)statement;
|
||||
addOffsetsToExpression(localAssumption,i.expr,NameVariable,isMemberVariable);
|
||||
addOffsetsToStatement(localAssumption,i.else_block,NameVariable,isMemberVariable);
|
||||
addOffsetsToStatement(localAssumption,i.then_block,NameVariable,isMemberVariable);
|
||||
}
|
||||
else if(statement instanceof Return)//Wenn Return
|
||||
{
|
||||
Return r = (Return)statement;
|
||||
addOffsetsToExpression(localAssumption,r.retexpr,NameVariable,isMemberVariable);
|
||||
}
|
||||
else if(statement instanceof WhileStmt)//Wenn While
|
||||
{
|
||||
WhileStmt w = (WhileStmt)statement;
|
||||
addOffsetsToExpression(localAssumption,w.expr,NameVariable,isMemberVariable);
|
||||
addOffsetsToStatement(localAssumption,w.loop_block,NameVariable,isMemberVariable);
|
||||
}
|
||||
else if(statement instanceof LocalVarDecl)//Wenn Lokale-Variable-Deklaration
|
||||
{
|
||||
isMemberVariable=true;//hoth 02.05.06
|
||||
if(isMemberVariable)//Wenn Objektvariable
|
||||
{
|
||||
LocalVarDecl l = (LocalVarDecl)statement;
|
||||
if(l.get_Name().equals(NameVariable))
|
||||
{
|
||||
if(isFirstLocalVarDecl==false)
|
||||
{return false;}//Wenn jetzt lokale Variable kommt, dann springe raus
|
||||
else
|
||||
{isFirstLocalVarDecl=false;}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;*/
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.addOffsetsToExpression.23137.defdescription type=javadoc
|
||||
/**
|
||||
* Hilfs-Methode f�r die Offset-Zuweisung
|
||||
* durchsucht eine Expression rekursiv
|
||||
* <br/>Author: Thomas Hornberger 07.04.2006
|
||||
* <br/>Authos: Arne Lüdtke 20.01.2007, Auf Polymorphie umgebaut.
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToExpression.23137.definition
|
||||
public static void addOffsetsToExpression(CTypeAssumption localAssumption,Expr expression, String NameVariable,boolean isMemberVariable)
|
||||
// ino.end
|
||||
// ino.method.addOffsetsToExpression.23137.body
|
||||
{
|
||||
expression.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.getSimpleName.23140.defdescription type=javadoc
|
||||
/**
|
||||
|
@ -10,17 +10,15 @@ import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Literal;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
// ino.end
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
|
||||
// ino.class.Constant.23212.description type=javadoc
|
||||
/**
|
||||
@ -225,11 +223,6 @@ public class Constant extends Method
|
||||
//return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeLineNumber() {
|
||||
|
@ -4,7 +4,9 @@ import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
@ -17,9 +19,6 @@ import de.dhbwstuttgart.typeinference.assumptions.ConstructorAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.MethodAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
|
||||
public class Constructor extends Method {
|
||||
private Method methode;
|
||||
@ -179,12 +178,6 @@ public class Constructor extends Method {
|
||||
this.methode.setOffset(Offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
|
||||
this.methode.replaceType(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeLineNumber() {
|
||||
|
||||
|
@ -17,7 +17,6 @@ import de.dhbwstuttgart.typeinference.TypeInsertable;
|
||||
import de.dhbwstuttgart.typeinference.Typeable;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
|
||||
public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Typeable, Generic, GenericTypeInsertable{
|
||||
|
||||
|
@ -18,7 +18,6 @@ import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.FieldAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
|
||||
/**
|
||||
* Eine Feldinitialisation steht für eine Felddeklaration mit gleichzeitiger Wertzuweisung
|
||||
@ -111,17 +110,6 @@ public class FieldDeclaration extends Field{
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getTypeLineNumber() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getVariableLength()
|
||||
{
|
||||
return declid.elementAt(0).get_Name().length();
|
||||
|
@ -5,34 +5,7 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
// ino.module.FormalParameter.8561.import
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
@ -48,7 +21,7 @@ import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
// ino.class.FormalParameter.23391.declaration
|
||||
public class FormalParameter extends SyntaxTreeNode implements ITypeReplacementListener, Typeable, TypeInsertable
|
||||
public class FormalParameter extends SyntaxTreeNode implements Typeable, TypeInsertable
|
||||
// ino.end
|
||||
// ino.class.FormalParameter.23391.body
|
||||
{
|
||||
@ -91,13 +64,6 @@ public class FormalParameter extends SyntaxTreeNode implements ITypeReplacementL
|
||||
// ino.end
|
||||
// ino.method.setType.23404.body
|
||||
{
|
||||
if(this.type instanceof TypePlaceholder){
|
||||
((TypePlaceholder)this.type).removeReplacementListener(this);
|
||||
}
|
||||
|
||||
if(t instanceof TypePlaceholder){
|
||||
((TypePlaceholder)t).addReplacementListener(this);
|
||||
}
|
||||
this.type = t;
|
||||
}
|
||||
// ino.end
|
||||
@ -188,24 +154,6 @@ public class FormalParameter extends SyntaxTreeNode implements ITypeReplacementL
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.replaceType.23428.defdescription type=javadoc
|
||||
/**
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param e
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.replaceType.23428.definition
|
||||
public void replaceType(CReplaceTypeEvent e)
|
||||
// ino.end
|
||||
// ino.method.replaceType.23428.body
|
||||
{
|
||||
inferencelog.debug("Ersetze Typ in FormalParameter \""+this.getIdentifier()+"\"");
|
||||
if(type instanceof TypePlaceholder){
|
||||
((TypePlaceholder)type).removeReplacementListener(this);
|
||||
}
|
||||
this.setType(e.getNewType());
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.getTypeLineNumber.23431.defdescription type=javadoc
|
||||
/**
|
||||
|
@ -2,8 +2,8 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.parser.GenericVarDeclarationList;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.typeinference.parser.GenericVarDeclarationList;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -9,11 +9,11 @@ import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.core.AClassOrInterface;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
|
||||
/**
|
||||
* Ein Interface ist eine abstrakte Klasse, erbt daher von Class
|
||||
|
@ -7,8 +7,7 @@ import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
// ino.end
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
|
||||
// ino.class.InterfaceBody.23984.description type=javadoc
|
||||
/**
|
||||
|
@ -7,16 +7,6 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
@ -25,7 +15,9 @@ import de.dhbwstuttgart.core.MyCompiler;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.myexception.SCMethodException;
|
||||
import de.dhbwstuttgart.myexception.SCStatementException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Block;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Return;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
@ -41,7 +33,6 @@ import de.dhbwstuttgart.typeinference.assumptions.MethodAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.ParameterAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
|
||||
|
||||
@ -204,14 +195,6 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
||||
// ino.end
|
||||
// ino.method.setReturnType.23539.body
|
||||
{
|
||||
if(this.returntype instanceof TypePlaceholder){
|
||||
((TypePlaceholder)this.returntype).removeReplacementListener(this);
|
||||
}
|
||||
|
||||
if(type instanceof TypePlaceholder){
|
||||
((TypePlaceholder)type).addReplacementListener(this);
|
||||
}
|
||||
// this.returntype = type; //auskommentiert von Andreas Stadelmeier (a10023)
|
||||
this.returntype = type;
|
||||
}
|
||||
// ino.end
|
||||
@ -423,24 +406,6 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.replaceType.23599.defdescription type=javadoc
|
||||
/**
|
||||
* <br>Author: Jrg Buerle
|
||||
* @param e
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.replaceType.23599.definition
|
||||
public void replaceType(CReplaceTypeEvent e)
|
||||
// ino.end
|
||||
// ino.method.replaceType.23599.body
|
||||
{
|
||||
inferencelog.debug("Ersetze Typ in Method \""+this.get_Method_Name()+"()\"\n");
|
||||
if(returntype instanceof TypePlaceholder){
|
||||
((TypePlaceholder)returntype).removeReplacementListener(this);
|
||||
}
|
||||
this.setReturnType(e.getNewType());
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.getTypeLineNumber.23602.defdescription type=javadoc
|
||||
/**
|
||||
|
@ -4,7 +4,6 @@ package de.dhbwstuttgart.syntaxtree;
|
||||
// ino.module.ParameterList.8565.import
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytype.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
|
@ -10,15 +10,6 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
import mycompiler.mymodifier.Public;
|
||||
import mycompiler.mytypereconstruction.CIntersectionType;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
@ -28,8 +19,11 @@ import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.myexception.SCClassException;
|
||||
import de.dhbwstuttgart.myexception.SCException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Public;
|
||||
import de.dhbwstuttgart.syntaxtree.type.BooleanType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
@ -50,11 +44,8 @@ import de.dhbwstuttgart.typeinference.assumptions.ParameterAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.unify.FC_TTO;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.myclass.*;
|
||||
import mycompiler.*;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import sun.reflect.generics.reflectiveObjects.TypeVariableImpl;
|
||||
|
||||
@ -1177,9 +1168,6 @@ public class SourceFile
|
||||
|
||||
for(int j=0;j<fields.length;j++){
|
||||
if(java.lang.reflect.Modifier.isPublic(fields[j].getModifiers())){
|
||||
//CInstVarTypeAssumption instVar = new CInstVarTypeAssumption(className, fields[j].getName(), new RefType(fields[j].getType().getSimpleName()), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector<Integer>());
|
||||
CInstVarTypeAssumption instVar = new CInstVarTypeAssumption(className, fields[j].getName(), new RefType(fields[j].getType().getName(),-1), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector<Integer>());
|
||||
//basicAssumptions.addFieldOrLocalVarAssumption(instVar);
|
||||
parentClass.addField(new FieldDeclaration(fields[j].getName(),new RefType(fields[j].getType().getName(),-1)));
|
||||
}
|
||||
}
|
||||
@ -1218,7 +1206,6 @@ public class SourceFile
|
||||
for(int j=0;j<constructors.length;j++){
|
||||
if(java.lang.reflect.Modifier.isPublic(constructors[j].getModifiers())){
|
||||
String methodName=className;
|
||||
CMethodTypeAssumption constructor = new CMethodTypeAssumption(new RefType(className, 0), methodName, new RefType(className,-1), constructors[j].getParameterTypes().length,MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector<Integer>(),null);
|
||||
ParameterList paraList = new ParameterList();
|
||||
for(int k=0;k<constructors[j].getParameterTypes().length;k++){
|
||||
String paraType=constructors[j].getParameterTypes()[k].getName();
|
||||
@ -1227,7 +1214,6 @@ public class SourceFile
|
||||
FormalParameter fpara = new FormalParameter(new DeclId("p"+k));
|
||||
fpara.setType(new RefType(paraType,-1));
|
||||
paraList.formalparameter.add(fpara);
|
||||
constructor.addParaAssumption(new CParaTypeAssumption(className, methodName, constructors[j].getParameterTypes().length,0,paraType, new RefType(paraType,-1), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector<Integer>()));
|
||||
}
|
||||
//basicAssumptions.addMethodIntersectionType(new CIntersectionType(constructor));
|
||||
Method constructorMethod = de.dhbwstuttgart.syntaxtree.Method.createEmptyMethod(methodName, parentClass);
|
||||
|
@ -4,9 +4,6 @@ package de.dhbwstuttgart.syntaxtree.misc;
|
||||
// ino.module.DeclId.8558.import
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mymodifier.Final;
|
||||
import mycompiler.mymodifier.Modifiers;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
@ -15,6 +12,7 @@ import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.Attribute;
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
@ -23,6 +21,8 @@ import de.dhbwstuttgart.bytecode.SignatureInfo;
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.syntaxtree.Constant;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Final;
|
||||
import de.dhbwstuttgart.syntaxtree.modifier.Modifiers;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Assign;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ExprStmt;
|
||||
|
@ -2,9 +2,6 @@
|
||||
package de.dhbwstuttgart.syntaxtree.misc;
|
||||
// ino.end
|
||||
|
||||
// ino.module.Status.8566.import
|
||||
import mycompiler.unused.Import;
|
||||
// ino.end
|
||||
|
||||
// ino.class.Status.23644.declaration
|
||||
public abstract class Status
|
||||
@ -14,9 +11,6 @@ public abstract class Status
|
||||
// ino.attribute.userdef.23647.declaration
|
||||
protected UserDef userdef;
|
||||
// ino.end
|
||||
// ino.attribute.imp.23650.declaration
|
||||
protected Import imp;
|
||||
// ino.end
|
||||
|
||||
// ino.method.set_UserDef.23653.definition
|
||||
public void set_UserDef( UserDef userdef)
|
||||
@ -26,13 +20,6 @@ public abstract class Status
|
||||
this.userdef = userdef;
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.set_Import.23656.definition
|
||||
public void set_Import(Import imp)
|
||||
// ino.end
|
||||
// ino.method.set_Import.23656.body
|
||||
{
|
||||
this.imp = imp;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
@ -7,11 +7,11 @@ import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
import de.dhbwstuttgart.core.IItemWithOffset;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
|
||||
|
||||
// ino.class.UsedId.23659.declaration
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Abstract.8585.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Final.8586.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Modifier.8587.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Modifiers.8588.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
// ino.end
|
||||
|
||||
// ino.module.Modifiers.8588.import
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Private.8589.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Protected.8590.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Public.8591.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,5 +1,5 @@
|
||||
// ino.module.Static.8592.package
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package mycompiler.mymodifier;
|
||||
package de.dhbwstuttgart.syntaxtree.modifier;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
@ -22,11 +22,6 @@ import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
|
||||
|
||||
|
@ -16,11 +16,6 @@ import de.dhbwstuttgart.syntaxtree.statement.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
|
||||
|
||||
|
@ -26,11 +26,6 @@ import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
|
||||
|
||||
|
@ -16,11 +16,6 @@ import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
// ino.class.MulOp.24231.declaration
|
||||
public abstract class MulOp extends Operator
|
||||
|
@ -16,14 +16,6 @@ import de.dhbwstuttgart.syntaxtree.statement.Null;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
|
||||
|
||||
|
||||
// ino.class.NotEqualOp.24241.declaration
|
||||
public class NotEqualOp extends RelOp
|
||||
|
@ -26,12 +26,6 @@ import de.dhbwstuttgart.typeinference.UndConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -19,12 +19,6 @@ import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
// ino.class.RelOp.24299.declaration
|
||||
public abstract class RelOp extends Operator
|
||||
// ino.end
|
||||
|
@ -7,31 +7,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CMultiplyTuple;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CMultiplyTupleSet;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -39,6 +16,7 @@ import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.myexception.SCExcept;
|
||||
import de.dhbwstuttgart.myexception.SCStatementException;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
@ -52,7 +30,6 @@ import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -257,11 +234,6 @@ public class Assign extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr1.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
expr2.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeInformation(){
|
||||
|
@ -7,32 +7,8 @@ import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -59,6 +35,7 @@ import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.UndConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -266,12 +243,6 @@ public class Binary extends BinaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr1.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
expr2.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -7,31 +7,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
@ -51,6 +28,7 @@ import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -186,43 +164,6 @@ public class Block extends Statement
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToAssumption(CTypeAssumption localAssumption, String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
for(Object vectorObjekt : this.statements) //durchlaufe alle Statements dieses Blocks
|
||||
{
|
||||
if(vectorObjekt instanceof Block) //Bei Block
|
||||
{
|
||||
Block b = (Block)vectorObjekt;
|
||||
b.addOffsetsToAssumption(localAssumption,NameVariable,isMemberVariable);//rekursiver Aufruf
|
||||
}
|
||||
else
|
||||
{
|
||||
String Name_Superklasse = vectorObjekt.getClass().getSuperclass().getSimpleName();
|
||||
if(Name_Superklasse.equals("Statement")) //Bei Statement
|
||||
{
|
||||
Statement s = (Statement)vectorObjekt;
|
||||
try{
|
||||
if(s.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable)==false)
|
||||
{break;}}
|
||||
catch(NullPointerException NPE){}
|
||||
}
|
||||
else if(Name_Superklasse.equals("Expr") || Name_Superklasse.equals("BinaryExpr") || Name_Superklasse.equals("UnaryExpr")) //Bei Expression
|
||||
{
|
||||
Expr e = (Expr)vectorObjekt;
|
||||
try{
|
||||
e.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);}
|
||||
catch(NullPointerException NPE){}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
addOffsetsToAssumption(localAssumption,NameVariable,isMemberVariable);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
@ -256,9 +197,6 @@ public class Block extends Statement
|
||||
this.setType(tph);
|
||||
}
|
||||
}
|
||||
if (this.type instanceof TypePlaceholder) {
|
||||
((TypePlaceholder)this.type).addReplacementListener(this);
|
||||
}
|
||||
}else{
|
||||
this.setType(new Void(0));
|
||||
}
|
||||
@ -281,11 +219,6 @@ public class Block extends Statement
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
super.replaceType(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeInformation(){
|
||||
String ret = "\n";
|
||||
|
@ -5,27 +5,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -41,6 +21,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -141,51 +122,6 @@ public class BoolLiteral extends Literal
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25117.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25117.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRExp.25120.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>BooleanType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25120.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25120.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Boolean",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25123.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25123.body
|
||||
{
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@ -211,5 +147,15 @@ public class BoolLiteral extends Literal
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void wandleRefTypeAttributes2GenericAttributes(
|
||||
Vector<Type> paralist,
|
||||
Vector<GenericTypeVar> genericMethodParameters) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
@ -6,28 +6,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -43,6 +22,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -141,11 +121,6 @@ public class CastExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -4,29 +4,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.CharLiteral.8628.import
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -42,6 +20,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -133,54 +112,6 @@ public class CharLiteral extends Literal
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25194.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25194.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRExp.25197.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>CharacterType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25197.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25197.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Character",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25200.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25200.body
|
||||
{
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
// TODO Auto-generated method stub
|
||||
@ -198,5 +129,13 @@ public class CharLiteral extends Literal
|
||||
Vector<SyntaxTreeNode> ret = new Vector<SyntaxTreeNode>();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void wandleRefTypeAttributes2GenericAttributes(
|
||||
Vector<Type> paralist,
|
||||
Vector<GenericTypeVar> genericMethodParameters) {
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
@ -5,12 +5,6 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@ -31,6 +25,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
// ino.end
|
||||
|
||||
@ -145,42 +140,6 @@ public class DoubleLiteral extends Literal
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25478.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25478.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25481.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>IntegerType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Double",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25484.defdescription type=javadoc
|
||||
/**
|
||||
* <br/>Author: Martin Pl<EFBFBD>micke
|
||||
|
@ -5,28 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
@ -39,6 +19,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -80,14 +61,6 @@ public class EmptyStmt extends Statement
|
||||
{ }
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25219.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25219.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25222.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
@ -97,10 +70,6 @@ public class EmptyStmt extends Statement
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
@ -108,12 +77,6 @@ public class EmptyStmt extends Statement
|
||||
return null;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getTypeLineNumber() {
|
||||
throw new NotImplementedException();
|
||||
|
@ -15,17 +15,6 @@ import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import mycompiler.mytypereconstruction.CMultiplyTuple;
|
||||
import mycompiler.mytypereconstruction.CSubstitution;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CMultiplyTupleSet;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
@ -120,14 +109,5 @@ public abstract class Expr extends ExprStmt
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions){
|
||||
throw new NotImplementedException(); //wird die TYPEStmt-Methode innerhalb einer Expr aufgerufen, dann ist etwas schief gelaufen.
|
||||
}
|
||||
|
||||
|
||||
public abstract void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable);
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
@ -6,18 +6,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
@ -25,7 +14,7 @@ import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
// ino.class.ExprStmt.25265.declaration
|
||||
public abstract class ExprStmt extends Statement implements ITypeReplacementListener
|
||||
public abstract class ExprStmt extends Statement
|
||||
// ino.end
|
||||
// ino.class.ExprStmt.25265.body
|
||||
{
|
||||
|
@ -5,12 +5,6 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
@ -139,41 +133,6 @@ public class FloatLiteral extends Literal
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25478.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25478.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25481.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>IntegerType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Float",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25484.defdescription type=javadoc
|
||||
/**
|
||||
|
@ -5,13 +5,6 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@ -105,24 +98,12 @@ public class ForStmt extends Statement
|
||||
|
||||
}
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
head_Initializer_1.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
body_Loop_block.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int getTypeLineNumber() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -7,32 +7,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSubstitution;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -255,116 +230,7 @@ public class IfStmt extends Statement
|
||||
|
||||
|
||||
|
||||
// ino.method.makeNewResult.25343.definition
|
||||
private void makeNewResult(MUB Mub, CTriple triple, CTypeAssumptionSet V, CTripleSet returnSet)
|
||||
throws CTypeReconstructionException
|
||||
// ino.end
|
||||
// ino.method.makeNewResult.25343.body
|
||||
{
|
||||
CSubstitutionSet unifier = new CSubstitutionSet(Mub.getUnifier());
|
||||
// --------------------------
|
||||
// Typannahmen bauen:
|
||||
// --------------------------
|
||||
CTypeAssumptionSet V_substituted = V.deepCopy();
|
||||
V_substituted.sub(unifier);
|
||||
// --------------------------
|
||||
// Substitutionen bauen:
|
||||
// --------------------------
|
||||
CSubstitutionSet substSet = triple.getSubstitutions().deepCopy();
|
||||
substSet.applyUnifier(unifier);
|
||||
substSet.unite(unifier);
|
||||
// --------------------------
|
||||
// R<EFBFBD>ckgabetyp bauen:
|
||||
// --------------------------
|
||||
Iterator<? extends Type> setMubIt = Mub.getMub().iterator();
|
||||
|
||||
while(setMubIt.hasNext()) {
|
||||
Type retType = setMubIt.next();
|
||||
Type retType2 = substSet.applyThisSubstitutionSet(retType.clone());
|
||||
// Muesste eigentlich cloneAndApplyUnify machen PL 06-03-18
|
||||
// If(Rettype Instanceof TypePlaceholders){
|
||||
// Iterator<Csubstitution> Pairit = Unifier.Getiterator();
|
||||
// While(Pairit.Hasnext()){
|
||||
// Csubstitution Pair = Pairit.Next();
|
||||
// If(Pair.Gettypevar().Getname().Equals(Rettype.Getname())){
|
||||
// Rettype = Pair.Gettype();
|
||||
// Break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// --------------------------
|
||||
CTriple resultTriple = new CTriple(substSet, retType2, V_substituted);
|
||||
//CSubstitutionSet CSubstUnifier = new CSubstitutionSet(unifier);
|
||||
//CTriple resultTriple2 = retTriple.cloneAndApplyUnify(CSubstUnifier);
|
||||
// --------------------------
|
||||
// Triple zu R<EFBFBD>ckgabemenge hinzuf<EFBFBD>gen
|
||||
// --------------------------
|
||||
if(!returnSet.contains(resultTriple)){
|
||||
returnSet.addElement(resultTriple);
|
||||
}
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.applyUnifier.25346.definition
|
||||
private void applyUnifier(Vector<Vector<Pair>> unifierPossibilities, CTriple triple, CTypeAssumptionSet V, CTripleSet returnSet)
|
||||
throws CTypeReconstructionException
|
||||
// ino.end
|
||||
// ino.method.applyUnifier.25346.body
|
||||
{
|
||||
// --------------------------
|
||||
// Wenn Unifier vorhanden, dann anwenden:
|
||||
// --------------------------
|
||||
if(unifierPossibilities.size()!=0){
|
||||
// --------------------------
|
||||
// Alle m<EFBFBD>glichen Unifier auf V_i,j anwenden:
|
||||
// --------------------------
|
||||
for(int k=0; k<unifierPossibilities.size(); k++){
|
||||
CSubstitutionSet unifier = new CSubstitutionSet(unifierPossibilities.elementAt(k));
|
||||
// --------------------------
|
||||
// Typannahmen bauen:
|
||||
// --------------------------
|
||||
CTypeAssumptionSet V_substituted = V.deepCopy();
|
||||
V_substituted.sub(unifier);
|
||||
// --------------------------
|
||||
// Substitutionen bauen:
|
||||
// --------------------------
|
||||
CSubstitutionSet substSet = triple.getSubstitutions().deepCopy();
|
||||
substSet.applyUnifier(unifier);
|
||||
substSet.unite(unifier);
|
||||
// --------------------------
|
||||
// R<EFBFBD>ckgabetyp bauen:
|
||||
// --------------------------
|
||||
Type retType = triple.getResultType();
|
||||
if(retType instanceof TypePlaceholder){
|
||||
Iterator<CSubstitution> pairIt = unifier.getIterator();
|
||||
while(pairIt.hasNext()){
|
||||
CSubstitution pair = pairIt.next();
|
||||
if(pair.getTypeVar().getName().equals(retType.getName())){
|
||||
retType = pair.getType();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// --------------------------
|
||||
CTriple resultTriple = new CTriple(substSet, retType, V_substituted);
|
||||
// --------------------------
|
||||
// Triple zu R<EFBFBD>ckgabemenge hinzuf<EFBFBD>gen
|
||||
// --------------------------
|
||||
if(!returnSet.contains(resultTriple)){
|
||||
returnSet.addElement(resultTriple);
|
||||
}
|
||||
}
|
||||
}
|
||||
// --------------------------
|
||||
// Ansonsten Fehlermeldung:
|
||||
// --------------------------
|
||||
else {
|
||||
throw new CTypeReconstructionException("IfStmt.TRStatement(): Block-Typen lassen sich nicht unifizieren.",this);
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25349.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
@ -380,15 +246,6 @@ public class IfStmt extends Statement
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
else_block.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
then_block.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
@ -408,11 +265,6 @@ public class IfStmt extends Statement
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int getTypeLineNumber() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -6,36 +6,7 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CInstVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumptionkey.CInstVarKey;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
@ -202,60 +173,9 @@ public class InstVar extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25429.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25429.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
// ino.method.handleInstVarAssum.25438.defdescription type=javadoc
|
||||
/**
|
||||
* Unifiziert den R<EFBFBD>ckgabetyp des Receivers mit dem der gefundenen Klasse
|
||||
* <br/>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param triple Triple des Receivers
|
||||
* @param thetaZero Typ der gefundenen Klasse
|
||||
* @param thetaC Typ der InstanzVariable
|
||||
* @param resultSet
|
||||
* @param supportData
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.handleInstVarAssum.25438.definition
|
||||
private void handleInstVarAssum(CTriple triple, Type thetaZero, Type thetaC, CTripleSet resultSet, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.handleInstVarAssum.25438.body
|
||||
{
|
||||
// --------------------------
|
||||
// ReturnType mit Integer unifizieren:
|
||||
// --------------------------
|
||||
Vector<Vector<Pair>> unifierPossibilities = Unify.unify(triple.getResultType(), thetaZero, supportData.getFiniteClosure());
|
||||
// --------------------------
|
||||
// Wenn Unifier vorhanden, dann
|
||||
// anwenden und Triple hinzuf<EFBFBD>gen:
|
||||
// --------------------------
|
||||
if(unifierPossibilities.size()!=0){
|
||||
// --------------------------
|
||||
// Subset bauen:
|
||||
// --------------------------
|
||||
CTripleSet subSet = new CTripleSet();
|
||||
// --------------------------
|
||||
// Alle m<EFBFBD>glichen Unifier anwenden:
|
||||
// --------------------------
|
||||
for(int i=0; i<unifierPossibilities.size(); i++){
|
||||
CSubstitutionSet unifier = new CSubstitutionSet(unifierPossibilities.elementAt(i));
|
||||
CTriple subTriple = triple.cloneAndApplyUnify(unifier);
|
||||
subTriple.setResultType(thetaC);
|
||||
subSet.addElement(subTriple);
|
||||
}
|
||||
resultSet.unite(subSet);
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.toString.25441.defdescription type=javadoc
|
||||
/**
|
||||
@ -280,15 +200,6 @@ public class InstVar extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.get_UsedId().get_Name_1Element().equals(NameVariable))
|
||||
{
|
||||
//wenn Variable mit gleichem Namen gefunden->schreibe Offset
|
||||
localAssumption.addOffset(this.get_UsedId().getOffset());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
ConstraintsSet ret = new ConstraintsSet();
|
||||
|
@ -6,25 +6,7 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
@ -120,24 +102,6 @@ public class InstanceOf extends BinaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25383.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25383.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25386.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25386.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25389.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
@ -146,10 +110,6 @@ public class InstanceOf extends BinaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
|
@ -5,28 +5,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -42,6 +21,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -155,42 +135,6 @@ public class IntLiteral extends Literal
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25478.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25478.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25481.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>IntegerType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Integer",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25484.defdescription type=javadoc
|
||||
/**
|
||||
* <br/>Author: Martin Pl<EFBFBD>micke
|
||||
|
@ -29,13 +29,7 @@ import de.dhbwstuttgart.typeinference.Typeable;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.ParameterAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
/**
|
||||
* @author A10023 - Andreas Stadelmeier
|
||||
@ -117,13 +111,6 @@ public class LambdaExpression extends Expr{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption,
|
||||
String NameVariable, boolean isMemberVariable) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get_Name() {
|
||||
// TODO Auto-generated method stub
|
||||
@ -131,13 +118,6 @@ public class LambdaExpression extends Expr{
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,
|
||||
String NameVariable, boolean isMemberVariable) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Spezifikation:
|
||||
|
@ -5,13 +5,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.Literal.8636.import
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
// ino.end
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
// ino.class.Literal.25490.declaration
|
||||
public abstract class Literal extends Expr
|
||||
@ -55,26 +49,6 @@ public abstract class Literal extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25497.defdescription type=javadoc
|
||||
/**
|
||||
* Implementierung des Algorithmus 5.40 von Martin Pl<EFBFBD>micke
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25497.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25497.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, this.getType(),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.ConstantCodegen.25500.defdescription type=javadoc
|
||||
/**
|
||||
@ -93,8 +67,5 @@ public abstract class Literal extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
@ -6,33 +6,7 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumptionkey.CInstVarKey;
|
||||
import mycompiler.mytypereconstruction.typeassumptionkey.CLocalVarKey;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -54,6 +28,7 @@ import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -173,16 +148,6 @@ public class LocalOrFieldVar extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25531.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25531.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25534.defdescription type=javadoc
|
||||
/**
|
||||
* <br/>Author: Martin Pl<EFBFBD>micke
|
||||
@ -207,14 +172,6 @@ public class LocalOrFieldVar extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.get_UsedId().get_Name_1Element().equals(NameVariable))
|
||||
{
|
||||
//wenn Variable mit gleichem Namen gefunden->schreibe Offset
|
||||
localAssumption.addOffset(this.get_UsedId().getOffset());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
|
@ -6,41 +6,8 @@ import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CLocalVarTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.core.MyCompiler;
|
||||
@ -66,6 +33,7 @@ import de.dhbwstuttgart.typeinference.assumptions.LocalVarAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -348,33 +316,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.replaceType.25608.defdescription type=javadoc
|
||||
/**
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param e
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.replaceType.25608.definition
|
||||
public void replaceType(CReplaceTypeEvent e)
|
||||
// ino.end
|
||||
// ino.method.replaceType.25608.body
|
||||
{
|
||||
if(e.getOldType().equals(this.getType())){
|
||||
inferencelog.debug("Ersetze Typ in LocalVarDecl \""+this.get_Name()+"\"\n");
|
||||
if(getType() instanceof TypePlaceholder){
|
||||
((TypePlaceholder)getType()).removeReplacementListener(this);
|
||||
}
|
||||
this.setType(e.getNewType());
|
||||
}
|
||||
if(e.getOldType().equals(this.getType())){
|
||||
inferencelog.debug("Ersetze Typ in LocalVarDecl \""+this.get_Name()+"\"\n");
|
||||
if(this.getType() instanceof TypePlaceholder){
|
||||
((TypePlaceholder)this.getType()).removeReplacementListener(this);
|
||||
}
|
||||
this.setType(e.getNewType());
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.getTypeLineNumber.25611.defdescription type=javadoc
|
||||
/**
|
||||
@ -391,36 +332,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25614.defdescription type=javadoc
|
||||
/**
|
||||
* Implementierung des Algorithmus 5.24 von Martin Pl<EFBFBD>micke
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25614.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25614.body
|
||||
{
|
||||
CTripleSet resultSet = new CTripleSet();
|
||||
V = V.shallowCopy();
|
||||
CTypeAssumptionSet localSet = new CTypeAssumptionSet();
|
||||
CLocalVarTypeAssumption varAssum = new CLocalVarTypeAssumption(supportData.getCurrentClass(), supportData.getCurrentMethod(), supportData.getCurrentMethodParaCount(), supportData.getCurrentMethodOverloadedID(), supportData.getCurrentBlockId(), this.get_Name() ,this.getType(), this.getLineNumber(),this.getOffset(),new Vector<Integer>());
|
||||
Class.isFirstLocalVarDecl=true;
|
||||
|
||||
if(this.block != null)
|
||||
this.block.addOffsetsToAssumption(varAssum,this.get_Name(),false);//hinzugef<EFBFBD>gt hoth: 07.04.2006
|
||||
|
||||
localSet.addElement(varAssum);
|
||||
V.unite(localSet);
|
||||
resultSet.addElement(new CTriple(sigma, new Void(getOffset()), V));
|
||||
return resultSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25617.defdescription type=javadoc
|
||||
/**
|
||||
@ -457,21 +368,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
isMemberVariable=true;//hoth 02.05.06
|
||||
if(isMemberVariable)//Wenn Objektvariable
|
||||
{
|
||||
if(this.get_Name().equals(NameVariable))
|
||||
{
|
||||
if(Class.isFirstLocalVarDecl==false)
|
||||
{return false;}//Wenn jetzt lokale Variable kommt, dann springe raus
|
||||
else
|
||||
{Class.isFirstLocalVarDecl=false;}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Andreas Stadelmeier, a10023
|
||||
|
@ -5,12 +5,6 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@ -30,6 +24,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
// ino.end
|
||||
|
||||
@ -143,43 +138,6 @@ public class LongLiteral extends Literal
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.25478.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25478.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25481.defdescription type=javadoc
|
||||
/**
|
||||
* Workaround: <EFBFBD>berschreibt Methode TRExp aus der Super-Klasse
|
||||
* <code>Literal</code>, weil die Implementierung von Unify (noch) nicht mit
|
||||
* Basetypes umgehen kann.<br/>
|
||||
* Anstatt den Basetype <code>IntegerType</code> zur<EFBFBD>ckzugeben, wird ein
|
||||
* <code>RefType</code> zur<EFBFBD>ckgegeben.<br/>
|
||||
* Diese Methode kann sp<EFBFBD>ter entfernt werden, sodass automatisch die Methode der
|
||||
* Super-Klasse verwendet wird.
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25481.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, new RefType("java.lang.Long",getOffset()),V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25484.defdescription type=javadoc
|
||||
/**
|
||||
* <br/>Author: Martin Pl<EFBFBD>micke
|
||||
|
@ -2,79 +2,26 @@
|
||||
package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.end
|
||||
// ino.module.MethodCall.8639.import
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CIntersectionType;
|
||||
import mycompiler.mytypereconstruction.CMultiplyTuple;
|
||||
import mycompiler.mytypereconstruction.CSubstitution;
|
||||
import mycompiler.mytypereconstruction.CSubstitutionGenVar;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CMultiplyTupleSet;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CMethodTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumptionkey.CMethodKey;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.JVMCodeException;
|
||||
import de.dhbwstuttgart.myexception.SCExcept;
|
||||
import de.dhbwstuttgart.myexception.SCStatementException;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassBody;
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.DeclId;
|
||||
import de.dhbwstuttgart.syntaxtree.misc.UsedId;
|
||||
import de.dhbwstuttgart.syntaxtree.type.BoundedGenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Void;
|
||||
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.FreshTypeVariable;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.Overloading;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.unify.FC_TTO;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
|
||||
@ -93,16 +40,6 @@ public class MethodCall extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.attribute.OK.25630.declaration
|
||||
private static final int OK = 0;
|
||||
// ino.end
|
||||
// ino.attribute.UNIFY_ERROR.25633.declaration
|
||||
private static final int UNIFY_ERROR = 1;
|
||||
// ino.end
|
||||
// ino.attribute.METHOD_NOT_FOUND_ERROR.25636.declaration
|
||||
private static final int METHOD_NOT_FOUND_ERROR = 2;
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.attribute.receiver.25639.declaration
|
||||
/**
|
||||
@ -112,34 +49,7 @@ public class MethodCall extends Expr
|
||||
// ino.end
|
||||
// ino.attribute.arglist.25642.declaration
|
||||
private ArgumentList arglist=new ArgumentList();
|
||||
// ino.end
|
||||
private Vector<String> exprtypes=new Vector<String>(); //hier werden die Typen der �bergabewerten von sc_check eingetragen.
|
||||
// ino.attribute.class_name.25645.declaration
|
||||
private String class_name; //hier steht in welcher Klasse die Methode deklariert ist.
|
||||
// ino.end
|
||||
|
||||
// ino.attribute.uebernachdurch.25651.declaration
|
||||
private Hashtable<String,Method> uebernachdurch;
|
||||
// ino.end
|
||||
// ino.attribute.finde_method.25654.declaration
|
||||
private Vector<Hashtable<String,Method>> finde_method=new Vector<Hashtable<String,Method>>();
|
||||
// ino.end
|
||||
// ino.attribute.counter.25657.declaration
|
||||
private int counter;
|
||||
// ino.end
|
||||
|
||||
// ino.attribute.methodsFittingMethodCall.25660.decldescription type=javadoc
|
||||
/**
|
||||
* Da der SemanticCheck nicht mehr ausgeführt wird, werden hier die bei der
|
||||
* Typrekonstruktion gefundenen Methoden abgespeichert. Problem ist hier jedoch,
|
||||
* dass der receiver in diesem Moment noch nicht fest steht. Deshalb wird je
|
||||
* Receiver ein Methodcall abgelegt. Dieser kann dann mit bspw.
|
||||
* methodsFittingMethodCAll.get("Vector") abgerufen werden.
|
||||
*/
|
||||
// ino.end
|
||||
// ino.attribute.methodsFittingMethodCall.25660.declaration
|
||||
private Hashtable<String, CMethodTypeAssumption> methodsFittingMethodCall=new Hashtable<String,CMethodTypeAssumption>();
|
||||
// ino.end
|
||||
// ino.attribute.parserlog.25663.declaration
|
||||
protected static Logger parserlog = Logger.getLogger("parser");
|
||||
// ino.end
|
||||
@ -223,407 +133,9 @@ public class MethodCall extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.getMethodFittingMethodCallAndClassname.25705.defdescription type=javadoc
|
||||
/**
|
||||
* hoti 4.5.06
|
||||
* Diese Methode lädt die Methodeninfos einer Methode aus der Hashtable
|
||||
* methodsfittingmethodcall in ein Method-Objekt
|
||||
* anhand der angegeben klasse
|
||||
* @see methodsFittingMethodCall
|
||||
* @param className
|
||||
* @return
|
||||
* @throws JVMCodeException
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.getMethodFittingMethodCallAndClassname.25705.definition
|
||||
public Method getMethodFittingMethodCallAndClassname(String className)
|
||||
throws JVMCodeException
|
||||
// ino.end
|
||||
// ino.method.getMethodFittingMethodCallAndClassname.25705.body
|
||||
{
|
||||
CMethodTypeAssumption assumption=methodsFittingMethodCall.get(className);
|
||||
if(assumption==null){
|
||||
throw new JVMCodeException("Codegen: Fuer die Klasse "+className+" wurde die Methode "+usedid.get_Name_1Element()+" nicht gefunden");
|
||||
}
|
||||
Vector<CParaTypeAssumption> paraAssumptions=assumption.getParaAssumptions();
|
||||
Type returnType=assumption.getAssumedType();
|
||||
Method meth=new Method(0);
|
||||
Vector<FormalParameter> parameterVector=new Vector<FormalParameter>();
|
||||
ParameterList pl=new ParameterList();
|
||||
for(int i=0;i<paraAssumptions.size();i++){
|
||||
CParaTypeAssumption paraassumtion=paraAssumptions.elementAt(i);
|
||||
FormalParameter fp=new FormalParameter(new DeclId());
|
||||
fp.setType(paraassumtion.getAssumedType());
|
||||
parameterVector.addElement(fp);
|
||||
}
|
||||
pl.formalparameter=parameterVector;
|
||||
meth.setType(returnType);
|
||||
meth.setParameterList(pl);
|
||||
meth.set_DeclId(new DeclId(assumption.getIdentifier()));
|
||||
return(meth);
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.codegen.25708.definition
|
||||
public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
|
||||
throws JVMCodeException
|
||||
// ino.end
|
||||
// ino.method.codegen.25708.body
|
||||
{
|
||||
|
||||
// HOTI 4.5.06
|
||||
// Auf eine TypePlaceholders-Variable (=> nichterkannte) kann kein Methodenaufruf ausgeführt werden
|
||||
// Es muss sich also um einen RefType handeln. Ansonsten gibt es einen Fehler
|
||||
|
||||
if(!(receiver.get_Expr().getType() instanceof RefType)){
|
||||
throw new JVMCodeException("Es kann nur auf ein RefType ein Methodenaufruf ausgeführt werden ("+receiver+"["+receiver.get_Expr().getType()+"])");
|
||||
}
|
||||
|
||||
// HOTI 4.5.06
|
||||
// Es handelt sich also um einen RefType. Der Klassenname wird nun bezogen
|
||||
String receiverClassName=((RefType)receiver.get_Expr().getType()).getTypeName();
|
||||
|
||||
// Die richtige Methode wird gesucht und gesetzt
|
||||
Method called_method=getMethodFittingMethodCallAndClassname(receiverClassName);
|
||||
|
||||
|
||||
Vector name_vector = get_Name_Vector();
|
||||
String local_name = receiver.get_Expr().get_Name();
|
||||
|
||||
// Richtiges Objekt auf den Stack legen
|
||||
int index = code.get_indexOf_Var(local_name);
|
||||
|
||||
if (index != -1 ) { // Lokale Variable
|
||||
try {
|
||||
JavaClassName local_type = code.get_TypeOf_Var(local_name)
|
||||
.getName();
|
||||
code.add_code(JVMCode.nload_n(local_type.toString(), index));
|
||||
} catch (JVMCodeException e) { // out of nload_n
|
||||
JavaClassName local_type = code.get_TypeOf_Var(local_name)
|
||||
.getName();
|
||||
code.add_code(JVMCode.nload(local_type.toString()));
|
||||
code.add_code_byte((byte) index);
|
||||
}
|
||||
} else { // FieldVariable
|
||||
code.add_code(JVMCode.aload_0);
|
||||
code.add_code(JVMCode.getfield);
|
||||
code.add_code_short(classfile.add_field_ref(local_name,
|
||||
class_name, JVMCode.get_codegen_Type(receiver.get_Type(), null)));
|
||||
}
|
||||
|
||||
String called_method_name = called_method.get_Method_Name();
|
||||
if (called_method_name == null)
|
||||
called_method_name = (String) name_vector.lastElement();
|
||||
// feda 04.07.07 an dieser Stelle muss geschaut werden ob
|
||||
// die Methode eine Static Methode ist.
|
||||
// Wenn Static dann aload_0 weg und anstellen von
|
||||
// code.add_code(JVMCode.invokevirtual); muss
|
||||
// code.add_code(JVMCode.invokestatic); stehen.
|
||||
|
||||
|
||||
if (arglist != null)
|
||||
arglist.codegen(classfile, code, paralist);
|
||||
code.add_code(JVMCode.invokevirtual);
|
||||
code.add_code_short(classfile.add_method_ref(receiverClassName,
|
||||
called_method_name, called_method
|
||||
.get_codegen_Param_Type(paralist)));
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
// ino.method.makeReceiver.25714.definition
|
||||
private void makeReceiver()
|
||||
// ino.end
|
||||
// ino.method.makeReceiver.25714.body
|
||||
{
|
||||
usedid.get_Name().remove(usedid.get_Name().size()-1); //Methodenname loeschen
|
||||
Iterator namen = usedid.get_Name().iterator();
|
||||
LocalOrFieldVar LOFV = new LocalOrFieldVar((String)namen.next(),getOffset());
|
||||
LOFV.setType(TypePlaceholder.fresh(this));
|
||||
receiver = new Receiver(LOFV);
|
||||
while(namen.hasNext()) {
|
||||
InstVar INSTVA = new InstVar(receiver.get_Expr(), (String)namen.next(),getOffset());
|
||||
INSTVA.setType(TypePlaceholder.fresh(this));
|
||||
receiver = new Receiver(INSTVA);
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
// ino.method.addMethodAndSuperclassMethodsToFittings.25726.defdescription type=javadoc
|
||||
/**
|
||||
* HOTI 4.5.06-15.5.06
|
||||
* Fügt diese Klasse mit deren Typannahme in den Vektor ein.
|
||||
* Da aber auch die Subklassen alle die Methodenproperties haben
|
||||
* können müssen die mit rein...
|
||||
* @param classToAdd
|
||||
* @param methodAssumCopy
|
||||
* @param fc
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.addMethodAndSuperclassMethodsToFittings.25726.definition
|
||||
private void addMethodAndSuperclassMethodsToFittings(RefType classToAdd, CMethodTypeAssumption methodAssumCopy, FC_TTO fctto)
|
||||
// ino.end
|
||||
// ino.method.addMethodAndSuperclassMethodsToFittings.25726.body
|
||||
{
|
||||
methodsFittingMethodCall.put(classToAdd.getTypeName(),methodAssumCopy);
|
||||
// Input: Klasse Vector<E>
|
||||
// Output: Alle Klassen <= Vector<E> ... ohne Parameter
|
||||
RefType cloneRT=classToAdd.clone();
|
||||
CSubstitutionSet sub=cloneRT.GenericTypeVar2TypePlaceholder();
|
||||
sub.applyThisSubstitutionSet(cloneRT);
|
||||
Vector<CSubstitution> vec=sub.getVector();
|
||||
for(int i=0;i<vec.size();i++){
|
||||
Pair pair=new Pair(vec.elementAt(i).getType(),cloneRT);
|
||||
Vector<Vector<Pair>> test=Unify.instanceSmaller(pair,fctto);
|
||||
for(int j=0;j<test.size();j++){
|
||||
for(int k=0;k<test.elementAt(j).size();k++){
|
||||
Pair foundSubclassPair=test.elementAt(j).elementAt(k);
|
||||
Type foundSubclass=foundSubclassPair.getTA2Copy();
|
||||
if(foundSubclass instanceof RefType){
|
||||
RefType elem=(RefType)foundSubclass;
|
||||
CMethodTypeAssumption clone=methodAssumCopy.clone();
|
||||
clone.setClassName(elem.getTypeName());
|
||||
methodsFittingMethodCall.put(elem.getTypeName(),clone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.searchAndHandleMethod.25729.defdescription type=javadoc
|
||||
/**
|
||||
* Sucht eine Methode aus einer Menge von Typannahmen heraus und ruft
|
||||
* <code>handleMethodAssum()</code>. <br/>Author: J�rg B�uerle
|
||||
* @param multiTuple
|
||||
* @param possibleTypeComb
|
||||
* @param returnSet
|
||||
* @param className
|
||||
* @param methodName
|
||||
* @param paraCount
|
||||
* @param methodsFittingMethodCall Hashtable in der jede erfolgreiche Methode
|
||||
* abgelegt wird @param supportData
|
||||
* @return Einen Error-Code: <code>OK</code>, <code>UNIFY_ERROR</code> oder
|
||||
* <code>METHOD_NOT_FOUND_ERROR</code>
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.searchAndHandleMethod.25729.definition
|
||||
private int searchAndHandleMethod(CMultiplyTuple multiTuple, CTypeAssumptionSet V, CTripleSet returnSet, RefType classType, String methodName, int paraCount, CSupportData supportData, Hashtable<String,CMethodTypeAssumption> methodsFittingMethodCall)
|
||||
// ino.end
|
||||
// ino.method.searchAndHandleMethod.25729.body
|
||||
{
|
||||
// --------------------------
|
||||
// Typannahme f�r Methode heraussuchen:
|
||||
// --------------------------
|
||||
|
||||
String className;
|
||||
if(classType instanceof RefType){
|
||||
className=((RefType)classType).getTypeName();
|
||||
}else{
|
||||
className=classType.getName().toString();
|
||||
}
|
||||
|
||||
CMethodKey key = new CMethodKey(
|
||||
className,
|
||||
methodName,
|
||||
paraCount
|
||||
);
|
||||
|
||||
Vector<CTypeAssumption> methodAssums = V.getElements(key);
|
||||
|
||||
|
||||
// Wenn die Methode nicht fuendig war:
|
||||
|
||||
if(methodAssums.size()==0){
|
||||
return METHOD_NOT_FOUND_ERROR;
|
||||
}
|
||||
|
||||
// Fuendig: Alle Methoden, die "xxx" heißen und y Parameter haben sind nun in dem Vector drin
|
||||
// Für alle soll jetzt geschaut werden
|
||||
|
||||
int wellDoneFunctionCount=0;
|
||||
|
||||
for(int item=0;item<methodAssums.size();item++){
|
||||
CTypeAssumption methodAssumObj=methodAssums.get(item);
|
||||
|
||||
if(methodAssumObj instanceof CMethodTypeAssumption){
|
||||
|
||||
CMethodTypeAssumption methodAssum=(CMethodTypeAssumption)methodAssumObj;
|
||||
CMethodTypeAssumption methodAssumCopy=(CMethodTypeAssumption)methodAssumObj.clone();
|
||||
|
||||
Vector<GenericTypeVar> typeGenPara = supportData.getCurrentClassPara();
|
||||
|
||||
// Generics der Methode holen
|
||||
// p.ex. <E extends Integer> E test(){...}
|
||||
// ___________________
|
||||
Vector<GenericTypeVar> genericMethodParameters=methodAssum.getGenericMethodParameters();
|
||||
|
||||
// Klassengenerics verarbeiten
|
||||
Vector<Type> typePara = null;
|
||||
if (typeGenPara != null) {
|
||||
typePara = new Vector<Type>();
|
||||
for( int i = 0; i < typeGenPara.size(); i++ )
|
||||
{
|
||||
typePara.addElement(typeGenPara.elementAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
// Methodengenerics verarbeiten
|
||||
Vector<Pair> additionalPairsToUnify=new Vector<Pair>();
|
||||
|
||||
if (genericMethodParameters != null && genericMethodParameters.size()>0) {
|
||||
|
||||
CSubstitutionSet sub = new CSubstitutionSet();
|
||||
|
||||
for( int i = 0; i < genericMethodParameters.size(); i++ ){
|
||||
|
||||
|
||||
if(genericMethodParameters.elementAt(i) instanceof BoundedGenericTypeVar){
|
||||
// Jede Bound als Paar zum Unifizieren vormerken
|
||||
TypePlaceholder newTLV=TypePlaceholder.fresh(this);
|
||||
BoundedGenericTypeVar bgtv=(BoundedGenericTypeVar)genericMethodParameters.elementAt(i);
|
||||
for(int j=0;j<bgtv.getBounds().size();j++){
|
||||
Type bound=bgtv.getBounds().elementAt(j);
|
||||
Pair newPairToAdd=new Pair(newTLV,bound);
|
||||
additionalPairsToUnify.addElement(newPairToAdd);
|
||||
sub.addElement(new CSubstitutionGenVar(bgtv, newTLV));
|
||||
}
|
||||
}else{ // Normale GenericTypeVar
|
||||
TypePlaceholder newTLV=TypePlaceholder.fresh(this);
|
||||
sub.addElement(new CSubstitutionGenVar(genericMethodParameters.elementAt(i), newTLV));
|
||||
}
|
||||
}
|
||||
methodAssum.sub(sub);
|
||||
}
|
||||
|
||||
int returnValue=handleMethodAssum(multiTuple, typePara, returnSet, methodAssum, classType, supportData, additionalPairsToUnify);
|
||||
|
||||
if(returnValue==OK){
|
||||
if(methodAssum instanceof CMethodTypeAssumption){
|
||||
addMethodAndSuperclassMethodsToFittings(classType, methodAssumCopy,supportData.getFiniteClosure());
|
||||
}
|
||||
wellDoneFunctionCount++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return (wellDoneFunctionCount==1)?OK:UNIFY_ERROR;
|
||||
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.handleMethodAssum.25732.defdescription type=javadoc
|
||||
/**
|
||||
* Unifiziert die in Alg. 5.34 angegeben Typen von Methodenargumenten und
|
||||
* Receivern. <br/>Author: J�rg B�uerle
|
||||
* @param multiTuple
|
||||
* @param returnSet
|
||||
* @param methodAssum
|
||||
* @param className
|
||||
* @param supportData
|
||||
* @param additionalPairsToUnify
|
||||
* @return Einen Error-Code: <code>OK</code>, <code>UNIFY_ERROR</code> oder
|
||||
* <code>METHOD_NOT_FOUND_ERROR</code>
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.handleMethodAssum.25732.definition
|
||||
private static int handleMethodAssum(CMultiplyTuple multiTuple, Vector<Type> typePara, CTripleSet returnSet, CMethodTypeAssumption methodAssum, Type classType, CSupportData supportData, Vector<Pair> additionalPairsToUnify)
|
||||
// ino.end
|
||||
// ino.method.handleMethodAssum.25732.body
|
||||
{
|
||||
// --------------------------
|
||||
// Typen unifizieren:
|
||||
// --------------------------
|
||||
|
||||
// Vorerst Paare zum Unifizieren bilden
|
||||
Vector<Pair> pairsToUnify = createPairsToUnify(multiTuple, typePara, classType, methodAssum);
|
||||
|
||||
// Vorgemerkte Paare
|
||||
if(pairsToUnify!=null && additionalPairsToUnify!=null)
|
||||
pairsToUnify.addAll(additionalPairsToUnify);
|
||||
|
||||
// Die Paare endlich unifizieren
|
||||
Vector<Vector<Pair>> unifierPossibilities = Unify.unify(pairsToUnify, supportData.getFiniteClosure());
|
||||
// --------------------------
|
||||
// Wenn Unifier vorhanden, dann anwenden:
|
||||
// --------------------------
|
||||
if(unifierPossibilities.size()!=0){
|
||||
// --------------------------
|
||||
// Subset bauen:
|
||||
// --------------------------
|
||||
CTripleSet subSet = new CTripleSet();
|
||||
// --------------------------
|
||||
// Alle Unifer durchgehen:
|
||||
// --------------------------
|
||||
for(int j=0; j<unifierPossibilities.size(); j++){
|
||||
CSubstitutionSet unifier = new CSubstitutionSet(unifierPossibilities.elementAt(j));
|
||||
// --------------------------
|
||||
// Ergebnis-Triple bauen:
|
||||
// --------------------------
|
||||
CTriple subTriple = new CTriple();
|
||||
subTriple.setAssumptionSet(multiTuple.getAssumptionSet());
|
||||
subTriple.setSubstitutions(multiTuple.getSubstitutions());
|
||||
subTriple.setResultType(methodAssum.getAssumedType());
|
||||
// --------------------------
|
||||
// Unifier anwenden:
|
||||
// --------------------------
|
||||
subTriple = subTriple.cloneAndApplyUnify(unifier);
|
||||
if(!subSet.contains(subTriple)){
|
||||
subSet.addElement(subTriple);
|
||||
}
|
||||
}
|
||||
returnSet.unite(subSet);
|
||||
return OK;
|
||||
}
|
||||
return UNIFY_ERROR;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.createPairsToUnify.25735.defdescription type=javadoc
|
||||
/**
|
||||
* Baut die in Algorithmus 5.34 angegeben Liste von zu unifizierenden Typen auf.
|
||||
* <br/>Author: J�rg B�uerle
|
||||
* @param multiTuple
|
||||
* @param receiverClass
|
||||
* @param methodAssum
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.createPairsToUnify.25735.definition
|
||||
private static Vector<Pair> createPairsToUnify(CMultiplyTuple multiTuple, Vector<Type> typePara, Type receiverClass, CMethodTypeAssumption methodAssum)
|
||||
// ino.end
|
||||
// ino.method.createPairsToUnify.25735.body
|
||||
{
|
||||
Vector<Pair> pairList = new Vector<Pair>();
|
||||
Pair p = new Pair(multiTuple.getResultTypes().firstElement(), receiverClass);
|
||||
pairList.addElement(p);
|
||||
for(int i=1; i<multiTuple.getResultTypes().size(); i++){
|
||||
Type nu = multiTuple.getResultTypes().elementAt(i);
|
||||
Type theta = methodAssum.getParaAssumption(i-1).getAssumedType();
|
||||
|
||||
// HOTI 04-22-06 Hier war einst ein BackDoorFresh, welches das obige
|
||||
// theta ersetzt hat und dem Theta die neuen TypePlaceholder zugewiesen
|
||||
// hat. Dies war in unseren (Martin, Joerg, Ich) Augen falsch, deshalb
|
||||
// haben wir es raus gemacht. Es wird naemlich schon in
|
||||
// searchandhandlemethod ein TypePlaceholder erzeugt, hier waere es
|
||||
// sonst "doppelt gemoppelt" gewesen, was natürlich weitere Probleme
|
||||
// verursachte ....
|
||||
|
||||
p = new Pair(nu, theta);
|
||||
pairList.addElement(p);
|
||||
}
|
||||
return pairList;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.toString.25738.defdescription type=javadoc
|
||||
/**
|
||||
@ -649,19 +161,6 @@ public class MethodCall extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.get_Receiver()!=null)
|
||||
{
|
||||
this.get_Receiver().get_Expr().addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
if(this.getArgumentList()!=null){
|
||||
for(Expr n : this.getArgumentList().expr)
|
||||
{
|
||||
n.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Andreas Stadelmeier, a10023
|
||||
* @return der Name der Methode, welcher dieser MethodCall aufruft.
|
||||
@ -739,6 +238,13 @@ public class MethodCall extends Expr
|
||||
super.parserPostProcessing(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
|
||||
throws JVMCodeException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
@ -6,29 +6,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
@ -46,6 +25,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -140,11 +120,6 @@ public class NegativeExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -5,27 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -39,6 +20,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -153,33 +135,7 @@ public class NewArray extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25821.defdescription type=javadoc
|
||||
/**
|
||||
* Implementierung des Algorithmus 5.32 von Martin Pl<EFBFBD>micke
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.25821.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25821.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25824.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25824.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25827.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
@ -188,20 +144,6 @@ public class NewArray extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.get_UsedId().get_Name_1Element().equals(NameVariable))
|
||||
{
|
||||
//wenn Variable mit gleichem Namen gefunden->schreibe Offset
|
||||
localAssumption.addOffset(this.get_UsedId().getOffset());
|
||||
}
|
||||
if(this.expr!=null){
|
||||
for(Expr n : this.expr)
|
||||
{
|
||||
n.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -7,37 +7,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CMultiplyTuple;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CMultiplyTupleSet;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CParaTypeAssumption;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -64,6 +35,7 @@ import de.dhbwstuttgart.typeinference.UndConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.ConstructorAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -226,20 +198,6 @@ public class NewClass extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.get_UsedId().get_Name_1Element().equals(NameVariable))
|
||||
{
|
||||
//wenn Variable mit gleichem Namen gefunden->schreibe Offset
|
||||
localAssumption.addOffset(this.get_UsedId().getOffset());
|
||||
}
|
||||
if(this.getArgumentList()!=null){
|
||||
for(Expr n : this.getArgumentList().expr)
|
||||
{
|
||||
n.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
//TODO: Das hier noch vervollständigen
|
||||
|
@ -6,31 +6,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
@ -49,6 +25,7 @@ import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.OderConstraint;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -163,11 +140,6 @@ public class NotExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
ConstraintsSet ret = new ConstraintsSet();
|
||||
|
@ -5,28 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -41,6 +21,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -94,24 +75,6 @@ public class Null extends Literal
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25938.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25938.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25941.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25941.body
|
||||
{
|
||||
CTripleSet tripleSet = new CTripleSet();
|
||||
tripleSet.addElement(new CTriple(sigma, TypePlaceholder.fresh(this) ,V));
|
||||
return tripleSet;
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25944.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
|
@ -5,27 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
@ -38,6 +19,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -113,23 +95,6 @@ public class PositivExpr extends UnaryExpr
|
||||
{}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.25978.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.25978.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.25981.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.25981.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.25984.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
@ -138,10 +103,6 @@ public class PositivExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
|
@ -6,29 +6,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -47,6 +26,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -175,11 +155,6 @@ public class PostDecExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -6,32 +6,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -53,6 +28,7 @@ import de.dhbwstuttgart.typeinference.OderConstraint;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.UndConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -182,11 +158,6 @@ public class PostIncExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
JavaCodeResult ret = new JavaCodeResult();
|
||||
|
@ -6,29 +6,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -47,6 +25,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -175,11 +154,6 @@ public class PreDecExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -6,29 +6,7 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -47,6 +25,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
|
||||
|
||||
@ -176,11 +155,6 @@ public class PreIncExpr extends UnaryExpr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -5,28 +5,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -45,6 +24,7 @@ import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
|
||||
@ -118,12 +98,6 @@ public class Return extends Statement
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
retexpr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
ConstraintsSet ret = new ConstraintsSet();
|
||||
@ -134,10 +108,6 @@ public class Return extends Statement
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
super.replaceType(e);
|
||||
}
|
||||
|
||||
public int getTypeLineNumber() {
|
||||
return 0;
|
||||
}
|
||||
|
@ -24,20 +24,11 @@ import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.Typeable;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
// ino.class.Statement.26184.declaration
|
||||
public abstract class Statement extends SyntaxTreeNode implements IItemWithOffset, Typeable, ITypeReplacementListener
|
||||
public abstract class Statement extends SyntaxTreeNode implements IItemWithOffset, Typeable
|
||||
// ino.end
|
||||
// ino.class.Statement.26184.body
|
||||
{
|
||||
@ -91,8 +82,6 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse
|
||||
public abstract void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters);
|
||||
// ino.end
|
||||
|
||||
public abstract boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable);
|
||||
|
||||
/**
|
||||
* @author AI10023 - Andreas Stadelmeier
|
||||
* Implementierung des Java 8 - Typinferenzalgorithmus von Martin Plümicke
|
||||
@ -124,23 +113,9 @@ public abstract class Statement extends SyntaxTreeNode implements IItemWithOffse
|
||||
*/
|
||||
public void setType(Type t)
|
||||
{
|
||||
if(this.getType() instanceof TypePlaceholder){
|
||||
((TypePlaceholder)this.getType()).removeReplacementListener(this);
|
||||
}
|
||||
if(t instanceof TypePlaceholder){
|
||||
((TypePlaceholder)t).addReplacementListener(this);
|
||||
}
|
||||
this.type=t;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e)
|
||||
{
|
||||
if(getType() instanceof TypePlaceholder){
|
||||
((TypePlaceholder)getType()).removeReplacementListener(this);
|
||||
}
|
||||
this.setType(e.getNewType());
|
||||
}
|
||||
|
||||
|
||||
public abstract JavaCodeResult printJavaCode(ResultSet resultSet);
|
||||
|
||||
|
@ -5,29 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -44,6 +23,7 @@ import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -131,15 +111,6 @@ public class StringLiteral extends Literal
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
// ino.method.TRStatement.26255.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.26255.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.26258.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
// ino.end
|
||||
|
@ -5,29 +5,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -44,6 +22,7 @@ import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
|
||||
|
||||
|
||||
@ -127,43 +106,6 @@ public class This extends Expr
|
||||
{ return null; }
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRExp.26289.defdescription type=javadoc
|
||||
/**
|
||||
* Implementierung des Algorithmus 5.35 von Martin Pl<EFBFBD>micke
|
||||
* <br>Author: J<EFBFBD>rg B<EFBFBD>uerle
|
||||
* @param sigma
|
||||
* @param V
|
||||
* @param supportData
|
||||
* @return
|
||||
*/
|
||||
// ino.end
|
||||
// ino.method.TRExp.26289.definition
|
||||
public CTripleSet TRExp(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRExp.26289.body
|
||||
{
|
||||
CTripleSet ret = new CTripleSet();
|
||||
RefType newType;
|
||||
Type supportDataType=supportData.getCurrentClassType();
|
||||
if(supportDataType instanceof RefType){
|
||||
newType=(RefType)supportDataType;
|
||||
}else{
|
||||
newType=new RefType(supportData.getCurrentClass(),getOffset());
|
||||
}
|
||||
this.type=newType;
|
||||
ret.addElement(new CTriple(sigma, newType,V));
|
||||
return ret;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.TRStatement.26292.definition
|
||||
public CTripleSet TRStatement(CSubstitutionSet sigma, CTypeAssumptionSet V, CSupportData supportData)
|
||||
// ino.end
|
||||
// ino.method.TRStatement.26292.body
|
||||
{
|
||||
throw CTypeReconstructionException.createNotImplementedException();
|
||||
}
|
||||
// ino.end
|
||||
|
||||
// ino.method.wandleRefTypeAttributes2GenericAttributes.26295.definition
|
||||
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
||||
@ -173,15 +115,6 @@ public class This extends Expr
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable)
|
||||
{
|
||||
if(this.arglist.expr!=null){
|
||||
for(Expr n : this.arglist.expr)
|
||||
{
|
||||
n.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
}}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||
ConstraintsSet ret = new ConstraintsSet();
|
||||
|
@ -7,31 +7,8 @@ import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.CSupportData;
|
||||
import mycompiler.mytypereconstruction.CTriple;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.set.CSubstitutionSet;
|
||||
import mycompiler.mytypereconstruction.set.CTripleSet;
|
||||
import mycompiler.mytypereconstruction.set.CTypeAssumptionSet;
|
||||
import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.bytecode.ClassFile;
|
||||
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
||||
import de.dhbwstuttgart.bytecode.JVMCode;
|
||||
@ -54,6 +31,7 @@ import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.Unify;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
@ -183,13 +161,6 @@ public class WhileStmt extends Statement
|
||||
}
|
||||
// ino.end
|
||||
|
||||
public boolean addOffsetsToStatement(CTypeAssumption localAssumption, String NameVariable, boolean isMemberVariable)
|
||||
{
|
||||
expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable);
|
||||
loop_block.addOffsetsToStatement(localAssumption,NameVariable,isMemberVariable);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
||||
ConstraintsSet ret = new ConstraintsSet();
|
||||
@ -201,11 +172,6 @@ public class WhileStmt extends Statement
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void replaceType(CReplaceTypeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int getTypeLineNumber() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package de.dhbwstuttgart.syntaxtree.type;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import mycompiler.mytypereconstruction.set.CVectorSet;
|
||||
import de.dhbwstuttgart.typeinference.unify.CVectorSet;
|
||||
|
||||
public class CRefTypeSet extends CVectorSet<RefType> {
|
||||
|
||||
|
@ -2,9 +2,9 @@ package de.dhbwstuttgart.syntaxtree.type;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
public class FreshWildcardType extends Type {
|
||||
|
@ -6,34 +6,14 @@ package de.dhbwstuttgart.syntaxtree.type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
// ino.end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
import de.dhbwstuttgart.typeinference.SingleConstraint;
|
||||
import de.dhbwstuttgart.typeinference.TypeInsertable;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent;
|
||||
import mycompiler.mytypereconstruction.replacementlistener.ITypeReplacementListener;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
// ino.class.GenericTypeVar.26505.description type=javadoc
|
||||
/**
|
||||
@ -188,7 +168,7 @@ public class GenericTypeVar extends Type
|
||||
|
||||
public TypePlaceholder getTypePlaceHolder() {
|
||||
if(!GenericTypeVar.tph.containsKey(this)){
|
||||
GenericTypeVar.tph.put(this, TypePlaceholder.fresh(this.getName().toString()));
|
||||
GenericTypeVar.tph.put(this, TypePlaceholder.fresh(this.getName().toString(),this));
|
||||
}
|
||||
return GenericTypeVar.tph.get(this);
|
||||
//if(this.tph == null)this.tph = TypePlaceholder.fresh();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user