diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-16 16:52:57 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-16 16:53:22 -0600 |
commit | f08708ee07931db592ffb76c073bd80bcf6cf060 (patch) | |
tree | af72fc332cbcc2f580d022989330168f76b849c2 | |
parent | 27de8a34f346cddef322c7b65555ddb803532d74 (diff) |
Override BoilSimp constructor
-rw-r--r-- | J2V.java | 3 | ||||
-rw-r--r-- | boil/library/BoilSimp.java | 9 |
2 files changed, 6 insertions, 6 deletions
@@ -24,8 +24,7 @@ public class J2V { root.accept(new SymTableBottomUp<Void>(), symt); root.accept(new SymTableTopDown<Void>(), symt); - BoilSimp vp = new BoilSimp(); - vp.setSymbolTable(symt); + BoilSimp vp = new BoilSimp(symt); root.accept(vp, ""); PrintFilter.print("===================================================", true); diff --git a/boil/library/BoilSimp.java b/boil/library/BoilSimp.java index 0c391db..1de93d1 100644 --- a/boil/library/BoilSimp.java +++ b/boil/library/BoilSimp.java @@ -8,12 +8,14 @@ import java.util.*; public class BoilSimp extends GJDepthFirst<String,String> { - private String vapor; // the collected vapor program - private TypeFactory tf = new TypeFactory(); // the shared type generator + private String vapor; // the collected vapor program + private TypeFactory tf; // the shared type generator private SymbolTable symt; - public void setSymbolTable(SymbolTable symt) { + public BoilSimp(SymbolTable symt) { this.symt = symt; + this.vapor = ""; + this.tf = new TypeFactory(); } public String getVapor() { @@ -76,7 +78,6 @@ public class BoilSimp extends GJDepthFirst<String,String> { * f2 -> <EOF> */ public String visit(Goal n, String args) { - this.vapor = ""; String mod = ""; n.f0.accept(this, args); n.f1.accept(this, args); |