forked from JavaTX/JavaCompilerCore
157 lines
4.5 KiB
Java
Executable File
157 lines
4.5 KiB
Java
Executable File
// ino.module.This.8654.package
|
|
package de.dhbwstuttgart.syntaxtree.statement;
|
|
// ino.end
|
|
// ino.module.This.8654.import
|
|
import java.util.Hashtable;
|
|
import de.dhbwstuttgart.typeinference.Menge;
|
|
|
|
import de.dhbwstuttgart.logger.Logger;
|
|
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.Constructor;
|
|
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.syntaxtree.type.Void;
|
|
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
|
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
|
import de.dhbwstuttgart.typeinference.ResultSet;
|
|
import de.dhbwstuttgart.typeinference.assumptions.ConstructorAssumption;
|
|
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
|
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
|
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
|
|
|
|
|
|
|
// 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(Menge<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, Menge 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.wandleRefTypeAttributes2GenericAttributes.26295.definition
|
|
public void wandleRefTypeAttributes2GenericAttributes(Menge<Type> paralist, Menge<GenericTypeVar> genericMethodParameters)
|
|
// ino.end
|
|
// ino.method.wandleRefTypeAttributes2GenericAttributes.26295.body
|
|
{
|
|
}
|
|
// ino.end
|
|
|
|
@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;
|
|
}
|
|
|
|
@Override
|
|
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions) {
|
|
throw new TypeinferenceException("this ist keine Anweisung", this);
|
|
}
|
|
|
|
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 Menge<SyntaxTreeNode> getChildren() {
|
|
Menge<SyntaxTreeNode> ret = new Menge<SyntaxTreeNode>();
|
|
return ret;
|
|
}
|
|
|
|
}
|