From d39aecff4dde339e5db47cd31a1499666c520cd1 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 14 Aug 2014 12:25:58 +0200 Subject: [PATCH] PrintJavaCode in PostIncExpr fixed --- src/mycompiler/mystatement/PostIncExpr.java | 6 ++- src/mycompiler/mytype/RefType.java | 1 + .../TypeInsertTests/LambdaTest22.jav | 48 +++++++++++-------- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/mycompiler/mystatement/PostIncExpr.java b/src/mycompiler/mystatement/PostIncExpr.java index ae6ddbf5..65e3e726 100755 --- a/src/mycompiler/mystatement/PostIncExpr.java +++ b/src/mycompiler/mystatement/PostIncExpr.java @@ -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 diff --git a/src/mycompiler/mytype/RefType.java b/src/mycompiler/mytype/RefType.java index 72810d73..6cc1a93a 100755 --- a/src/mycompiler/mytype/RefType.java +++ b/src/mycompiler/mytype/RefType.java @@ -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; } diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest22.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest22.jav index e0d9849a..001e3d5b 100644 --- a/test/plugindevelopment/TypeInsertTests/LambdaTest22.jav +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest22.jav @@ -2,24 +2,34 @@ import java.util.Vector; class Matrix extends Vector> { - mvmul(Test v) { - i; - ele; - v.add(i); - return this; + Matrix mul(m){ + Vector> ret; + ret = new Matrix(); + i; + i = 0; + while(i < this.size()) { + v1; + v2; + v1 = this.elementAt(i); + v2 = new Vector(); + 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; -} + } \ No newline at end of file