/** * Enter a new precedence level. Emit a `(' if new precedence level is less than precedence level * so far. * * @param contextPrec The precedence level in force so far. * @param ownPrec The new precedence level. */ void open(int contextPrec, int ownPrec) throws IOException { if (ownPrec < contextPrec) out.write("("); }
/** Align code to be indented to left margin. */ void align() throws IOException { for (int i = 0; i < lmargin; i++) out.write(" "); }
/** Print string, replacing all non-ascii character with unicode escapes. */ public void print(Object s) throws IOException { out.write(Convert.escapeUnicode(s.toString())); }
/** Print new line. */ public void println() throws IOException { out.write(lineSep); }
/** * Leave precedence level. Emit a `(' if inner precedence level is less than precedence level we * revert to. * * @param contextPrec The precedence level we revert to. * @param ownPrec The inner precedence level. */ void close(int contextPrec, int ownPrec) throws IOException { if (ownPrec < contextPrec) out.write(")"); }