From 4646a4d8d1a9851ecb244df0d0a60f59b7cbb932 Mon Sep 17 00:00:00 2001 From: 404Simon Date: Thu, 2 May 2024 15:47:04 +0200 Subject: [PATCH] refactor conversion --- src/main/java/de/maishai/typedast/Node.java | 3 +-- .../java/de/maishai/typedast/typedclass/Class.java | 11 ++++++++--- .../java/de/maishai/typedast/typedclass/Field.java | 4 +++- .../java/de/maishai/typedast/typedclass/Method.java | 4 +++- .../de/maishai/typedast/typedclass/Parameter.java | 4 +++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/maishai/typedast/Node.java b/src/main/java/de/maishai/typedast/Node.java index e5277d0..a671404 100644 --- a/src/main/java/de/maishai/typedast/Node.java +++ b/src/main/java/de/maishai/typedast/Node.java @@ -6,6 +6,5 @@ import java.util.Map; public interface Node { Type typeCheck(Map localVar, Map classes); - Node convertToTypedAST(Map localVar, Map classes); - + Node convertToTypedAST(Map localVar, Map classes, de.maishai.ast.records.Node c); } diff --git a/src/main/java/de/maishai/typedast/typedclass/Class.java b/src/main/java/de/maishai/typedast/typedclass/Class.java index 92d1455..3957d48 100644 --- a/src/main/java/de/maishai/typedast/typedclass/Class.java +++ b/src/main/java/de/maishai/typedast/typedclass/Class.java @@ -27,12 +27,17 @@ public class Class implements Node { Map local = new HashMap<>(); Map classMap = new HashMap<>(); - return convertToTypedAST(local, classMap); + return convertToTypedAST(local, classMap, c); } @Override - public Node convertToTypedAST(Map localVar, Map classes) { - return null; + public Node convertToTypedAST(Map localVar, Map classes, de.maishai.ast.records.Node untyped) { + Class typedClass = new Class(); + + for (Field field: fields) { + + } + return typedClass; } public void codeGen() { diff --git a/src/main/java/de/maishai/typedast/typedclass/Field.java b/src/main/java/de/maishai/typedast/typedclass/Field.java index f8676ba..7f7821c 100644 --- a/src/main/java/de/maishai/typedast/typedclass/Field.java +++ b/src/main/java/de/maishai/typedast/typedclass/Field.java @@ -17,7 +17,9 @@ public class Field implements Node { } @Override - public Node convertToTypedAST(Map localVar, Map classes) { + public Node convertToTypedAST(Map localVar, Map classes, de.maishai.ast.records.Node c) { return null; } + + } diff --git a/src/main/java/de/maishai/typedast/typedclass/Method.java b/src/main/java/de/maishai/typedast/typedclass/Method.java index 93d24a3..cca4481 100644 --- a/src/main/java/de/maishai/typedast/typedclass/Method.java +++ b/src/main/java/de/maishai/typedast/typedclass/Method.java @@ -21,7 +21,9 @@ public class Method implements Node { } @Override - public Node convertToTypedAST(Map localVar, Map classes) { + public Node convertToTypedAST(Map localVar, Map classes, de.maishai.ast.records.Node c) { return null; } + + } diff --git a/src/main/java/de/maishai/typedast/typedclass/Parameter.java b/src/main/java/de/maishai/typedast/typedclass/Parameter.java index 6b05dfe..3127ff2 100644 --- a/src/main/java/de/maishai/typedast/typedclass/Parameter.java +++ b/src/main/java/de/maishai/typedast/typedclass/Parameter.java @@ -17,7 +17,9 @@ public class Parameter implements Node { } @Override - public Node convertToTypedAST(Map localVar, Map classes) { + public Node convertToTypedAST(Map localVar, Map classes, de.maishai.ast.records.Node c) { return null; } + + }