<> <> <<>> <> <> DIRECTORY Rope USING [ROPE]; IPBasic: CEDAR DEFINITIONS = BEGIN ValueType: TYPE = MACHINE DEPENDENT {nil(0), number(1), identifier(2), vector(3), operator(4), transformation(5), pixelArray(6), color(7), trajectory(8), outline(9), (LAST[CARDINAL])}; maxInteger: INT = 16777215; -- 2^24 - 1 Integer: TYPE = INT--[0..maxInteger]--; Rational: TYPE = RECORD[num, den: INT]; Number: TYPE = RECORD[SELECT tag: * FROM int => [i: Integer], -- a Number known to be an Integer real => [r: REAL], -- any Number (note that Integers have two equivalent representations) ENDCASE ]; zero: Number = [int[0]]; Any: TYPE = RECORD[type: ValueType, ref: REF _ NIL, number: Number _ zero]; nullAny: Any = [type: nil, ref: NIL, number: zero]; ROPE: TYPE = Rope.ROPE; Identifier: TYPE = ATOM; Marker: TYPE = LONG CARDINAL; -- a unique mark value associated with a context nullMarker: Marker = 0; Vec: TYPE = REF VecRep; -- a constructed vector, from MAKEVEC or MAKEVECLU VecRep: TYPE = RECORD[ shape: VectorShape, array: SEQUENCE size: NAT OF Any ]; VectorShape: TYPE = RECORD[l, n: Integer]; -- l is lower bound, n is number of elements Vector: TYPE = REF; -- currently: Vec, ROPE, or Font PrimitiveOrSymbol: TYPE = {nil, -- a primitive operator or symbol <> get, makeveclu, makevec, shape, openvec, getprop, getp, mergeprop, <> fget, fset, frame, poolop, pool, pget, pset, env, <> makesimpleco, makeco, makecompiledimage, makepool, nopool, do, dosave, dosaveall, dosavesimplebody, dobody, dosavebody, dosaveallbody, <> pop, copy, dup, roll, exch, mark, unmark, unmark0, count, nop, <> if, ifelse, ifcopy, loop, <> eq, eqn, gt, ge, and, or, not, type, <> add, sub, neg, abs, trunc, round, floor, ceiling, mul, div, mod, rem, max, min, sqrt, exp, log, sin, cos, atan, <> iget, iset, <> dround, <> maket, opent, translate, rotate, scale, scale2, concat, invert, transform, transformvec, roundxy, roundxyvec, concatt, move, trans, show, showandxrel, <> setxy, setxyrel, setxrel, setyrel, getcp, getcprounded, <> makepixelarray, finddecompressor, <> findcolor, findcoloroperator, findcolormodeloperator, makegray, setgray, makesampledblack, makesampledcolor, <> moveto, lineto, linetox, linetoy, curveto, arcto, conicto, makeoutline, maskfill, maskstroke, maskstrokeclosed, maskvector, maskrectangle, startunderline, maskunderline, masktrapezoidx, masktrapezoidy, maskpixel, clipoutline, cliprectangle, <> findfont, findfontvec, modifyfont, setfont, <> correctmask, correctspace, setcorrectmeasure, setcorrecttolerance, space, correct, <> beginBody, endBody, beginBlock, endBlock, pageInstructions, noPages, beginVec, comma, endVec -- for written form only }; PrimitiveOp: TYPE = PrimitiveOrSymbol[nil..correct]; Operator: TYPE = REF OperatorRep; ComposedOp: TYPE = REF OperatorRep[composed]; -- a composed operator, from MAKECO, ... InternalOp: TYPE = REF OperatorRep[internal]; -- an internal operator OperatorRep: TYPE = RECORD[ SELECT tag: * FROM composed => [start: Index, initialFrame: Vec], internal => [proc: PROC[State, REF], data: REF], ENDCASE ]; Index: TYPE = INT; -- a byte position in the master nullIndex: Index = -1; SaveType: TYPE = {nil, save, saveAll}; -- parameter to DO and friends State: TYPE = REF StateRep; -- access to the interpreter state StateRep: TYPE; -- see IPState END.