DIRECTORY InterFile, TextEdit, RopeFrom, CIFS, File, IO, RopeEdit, RopeIO, RopeReader; GetInterFileImpl: CEDAR PROGRAM IMPORTS CIFS, RopeFrom, RopeEdit, RopeIO, RopeReader, TextEdit EXPORTS InterFile = BEGIN OPEN InterFile; FromFileError: PUBLIC ERROR = CODE; FromFile: PUBLIC PROC [fileName: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [root: Ref] = { fh: CIFS.OpenFile = CIFS.Open[fileName, CIFS.read]; file: File.Capability _ CIFS.GetFC[fh]; root _ FromFileC[file,start,len]; CIFS.Close[fh] }; FromFileC: PUBLIC PROC [file: File.Capability, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref] = { RETURN [FromRope[RopeFrom.File[file,start,len]]] }; FromStream: PUBLIC PROC [stream: IO.Handle, len: Offset _ MaxLen] RETURNS [Ref] = { RETURN [FromRope[RopeIO.GetRope[stream,len]]] }; FromRope: PUBLIC PROC [rope: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref] = { source: RopeReader.Ref _ RopeReader.Create[]; RopeReader.SetPosition[source,RopeEdit.Substr[rope,start,len]]; RETURN [Tree[source]] }; Tree: PROC [source: RopeReader.Ref] RETURNS [root: Ref] = { RETURN [TextEdit.DocFromNode[TextEdit.FromRope[RopeReader.GetRope[source]]]] }; StartGetFile: PUBLIC PROC = { }; END. Current limited syntax for Tioga InterDoc files: node = '{ typename property* contents child* '} property = propname '= ( text | node ) text = '< character* '> contents = ( text | run )* | other run = '{ looks text '} looks = "looks=" text other = varietyname '[ text '] child = node Ž-- GetInterFileImpl.Mesa -- written by Paxton. January 1981 -- last written by Paxton. August 24, 1982 10:40 am -- not implemented yet ÊݘJšÏc™Jš#™#Jš3™3J˜JšÏk ˜ J˜ J˜ J˜ Jšžœ˜J˜Jšžœ˜J˜ J˜J˜ J˜šœž ˜Jšžœžœ2˜>Jšžœ ˜—Jšžœžœ ˜J˜Jšœžœžœžœ˜#J˜šÏnœžœžœ žœ*˜OJšžœ˜Jšœžœ žœžœ˜3Jšœžœ ˜'J˜!Jšžœ ˜J˜—šŸ œžœžœBžœ ˜iJšžœ-˜3J˜—š Ÿ œžœžœ žœžœ ˜SJšžœ*˜0J˜—š Ÿœžœžœžœ+žœ ˜]J˜-J˜?Jšžœ˜J˜—šŸœžœ˜#Jšžœ˜Jš™JšžœI˜OJ˜—šŸ œžœžœ˜J˜J˜—Jšžœ˜J˜J˜0J˜J˜/J˜&J˜J˜"J˜J˜J˜J˜ J˜J˜—…—âM