diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-23 15:59:01 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-23 15:59:01 -0600 |
commit | 12520b3e79d1050f8dd7ada09a06d49f19bd5401 (patch) | |
tree | 5b6ba110da43ffcec5c8bcbe387ff5a5920cf59c /boil/library/BoilSimp.java | |
parent | 1cbc6acab2c1bd745649a639db023b0f6c87f821 (diff) |
Fix first of a few new minor bugs introduced with rewrite
Diffstat (limited to 'boil/library/BoilSimp.java')
-rw-r--r-- | boil/library/BoilSimp.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/boil/library/BoilSimp.java b/boil/library/BoilSimp.java index 25b27e0..4763834 100644 --- a/boil/library/BoilSimp.java +++ b/boil/library/BoilSimp.java @@ -62,6 +62,7 @@ public class BoilSimp extends GJDepthFirst<String,String> { } else return ""; + } public String visit(NodeOptional n, String args) { @@ -94,9 +95,11 @@ public class BoilSimp extends GJDepthFirst<String,String> { */ public String visit(Goal n, String args) { String mod = ""; + /////////////////////////////////////////////////////////////// n.f0.accept(this, args); n.f1.accept(this, args); n.f2.accept(this, args); + /////////////////////////////////////////////////////////////// return mod; } @@ -122,7 +125,7 @@ public class BoilSimp extends GJDepthFirst<String,String> { */ public String visit(MainClass n, String args) { String id = n.f1.f0.tokenImage; - + /////////////////////////////////////////////////////////////// this.symt.setActive(TypeEnum.classname, id); this.symt.setActive(TypeEnum.method, "main"); this.tf.reset(); @@ -153,6 +156,7 @@ public class BoilSimp extends GJDepthFirst<String,String> { "exit:\n ret\n\n"; this.symt.removeActive(TypeEnum.method); + /////////////////////////////////////////////////////////////// return mod; } @@ -162,7 +166,9 @@ public class BoilSimp extends GJDepthFirst<String,String> { */ public String visit(TypeDeclaration n, String args) { String mod = ""; + /////////////////////////////////////////////////////////////// n.f0.accept(this, args); + /////////////////////////////////////////////////////////////// return mod; } @@ -176,8 +182,10 @@ public class BoilSimp extends GJDepthFirst<String,String> { */ public String visit(ClassDeclaration n, String args) { String id = n.f1.f0.tokenImage; - this.symt.setActive(TypeEnum.classname, id); String mod = ""; + /////////////////////////////////////////////////////////////// + this.symt.setActive(TypeEnum.classname, id); + n.f0.accept(this, args); n.f1.accept(this, args); |