diff options
Diffstat (limited to 'vaporize/library/SpillEverywhere.java')
-rw-r--r-- | vaporize/library/SpillEverywhere.java | 79 |
1 files changed, 35 insertions, 44 deletions
diff --git a/vaporize/library/SpillEverywhere.java b/vaporize/library/SpillEverywhere.java index d9e9f3f..d6671bf 100644 --- a/vaporize/library/SpillEverywhere.java +++ b/vaporize/library/SpillEverywhere.java @@ -1,8 +1,5 @@ package vaporize.library; -import java.util.logging.Logger; -import java.util.logging.ConsoleHandler; - import cs132.vapor.ast.*; import st.*; import misc.*; @@ -10,13 +7,6 @@ import java.util.*; public class SpillEverywhere extends VInstr.VisitorPR<String, String, RuntimeException> { - private static Logger log = Logger.getLogger(SpillEverywhere.class.getName()); - private static ConsoleHandler consoleHandler = new ConsoleHandler(); - static { - consoleHandler.setFormatter(new MinimalSimpleFormatter()); - log.addHandler(consoleHandler); - } - private VaporProgram vp; private Kettle kettle; private String vaporm; @@ -41,74 +31,75 @@ public class SpillEverywhere extends VInstr.VisitorPR<String, String, RuntimeExc for (VFunction f : vp.functions) { for (VInstr s : f.body) { - // s.accept("", this); + s.accept("", this); } this.kettle.replaceFunctionDeclare(f, 0, 0, 0); } - this.log.info(kettle.dump()); + MinimalLogger.info(kettle.dump()); } public String visit(String p, VMemRead n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VMemWrite n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + System.out.println("HEY!"); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VAssign n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VBranch n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VGoto n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VCall n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VBuiltIn n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.op.name, - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.op.name, + this.kettle.get(n), + n.sourcePos.toString())); return null; } public String visit(String p, VReturn n) throws RuntimeException { - log.info(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n), - n.sourcePos.toString())); + MinimalLogger.info(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + this.kettle.get(n), + n.sourcePos.toString())); return null; } |