Exemplo n.º 1
0
 /**
  * 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("(");
 }
Exemplo n.º 2
0
 /** Align code to be indented to left margin. */
 void align() throws IOException {
   for (int i = 0; i < lmargin; i++) out.write(" ");
 }
Exemplo n.º 3
0
 /** Print string, replacing all non-ascii character with unicode escapes. */
 public void print(Object s) throws IOException {
   out.write(Convert.escapeUnicode(s.toString()));
 }
Exemplo n.º 4
0
 /** Print new line. */
 public void println() throws IOException {
   out.write(lineSep);
 }
Exemplo n.º 5
0
 /**
  * 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(")");
 }