// ino.module.This.8654.package package de.dhbwstuttgart.syntaxtree.statement; // ino.end // ino.module.This.8654.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; import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.JVMCodeException; import de.dhbwstuttgart.myexception.SCStatementException; import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.syntaxtree.misc.UsedId; import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.Type; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.JavaCodeResult; import de.dhbwstuttgart.typeinference.ResultSet; import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; // ino.class.This.26261.declaration public class This extends Expr // ino.end // ino.class.This.26261.body { // ino.method.This.26265.definition public This(int offset,int variableLength) // ino.end // ino.method.This.26265.body { super(offset,variableLength); } // ino.end public This(SyntaxTreeNode parent){ this(0,0); this.parent = parent; } // ino.attribute.arglist.26268.declaration public ArgumentList arglist; // ino.end // ino.attribute.parserlog.26271.declaration protected static Logger parserlog = Logger.getLogger("parser"); // ino.end // ino.method.set_ArgumentList.26274.definition public void set_ArgumentList(ArgumentList al) // ino.end // ino.method.set_ArgumentList.26274.body { this.arglist = al; } // ino.end public ArgumentList getArgumentList() { return this.arglist; } // ino.method.set_UsedId.26277.definition public void set_UsedId(UsedId ui) // ino.end // ino.method.set_UsedId.26277.body { this.usedid = ui; } // ino.end // ino.method.sc_check.26280.definition public void sc_check(Vector classname, Hashtable ch, Hashtable bh, boolean ext, Hashtable parach, Hashtable parabh) throws SCStatementException // ino.end // ino.method.sc_check.26280.body { if(ext) parserlog.debug(" ---This---"); } // ino.end // ino.method.codegen.26283.definition public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist) throws JVMCodeException // ino.end // ino.method.codegen.26283.body { code.add_code(JVMCode.aload_0); } // ino.end // ino.method.get_Name.26286.definition public String get_Name() // ino.end // ino.method.get_Name.26286.body { return null; } // ino.end // ino.method.TRExp.26289.defdescription type=javadoc /** * Implementierung des Algorithmus 5.35 von Martin Pl�micke *
Author: J�rg B�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 paralist, Vector genericMethodParameters) // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26295.body { } // 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(); //this.set_Type(new); //this.setType(assumptions.getThisValue());//Die Assumption für this als TypeVariable setzen. this.setType(this.getParentClass().getType()); return ret; } public String toString() // ino.end // ino.method.toString.25738.body { //return receiver/*.toString()*/ + " " + usedid.toString(); return type + " (" + "this" +"(" + this.getArgumentList() + "))"; } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { return new JavaCodeResult("this"); } @Override public Vector getChildren() { Vector ret = new Vector(); return ret; } } // ino.end