return nodetable from typecheck
This commit is contained in:
@ -18,8 +18,9 @@ public final class TypeChecker {
|
|||||||
|
|
||||||
private TypeChecker() {}
|
private TypeChecker() {}
|
||||||
|
|
||||||
// Wirft exception bei typeerror, returned nix
|
// TODO: nodeTable?
|
||||||
public static void validate(AST tree) {
|
// Wirft exception bei typeerror, return nodeTable?
|
||||||
|
public static Map<ASTNode, String> validate(AST tree) {
|
||||||
final TypeTable table = TypeTable.fromAST(tree);
|
final TypeTable table = TypeTable.fromAST(tree);
|
||||||
final Map<ASTNode, String> nodeTable = new HashMap<>();
|
final Map<ASTNode, String> nodeTable = new HashMap<>();
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ public final class TypeChecker {
|
|||||||
log("-".repeat(100));
|
log("-".repeat(100));
|
||||||
|
|
||||||
System.out.println("Typechecking successful.");
|
System.out.println("Typechecking successful.");
|
||||||
|
return nodeTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void validate(ASTNode root, TypeTable table, Map<ASTNode, String> nodeTable) {
|
private static void validate(ASTNode root, TypeTable table, Map<ASTNode, String> nodeTable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user