JavaPatternMatching/src/mycompiler/mystatement/NegativeExpr.java

158 lines
4.5 KiB
Java
Raw Normal View History

2013-10-18 11:33:46 +00:00
// ino.module.NegativeExpr.8640.package
package mycompiler.mystatement;
// ino.end
// ino.module.NegativeExpr.8640.import
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
import mycompiler.SyntaxTreeNode;
2013-10-18 11:33:46 +00:00
import mycompiler.mybytecode.ClassFile;
import mycompiler.mybytecode.CodeAttribute;
import mycompiler.myclass.Class;
import mycompiler.myexception.CTypeReconstructionException;
import mycompiler.myexception.JVMCodeException;
import mycompiler.myexception.SCExcept;
import mycompiler.myexception.SCStatementException;
import mycompiler.mytype.GenericTypeVar;
import mycompiler.mytype.Pair;
import mycompiler.mytype.RefType;
import mycompiler.mytype.Type;
import mycompiler.mytype.Void;
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.unify.Unify;
2013-10-18 11:33:46 +00:00
import org.apache.log4j.Logger;
// ino.end
2013-10-18 11:33:46 +00:00
import typinferenz.ConstraintsSet;
import typinferenz.JavaCodeResult;
import typinferenz.ResultSet;
import typinferenz.assumptions.TypeAssumptions;
2013-10-18 11:33:46 +00:00
// ino.class.NegativeExpr.25744.declaration
public class NegativeExpr extends UnaryExpr
// ino.end
// ino.class.NegativeExpr.25744.body
{
// ino.method.NegativeExpr.25748.definition
public NegativeExpr(int offset,int variableLength)
// ino.end
// ino.method.NegativeExpr.25748.body
{
super(offset,variableLength);
}
// ino.end
// ino.attribute.neg.25751.declaration
private UnaryMinus neg;
// ino.end
// ino.attribute.expr.25754.declaration
public Expr expr;
// ino.end
// ino.attribute.parserlog.25757.declaration
protected static Logger parserlog = Logger.getLogger("parser");
// ino.end
// ino.method.get_Name.25760.definition
public String get_Name()
// ino.end
// ino.method.get_Name.25760.body
{
return null;
}
// ino.end
// ino.method.set_UnaryMinus.25766.definition
public void set_UnaryMinus(UnaryMinus umin)
// ino.end
// ino.method.set_UnaryMinus.25766.body
{
this.neg = umin;
}
// ino.end
// ino.method.set_Expr.25769.definition
public void set_Expr(Expr ex)
// ino.end
// ino.method.set_Expr.25769.body
{
this.expr = ex;
}
// ino.end
// ino.method.codegen.25772.definition
public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
throws JVMCodeException
// ino.end
// ino.method.codegen.25772.body
{
if(expr instanceof Binary) ((Binary)expr).neg_codegen(classfile, code, paralist);
else if(expr instanceof NegativeExpr) ((NegativeExpr)expr).neg_codegen(classfile, code, paralist);
else {
expr.codegen(classfile, code, paralist);
neg.codegen(classfile, code, expr.getTypeName(), true);
}
}
// ino.end
// ino.method.neg_codegen.25775.definition
public void neg_codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
throws JVMCodeException
// ino.end
// ino.method.neg_codegen.25775.body
{
if(expr instanceof Binary) ((Binary)expr).codegen(classfile, code, paralist);
else if(expr instanceof NegativeExpr) ((NegativeExpr)expr).codegen(classfile, code, paralist);
else {
expr.codegen(classfile, code, paralist);
neg.codegen(classfile, code, expr.getTypeName(), false);
}
}
// ino.end
// ino.end
// ino.method.wandleRefTypeAttributes2GenericAttributes.25784.definition
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
// ino.end
// ino.method.wandleRefTypeAttributes2GenericAttributes.25784.body
{
}
// 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
return null;
}
@Override
public JavaCodeResult printJavaCode(ResultSet resultSet) {
2013-10-18 11:33:46 +00:00
// TODO Auto-generated method stub
return null;
}
@Override
public Vector<SyntaxTreeNode> getChildren() {
Vector<SyntaxTreeNode> ret = new Vector<SyntaxTreeNode>();
ret.add(this.expr);
return ret;
}
2013-10-18 11:33:46 +00:00
}
// ino.end