-- TiogaJaMImpl.Mesa -- written by Paxton. February 1981 -- last written by Paxton. 3-Jun-81 13:58:52 DIRECTORY TiogaJaM, TextNode, JaMOtherDefs; TiogaJaMImpl: PROGRAM IMPORTS JaMOtherDefs, TiogaJaM EXPORTS TiogaJaM = BEGIN OPEN TiogaJaM, nodeI:TextNode, JaM:JaMOtherDefs; TextOverflow: PUBLIC ERROR = CODE; jam: BOOLEAN = FALSE; -- true if we are running with JaM MakeTypeName: PUBLIC PROC [name: REF TEXT] RETURNS [nodeI.TypeName] = { RETURN [IF jam THEN JaMToType[CreateName[name]] ELSE nodeI.nullTypeName] }; MakeStyleName: PUBLIC PROC [name: REF TEXT] RETURNS [nodeI.StyleName] = { RETURN [IF jam THEN JaMToStyle[CreateName[name]] ELSE nodeI.nullStyleName] }; TextForTypeName: PUBLIC PROC [name: nodeI.TypeName, txt: REF TEXT] = { IF jam THEN JaM.TextForName[JaMText[txt], TypeToJaM[name] ! JaM.TextOverflow => ERROR TextOverflow] ELSE txt.length _ 0 }; TextForStyleName: PUBLIC PROC [name: nodeI.StyleName, txt: REF TEXT] = { IF jam THEN JaM.TextForName[JaMText[txt], StyleToJaM[name] ! JaM.TextOverflow => ERROR TextOverflow] ELSE txt.length _ 0 }; MakeName: PUBLIC PROC [name: REF TEXT] RETURNS [JaMName] = { RETURN [IF jam THEN CreateName[name] ELSE noName] }; TextForName: PUBLIC PROC [name: JaMName, txt: REF TEXT] = { IF jam THEN JaM.TextForName[JaMText[txt], LOOPHOLE[name] ! JaM.TextOverflow => ERROR TextOverflow] ELSE txt.length _ 0 }; JaMText: PROC [txt: REF TEXT] RETURNS [JaM.Text] = INLINE { RETURN [LOOPHOLE[txt]] }; CreateName: PROC [name: REF TEXT] RETURNS [JaMName] = INLINE { RETURN [IF name=NIL OR name.length=0 THEN noName ELSE JaM.CreateName[LOOPHOLE[name]]] }; -- ***** Initialization Start: PUBLIC PROC = { }; END.