PrintJavaCode in PostIncExpr fixed

This commit is contained in:
JanUlrich 2014-08-14 12:25:58 +02:00
parent e7034f82ce
commit d39aecff4d
3 changed files with 34 additions and 21 deletions

View File

@ -180,8 +180,10 @@ public class PostIncExpr extends UnaryExpr
@Override
public JavaCodeResult printJavaCode(ResultSet resultSet) {
// TODO Auto-generated method stub
return null;
JavaCodeResult ret = new JavaCodeResult();
ret.attach(this.expr.printJavaCode(resultSet));
ret.attach("++");
return ret;
}
@Override

View File

@ -91,6 +91,7 @@ public class RefType extends Type implements IMatchable
@Override
public int hashCode() {
int hash = 0;
hash += super.hashCode();
hash += this.name.hashCode();//Nur den Name hashen. Sorgt für langsame, aber funktionierende HashMaps
return hash;
}

View File

@ -2,24 +2,34 @@ import java.util.Vector;
class Matrix extends Vector<Vector<Integer>> {
mvmul(Test v) {
i;
ele;
v.add(i);
return this;
Matrix mul(m){
Vector<Vector<Integer>> ret;
ret = new Matrix();
i;
i = 0;
while(i < this.size()) {
v1;
v2;
v1 = this.elementAt(i);
v2 = new Vector<Integer>();
j;
j = 0;
while(j < v1.size()) {
erg;
erg = 0;
k;
k = 0;
while(k < v1.size()) {
erg = erg + v1.elementAt(k).intValue() * m.elementAt(k).elementAt(j).intValue();
k++;
}
v2.addElement(new Integer(erg));
j++;
}
ret.addElement(v2);
i++;
}
return ret;
}
}
class Test{
void add(Integer i){
}
elementAt(Integer i){
return 1;
}
size(){
return 1;
}
}