From 5b07d580934fa934db9590d888f12ea10de36b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Schr=C3=B6dter?= Date: Wed, 30 Mar 2016 10:14:05 +0200 Subject: [PATCH] - Klassenvariable ohne Wert --- src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java index 08f0df8d..7cc3c54b 100644 --- a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java +++ b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java @@ -180,7 +180,13 @@ public class FieldDeclaration extends Field{ //Die Felddekleration an den Konstruktor anhängen: InstructionList il = new InstructionList(); il.append(new This(this).genByteCode(cg, rs)); - il.append(this.wert.genByteCode(cg, rs)); + + if(wert != null){ + il.append(this.wert.genByteCode(cg, rs)); + }else{ + //todo: default wert? + } + FieldInstruction putFieldInstruction = cg.getInstructionFactory().createFieldAccess(this.getParentClass().getName().toString(), this.getDescription(cg, rs), this.getType().getBytecodeType(cg, rs), Constants.PUTFIELD);