forked from JavaTX/JavaCompilerCore
commenting, refactoring
This commit is contained in:
parent
0313d297e1
commit
55f288022a
@ -1,31 +1,55 @@
|
|||||||
package de.dhbwstuttgart.typeinference.unify.model;
|
package de.dhbwstuttgart.typeinference.unify.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A pair which contains two types and an operator, e.q. (Integer <. a).
|
||||||
|
* @author Florian Steurer
|
||||||
|
*/
|
||||||
public class UnifyPair {
|
public class UnifyPair {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type on the left hand side of the pair.
|
||||||
|
*/
|
||||||
private UnifyType lhs;
|
private UnifyType lhs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type on the right hand side of the pair.
|
||||||
|
*/
|
||||||
private UnifyType rhs;
|
private UnifyType rhs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The operator that determines the relation between the left and right hand side type.
|
||||||
|
*/
|
||||||
private PairOperator pairOp;
|
private PairOperator pairOp;
|
||||||
|
|
||||||
/*public MPair(Type t1, Type t2) {
|
/**
|
||||||
lhs = t1;
|
* Creates a new instance of the pair.
|
||||||
rhs = t2;
|
* @param lhs The type on the left hand side of the pair.
|
||||||
pairOp = PairOperator.SMALLER;
|
* @param rhs The type on the right hand side of the pair.
|
||||||
}*/
|
* @param op The operator that determines the relation between the left and right hand side type.
|
||||||
|
*/
|
||||||
public UnifyPair(UnifyType t1, UnifyType t2, PairOperator op) {
|
public UnifyPair(UnifyType lhs, UnifyType rhs, PairOperator op) {
|
||||||
lhs = t1;
|
this.lhs = lhs;
|
||||||
rhs = t2;
|
this.rhs = rhs;
|
||||||
pairOp = op;
|
pairOp = op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the type on the left hand side of the pair.
|
||||||
|
*/
|
||||||
public UnifyType getLhsType() {
|
public UnifyType getLhsType() {
|
||||||
return lhs;
|
return lhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the type on the right hand side of the pair.
|
||||||
|
*/
|
||||||
public UnifyType getRhsType() {
|
public UnifyType getRhsType() {
|
||||||
return rhs;
|
return rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the operator that determines the relation between the left and right hand side type.
|
||||||
|
*/
|
||||||
public PairOperator getPairOp() {
|
public PairOperator getPairOp() {
|
||||||
return pairOp;
|
return pairOp;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user