refactor conversion

This commit is contained in:
404Simon 2024-05-02 15:47:04 +02:00
parent 0aa5976bc1
commit 4646a4d8d1
5 changed files with 18 additions and 8 deletions

View File

@ -6,6 +6,5 @@ import java.util.Map;
public interface Node { public interface Node {
Type typeCheck(Map<String, Type> localVar, Map<String, Class> classes); Type typeCheck(Map<String, Type> localVar, Map<String, Class> classes);
Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes); Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes, de.maishai.ast.records.Node c);
} }

View File

@ -27,12 +27,17 @@ public class Class implements Node {
Map<String, Type> local = new HashMap<>(); Map<String, Type> local = new HashMap<>();
Map<String, Class> classMap = new HashMap<>(); Map<String, Class> classMap = new HashMap<>();
return convertToTypedAST(local, classMap); return convertToTypedAST(local, classMap, c);
} }
@Override @Override
public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes) { public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes, de.maishai.ast.records.Node untyped) {
return null; Class typedClass = new Class();
for (Field field: fields) {
}
return typedClass;
} }
public void codeGen() { public void codeGen() {

View File

@ -17,7 +17,9 @@ public class Field implements Node {
} }
@Override @Override
public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes) { public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes, de.maishai.ast.records.Node c) {
return null; return null;
} }
} }

View File

@ -21,7 +21,9 @@ public class Method implements Node {
} }
@Override @Override
public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes) { public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes, de.maishai.ast.records.Node c) {
return null; return null;
} }
} }

View File

@ -17,7 +17,9 @@ public class Parameter implements Node {
} }
@Override @Override
public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes) { public Node convertToTypedAST(Map<String, Type> localVar, Map<String, Class> classes, de.maishai.ast.records.Node c) {
return null; return null;
} }
} }