From 15d120d59481865172fcced93afb632d7f3e6b65 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 31 Jan 2018 15:51:38 +0100 Subject: [PATCH] =?UTF-8?q?Funktionsf=C3=A4higes=20Matrix=20Beispiel,=20ab?= =?UTF-8?q?er=20nicht=20komplett?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/dhbwstuttgart/core/JavaTXCompiler.java | 2 +- src/de/dhbwstuttgart/syntaxtree/statement/Literal.java | 3 +++ src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java | 2 +- src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java index 86666a49..e8d74cb6 100644 --- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -82,7 +82,7 @@ public class JavaTXCompiler { List allClasses = new ArrayList<>();//environment.getAllAvailableClasses(); //Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC for(SourceFile sf : this.sourceFiles.values()) { - //allClasses.addAll(getAvailableClasses(sf)); + allClasses.addAll(getAvailableClasses(sf)); allClasses.addAll(sf.getClasses()); } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java b/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java index b6ad9e96..8bbaae0a 100644 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Literal.java @@ -10,8 +10,11 @@ import org.antlr.v4.runtime.Token; public class Literal extends Expression { + public final Object value; + public Literal(RefTypeOrTPHOrWildcardOrGeneric type, Object value, Token offset) { super(type, offset); + this.value = value; } @Override diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java b/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java index 7d97d4b7..c7a06502 100644 --- a/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java +++ b/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java @@ -360,6 +360,6 @@ public class OutputGenerator implements ASTVisitor{ @Override public void visit(de.dhbwstuttgart.syntaxtree.statement.Literal literal) { - throw new NotImplementedException(); + out.append(literal.value); } } \ No newline at end of file diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java index 423a4f65..a06062c0 100644 --- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java +++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java @@ -83,7 +83,7 @@ public class TYPEStmt implements StatementVisitor{ @Override public void visit(BinaryExpr binary) { - throw new NotImplementedException(); + //TODO } @Override @@ -209,7 +209,7 @@ public class TYPEStmt implements StatementVisitor{ @Override public void visit(Literal literal) { - throw new NotImplementedException(); + //Nothing to do here. Literale kriegen beim parsen den korrekten Typ. } @Override