From 61e9c953c924995a859dc788eb82e4f0e742cd00 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 9 Apr 2014 15:54:20 +0200 Subject: [PATCH] fixed getChildren() --- src/mycompiler/mystatement/Binary.java | 5 ++++- src/mycompiler/mystatement/ForStmt.java | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mycompiler/mystatement/Binary.java b/src/mycompiler/mystatement/Binary.java index 3bd3c40a3..effe3e42f 100755 --- a/src/mycompiler/mystatement/Binary.java +++ b/src/mycompiler/mystatement/Binary.java @@ -270,7 +270,10 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { @Override public Vector getChildren() { - throw new NotImplementedException(); + Vector ret = new Vector(); + ret.add(this.expr1); + ret.add(this.expr2); + return ret; } diff --git a/src/mycompiler/mystatement/ForStmt.java b/src/mycompiler/mystatement/ForStmt.java index 1cd575f54..51e25223a 100755 --- a/src/mycompiler/mystatement/ForStmt.java +++ b/src/mycompiler/mystatement/ForStmt.java @@ -136,8 +136,14 @@ public JavaCodeResult printJavaCode(ResultSet resultSet) { @Override public Vector getChildren() { Vector ret = new Vector(); - ret.add(this.body_Loop_block); - throw new NotImplementedException(); - //return ret; + if(this.body_Loop_block!=null)ret.add(this.body_Loop_block); + if(this.head_Condition!=null)ret.add(this.head_Condition); + if(this.head_Condition_1!=null)ret.add(this.head_Condition_1); + if(this.head_Initializer!=null)ret.add(this.head_Initializer); + if(this.head_Initializer_1!=null)ret.add(this.head_Initializer_1); + if(this.head_Loop_expr!=null)ret.add(this.head_Loop_expr); + if(this.head_Loop_expr_1!=null)ret.add(this.head_Loop_expr_1); + //throw new NotImplementedException(); + return ret; } } \ No newline at end of file