Copyright (C) 1994, Digital Equipment Corp.
INTERFACEfor suppliers of SLisp builtin functionsSLispClass ; IMPORT Rd, IntRefTbl, SLisp, Sx, Wr;
TYPE Atom = REF RECORD val : SLisp.Sexp := NIL; funDefined := FALSE; macro : BOOLEAN := FALSE; funFormals, funBody: SLisp.List := NIL; builtin : SLisp.Builtin := NIL; END; Binding = REF RECORD symbol: SLisp.Symbol; atom : Atom; END; Frame = REF RECORD next : Frame := NIL; size : INTEGER := 0; table : REF ARRAY OF Binding := NIL; procName: TEXT := ""; endScope := FALSE; END; TYPE LookupMode = {CreateLocal, CreateGlobal, LookupOnly}; TPublic = SLisp.PublicT OBJECT topFrame : Frame; frame : Frame; depth := 0; underEval: SLisp.List; evalStack: SLisp.List; METHODS lookup (s: SLisp.Symbol; create := LookupMode.CreateGlobal): Atom; lookupAtom (at: Atom): SLisp.Symbol; pushScope (); popScope (); END; REVEAL SLisp.T <: TPublic; TYPE Range = REF RECORD start, end: INTEGER; form: SLisp.Sexp END; PROCEDURE ReadToTable (rd: SLisp.Reader; table: IntRefTbl.T): SLisp.Sexp RAISES {Rd.EndOfFile, Sx.ReadError};
Read the SLisp program fromrd
as in SLisp.Read except also enter each list s-expression intotable
with aRange
record for its position
PROCEDURE SxToText(sx: REFANY): TEXT RAISES {Sx.PrintError}; PROCEDURE SxPrint (wr : Wr.T; sx : REFANY; maxDepth : CARDINAL := LAST(CARDINAL); maxLength: CARDINAL := LAST(CARDINAL) ) RAISES {Sx.PrintError}; (* Sx.Print extended to handle all types of REFs *) END SLispClass.