2013-10-18 11:33:46 +00:00
|
|
|
// ino.module.NotExpr.8643.package
|
2014-09-02 08:33:54 +00:00
|
|
|
package de.dhbwstuttgart.syntaxtree.statement;
|
2013-10-18 11:33:46 +00:00
|
|
|
// ino.end
|
|
|
|
// ino.module.NotExpr.8643.import
|
|
|
|
import java.util.Hashtable;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Vector;
|
2014-02-09 15:07:31 +00:00
|
|
|
|
2013-10-18 11:33:46 +00:00
|
|
|
import org.apache.log4j.Logger;
|
2014-09-04 14:35:44 +00:00
|
|
|
import de.dhbwstuttgart.bytecode.ClassFile;
|
|
|
|
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
|
|
|
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
|
|
|
import de.dhbwstuttgart.myexception.JVMCodeException;
|
|
|
|
import de.dhbwstuttgart.myexception.SCStatementException;
|
2014-09-02 08:33:54 +00:00
|
|
|
import de.dhbwstuttgart.syntaxtree.Class;
|
2014-09-04 14:35:44 +00:00
|
|
|
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
2014-09-02 08:33:54 +00:00
|
|
|
import de.dhbwstuttgart.syntaxtree.type.BooleanType;
|
|
|
|
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.Void;
|
|
|
|
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
|
|
|
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
|
|
|
import de.dhbwstuttgart.typeinference.OderConstraint;
|
|
|
|
import de.dhbwstuttgart.typeinference.ResultSet;
|
|
|
|
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
2014-09-05 09:49:31 +00:00
|
|
|
import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet;
|
2014-09-02 09:07:16 +00:00
|
|
|
import de.dhbwstuttgart.typeinference.unify.Unify;
|
2013-10-18 11:33:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ino.class.NotExpr.25873.declaration
|
|
|
|
public class NotExpr extends UnaryExpr
|
|
|
|
// ino.end
|
|
|
|
// ino.class.NotExpr.25873.body
|
|
|
|
{
|
|
|
|
// ino.method.NotExpr.25877.definition
|
|
|
|
public NotExpr(int offset,int variableLength)
|
|
|
|
// ino.end
|
|
|
|
// ino.method.NotExpr.25877.body
|
|
|
|
{
|
|
|
|
super(offset,variableLength);
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
// ino.attribute.not.25880.declaration
|
|
|
|
private UnaryNot not;
|
|
|
|
// ino.end
|
|
|
|
// ino.attribute.expr.25883.declaration
|
|
|
|
public Expr expr;
|
|
|
|
// ino.end
|
|
|
|
// ino.attribute.parserlog.25886.declaration
|
|
|
|
protected static Logger parserlog = Logger.getLogger("parser");
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ino.method.get_Name.25892.definition
|
|
|
|
public String get_Name()
|
|
|
|
// ino.end
|
|
|
|
// ino.method.get_Name.25892.body
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.get_Expr.25895.definition
|
|
|
|
public Expr get_Expr()
|
|
|
|
// ino.end
|
|
|
|
// ino.method.get_Expr.25895.body
|
|
|
|
{
|
|
|
|
return expr;
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.set_UnaryNot.25898.definition
|
|
|
|
public void set_UnaryNot(UnaryNot unot)
|
|
|
|
// ino.end
|
|
|
|
// ino.method.set_UnaryNot.25898.body
|
|
|
|
{
|
|
|
|
this.not = unot;
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.set_Expr.25901.definition
|
|
|
|
public void set_Expr(Expr ex)
|
|
|
|
// ino.end
|
|
|
|
// ino.method.set_Expr.25901.body
|
|
|
|
{
|
|
|
|
this.expr = ex;
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.codegen.25904.definition
|
|
|
|
public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
|
|
|
|
throws JVMCodeException
|
|
|
|
// ino.end
|
|
|
|
// ino.method.codegen.25904.body
|
|
|
|
{
|
|
|
|
if(expr instanceof Binary) ((Binary)expr).not_codegen(classfile, code, paralist);
|
|
|
|
else if(expr instanceof NotExpr) ((NotExpr)expr).not_codegen(classfile, code, paralist);
|
|
|
|
else {
|
|
|
|
expr.codegen(classfile, code, paralist);
|
|
|
|
not.codegen(classfile, code, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
// ino.method.not_codegen.25907.definition
|
|
|
|
public void not_codegen(ClassFile classfile, CodeAttribute code, Vector paralist)
|
|
|
|
throws JVMCodeException
|
|
|
|
// ino.end
|
|
|
|
// ino.method.not_codegen.25907.body
|
|
|
|
{
|
|
|
|
if(expr instanceof Binary) ((Binary)expr).codegen(classfile, code, paralist);
|
|
|
|
else if(expr instanceof NotExpr) ((NotExpr)expr).codegen(classfile, code, paralist);
|
|
|
|
else {
|
|
|
|
expr.codegen(classfile, code, paralist);
|
|
|
|
not.codegen(classfile, code, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
/*
|
|
|
|
public void if_codegen(ClassFile classfile, Code_attribute code, boolean sw) throws JVMCodeException {
|
|
|
|
if(expr instanceof NotExpr) if_codegen(classfile, code, !sw);
|
|
|
|
else {
|
|
|
|
expr.codegen(classfile, code);
|
|
|
|
not.if_codegen(classfile, code, sw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
// ino.end
|
|
|
|
// ino.method.wandleRefTypeAttributes2GenericAttributes.25916.definition
|
|
|
|
public void wandleRefTypeAttributes2GenericAttributes(Vector<Type> paralist, Vector<GenericTypeVar> genericMethodParameters)
|
|
|
|
// ino.end
|
|
|
|
// ino.method.wandleRefTypeAttributes2GenericAttributes.25916.body
|
|
|
|
{
|
|
|
|
}
|
|
|
|
// ino.end
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
2014-04-23 15:59:39 +00:00
|
|
|
ConstraintsSet ret = new ConstraintsSet();
|
|
|
|
OderConstraint constraint = new OderConstraint();
|
|
|
|
constraint.addConstraint(new Pair(this.getType(), new BooleanType()));
|
|
|
|
ret.add(constraint);
|
|
|
|
return ret;
|
2013-10-18 11:33:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-03-27 15:43:07 +00:00
|
|
|
@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
|