package vaporize.library; import cs132.vapor.ast.*; import java.util.ArrayList; /** * This class contains various generic methods for * assembling common-use vaporm strings. * * Robert Martin cries */ class Kettle { ArrayList vapor; protected Kettle(ArrayList vapor) { this.vapor = vapor; } protected String indexOriginal(Node n) { /** * Given the source position of a Node, returns the original line. */ return this.vapor.get(n.sourcePos.line-1); } protected String functionParameters(VFunction prev, int in, int out, int local) { return String.format("func %s [in %d, out %d, local %d]", this.indexOriginal(prev).split(" ")[1], in, out, local); } protected String spill() { return null; } protected String backup() { return null; } }