-- file LiteralOps.Mesa
-- last modified by Satterthwaite, February 18, 1983 9:16 am

DIRECTORY
  Alloc: TYPE USING [Handle],
  Literals: TYPE,
  Strings: TYPE USING [String, SubString],
  Symbols: TYPE USING [Type];

LiteralOps: DEFINITIONS = {
  OPEN Literals;

  Initialize: PROC [Alloc.Handle, UNCOUNTED ZONE];
  Finalize: PROC;
 

 -- discrimination
 
  WordIndex: PROC [index: LitIndex] RETURNS [LTIndex] = INLINE {
    RETURN [NARROW[index, LitIndex.word].lti]};
   
  StringIndex: PROC [index: LitIndex] RETURNS [STIndex] = INLINE {
    RETURN [NARROW[index, LitIndex.string].sti]};

     
  -- procedural interface for standard literals

  ValueDescriptor: TYPE = LONG DESCRIPTOR FOR ARRAY OF WORD;
  
  CopyLiteral: PROC [LTId] RETURNS [LitIndex.word];
  DescriptorValue: PROC [LTIndex] RETURNS [LitDescriptor];
  FindDescriptor: PROC [LiteralOps.ValueDescriptor] RETURNS [LitIndex.word];
  Find: PROC [WORD] RETURNS [LitIndex.word];
  ForgetEntries: PROC RETURNS [currentSize: CARDINAL];
  Value: PROC [LTIndex] RETURNS [WORD];


 -- procedural interface for string literals

  EnumerateHeapStrings: PROC [PROC [STIndex]];
  EnumerateLocalStrings: PROC [STIndex, PROC [MSTIndex]];
  EnumerateMasterStrings: PROC [PROC [MSTIndex]];
  FindHeapString: PROC [STIndex, Symbols.Type] RETURNS [STIndex];
  FindLocalString: PROC [STIndex] RETURNS [STIndex];
  FindString: PROC [Strings.SubString] RETURNS [LitIndex.string];
  MasterString: PROC [sti: STIndex] RETURNS [MSTIndex];
  ResetLocalStrings: PROC RETURNS [STIndex];
  StringReference: PROC [STIndex];
  StringValue: PROC [STIndex] RETURNS [Strings.String];
  TextType: PROC [STIndex] RETURNS [Symbols.Type];

  }.