forked from JavaTX/JavaCompilerCore
199 lines
5.7 KiB
Java
Executable File
199 lines
5.7 KiB
Java
Executable File
// ino.module.This.8654.package
|
||
package mycompiler.mystatement;
|
||
// ino.end
|
||
// ino.module.This.8654.import
|
||
import java.util.Hashtable;
|
||
import java.util.Vector;
|
||
|
||
import mycompiler.SyntaxTreeNode;
|
||
import mycompiler.mybytecode.ClassFile;
|
||
import mycompiler.mybytecode.CodeAttribute;
|
||
import mycompiler.mybytecode.JVMCode;
|
||
import mycompiler.myclass.Class;
|
||
import mycompiler.myclass.UsedId;
|
||
import mycompiler.myexception.CTypeReconstructionException;
|
||
import mycompiler.myexception.JVMCodeException;
|
||
import mycompiler.myexception.SCStatementException;
|
||
import mycompiler.mytype.GenericTypeVar;
|
||
import mycompiler.mytype.RefType;
|
||
import mycompiler.mytype.Type;
|
||
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 typinferenz.ConstraintsSet;
|
||
import typinferenz.JavaCodeResult;
|
||
import typinferenz.ResultSet;
|
||
import typinferenz.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
|
||
|
||
// 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<Class> classname, Hashtable ch, Hashtable<String, String> bh, boolean ext, Hashtable parach, Hashtable<String, 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<50>micke
|
||
* <br>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<Type> paralist, Vector<GenericTypeVar> 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<SyntaxTreeNode> getChildren() {
|
||
Vector<SyntaxTreeNode> ret = new Vector<SyntaxTreeNode>();
|
||
return ret;
|
||
}
|
||
|
||
}
|
||
// ino.end
|