JavaPatternMatching/src/de/dhbwstuttgart/syntaxtree/operator/RelOp.java

61 lines
2.4 KiB
Java
Executable File

// ino.module.RelOp.8610.package
package de.dhbwstuttgart.syntaxtree.operator;
// ino.end
// ino.module.RelOp.8610.import
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
import de.dhbwstuttgart.myexception.JVMCodeException;
import de.dhbwstuttgart.syntaxtree.statement.Binary;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.Type;
import de.dhbwstuttgart.typeinference.ConstraintType;
import de.dhbwstuttgart.typeinference.Pair;
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
import de.dhbwstuttgart.typeinference.unify.Unify;
// ino.class.RelOp.24299.declaration
public abstract class RelOp extends Operator
// ino.end
// ino.class.RelOp.24299.body
{
// ino.method.RelOp.24303.definition
public RelOp(int offset, int variableLength)
// ino.end
// ino.method.RelOp.24303.body
{
super(offset, variableLength);
}
// ino.end
protected Hashtable<RefType, RefType> getOperatorTypes() {
Hashtable<RefType, RefType> types = new Hashtable<RefType, RefType>();
types.put(new RefType("java.lang.Integer",this,-1), new RefType("java.lang.Boolean",this,-1));
types.put(new RefType("java.lang.Double",this,-1), new RefType("java.lang.Boolean",this,-1));
types.put(new RefType("java.lang.Float",this,-1), new RefType("java.lang.Boolean",this,-1));
types.put(new RefType("java.lang.Long",this,-1), new RefType("java.lang.Boolean",this,-1));
return types;
}
@Override
public HashMap<ConstraintType,ConstraintType> getReturnTypes(TypeAssumptions ass) {
HashMap<ConstraintType,ConstraintType> ret = new HashMap<>();
ret.put(new RefType("java.lang.Boolean",this,-1).TYPE(ass, this), new RefType("java.lang.Integer",this,-1).TYPE(ass, this));
ret.put(new RefType("java.lang.Boolean",this,-1).TYPE(ass, this), new RefType("java.lang.Double",this,-1).TYPE(ass, this));
ret.put(new RefType("java.lang.Boolean",this,-1).TYPE(ass, this), new RefType("java.lang.Float",this,-1).TYPE(ass, this));
ret.put(new RefType("java.lang.Boolean",this,-1).TYPE(ass, this), new RefType("java.lang.Long",this,-1).TYPE(ass, this));
return ret;
}
}
// ino.end