package vaporize.library; import cs132.vapor.ast.*; import st.*; import misc.*; import java.util.*; public class SpillEverywhere extends VInstr.VisitorPR { ArrayList vapor; String vaporm; public SpillEverywhere(ArrayList vapor) { this.vapor = vapor; this.vaporm = ""; } public R visit(P p, VMemRead n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VMemWrite n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VAssign n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VBranch n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VGoto n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VCall n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VBuiltIn n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.op.name, this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } public R visit(P p, VReturn n) throws RuntimeException { PrintFilter.print(String.format("%s (%s:%s)", n.getClass().getSimpleName(), this.vapor.get(n.sourcePos.line-1), n.sourcePos.toString()), true); return null; } }