summaryrefslogtreecommitdiff
path: root/Typecheck.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-06 22:54:46 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-06 22:54:46 -0600
commit9cd3df6ff58e3999a049f97a0acaaf997a01fec8 (patch)
tree7573673f4a171e29b70edaa47c0f7852ff7b9824 /Typecheck.java
parent8f1eeb71061e4009abec9356c9430075c0a7f7ee (diff)
Partial restoration of TypeCheckSimp to work with new SymTable
Diffstat (limited to 'Typecheck.java')
-rw-r--r--Typecheck.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/Typecheck.java b/Typecheck.java
index cf86389..4c43709 100644
--- a/Typecheck.java
+++ b/Typecheck.java
@@ -26,18 +26,18 @@ public class Typecheck {
root.accept(new SymTableTopDown<Void>(), symt);
PrintFilter.print("===================================================", true);
- // TypeCheckSimp ts = new TypeCheckSimp();
- // TypeInstance res = root.accept(ts, symt);
+ TypeCheckSimp ts = new TypeCheckSimp();
+ TypeInstance res = root.accept(ts, symt);
- // // Ugly code not to be inspired from: "my" way of storing
- // // type info / typecheck property: if some of my internal
- // // structure is empty, then things don't typecheck for
- // // me. This is specific to my own implementation.
- // // if (res != null && res.type_array.size() > 0)
- // if (res.get_type() != TypeEnum.ERROR)
- // System.out.println("Program type checked successfully");
- // else
- // System.out.println("Type error");
+ // Ugly code not to be inspired from: "my" way of storing
+ // type info / typecheck property: if some of my internal
+ // structure is empty, then things don't typecheck for
+ // me. This is specific to my own implementation.
+ // if (res != null && res.type_array.size() > 0)
+ if (res.getType() != TypeEnum.ERROR)
+ System.out.println("Program type checked successfully");
+ else
+ System.out.println("Type error");
}
catch (ParseException e) {
System.out.println(e.toString());