Package edu.cornell.cs.cs4120.util
Interface SExpPrinter
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
CodeWriterSExpPrinter
public interface SExpPrinter extends java.lang.AutoCloseable
A pretty-printer for S-expressions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Flushes and closes both this printer and any underlying output stream to which it is attached.void
endList()
Prints the close parenthesis of an S-expression list.void
flush()
Flushes all formatted text to the underlying writer.void
printAtom(java.lang.String atom)
Prints an atom.void
startList()
Prints the open parenthesis of an S-expression list.default void
startUnifiedList()
Prints the open parenthesis of an S-expression list, and requires that if a line break is required to separate any two elements of this list, then all elements of this list must be separated by a line break (optional operation).
-
-
-
Method Detail
-
printAtom
void printAtom(java.lang.String atom)
Prints an atom.- Parameters:
atom
- the atom to print
-
startList
void startList()
Prints the open parenthesis of an S-expression list.
-
startUnifiedList
default void startUnifiedList()
Prints the open parenthesis of an S-expression list, and requires that if a line break is required to separate any two elements of this list, then all elements of this list must be separated by a line break (optional operation).
-
endList
void endList()
Prints the close parenthesis of an S-expression list.
-
flush
void flush()
Flushes all formatted text to the underlying writer. This method should be called when printing is complete.
-
close
void close()
Flushes and closes both this printer and any underlying output stream to which it is attached. It is an error to perform any subsequent operations on the same printer.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-