DIRECTORY IO USING [STREAM], IPBasic USING [Op, Rational], Rope USING [ROPE]; IPWriter: CEDAR DEFINITIONS ~ BEGIN OPEN IPBasic; ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; ErrorCode: TYPE ~ { ok, -- initial value for an ErrorCode bug, -- implementation bug unimplemented, -- operation not currently implemented unknownEncoding, -- the requested encoding is not implemented illegalArgument, -- invalid argument for an operation closed -- tried to operate on a closed writer }; Error: ERROR[code: ErrorCode, explanation: ROPE _ NIL]; Writer: TYPE ~ REF WriterRep; WriterRep: TYPE ~ RECORD[class: Class, stream: STREAM]; Class: TYPE ~ REF ClassRep; ClassRep: TYPE ~ RECORD[ encoding: ATOM _, putOp: PROC[writer: Writer, op: Op] _, putInt: PROC[writer: Writer, value: INT] _, putReal: PROC[writer: Writer, value: REAL] _, putRational: PROC[writer: Writer, value: Rational] _, putIdentifier: PROC[writer: Writer, rope: ROPE] _, putString: PROC[writer: Writer, rope: ROPE] _, putInsertfile: PROC[writer: Writer, rope: ROPE] _, putComment: PROC[writer: Writer, rope: ROPE] _, putAnnotation: PROC[writer: Writer, rope: ROPE] _ ]; Open: PROC[name: ROPE, encoding: ATOM] RETURNS[Writer]; Create: PROC[stream: STREAM, encoding: ATOM] RETURNS[Writer]; PutHeader: PROC[writer: Writer]; Close: PROC[writer: Writer]; PutOp: PROC[writer: Writer, op: Op] ~ INLINE { writer.class.putOp[writer, op] }; PutInt: PROC[writer: Writer, value: INT] ~ INLINE { writer.class.putInt[writer, value] }; PutReal: PROC[writer: Writer, value: REAL] ~ INLINE { writer.class.putReal[writer, value] }; PutRational: PROC[writer: Writer, value: Rational] ~ INLINE { writer.class.putRational[writer, value] }; PutIdentifier: PROC[writer: Writer, rope: ROPE] ~ INLINE { writer.class.putIdentifier[writer, rope] }; PutString: PROC[writer: Writer, rope: ROPE] ~ INLINE { writer.class.putString[writer, rope] }; PutComment: PROC[writer: Writer, rope: ROPE] ~ INLINE { writer.class.putComment[writer, rope] }; PutAnnotation: PROC[writer: Writer, rope: ROPE] ~ INLINE { writer.class.putAnnotation[writer, rope] }; PutInsertfile: PROC[writer: Writer, rope: ROPE] ~ INLINE { writer.class.putInsertfile[writer, rope] }; Register: PROC[class: Class]; END.  IPWriter.mesa Token-level interface for writing encoded Interpress masters Last edited by: Doug Wyatt, March 12, 1984 1:10:10 pm PST Create the named file, write a header for the specified encoding, and return a Writer. Create a Writer for the given stream. (Does not write a header.) Write an Interpress header for the writer's encoding. Close the writer's stream and prevent further calls on the writer. Ê©˜Jšœ ™ J™Jšœ<™