-- file [Indigo]<Cedar>BCD>TypeStrings.mesa
-- Last Modified By: John Maxwell on  11-Aug-81 10:59:55
-- Last Modified By: Paul Rovner on  13-Aug-81  8:50:54
-- Edited by Satterthwaite,  5-Jan-82 14:23:59

DIRECTORY
	Symbols USING [SEIndex],
	SymbolTable USING [Base];

TypeStrings:DEFINITIONS =
BEGIN

Code: TYPE = MACHINE DEPENDENT
  { definition(200b), name, 
    record, structure, union, array, sequence, enumerated, subrange, opaque,
    countedZone, uncountedZone,
    list, relativeRef, ref, refAny, pointer, longPointer, descriptor, longDescriptor, --address--
    port, process, program, 
    type,
    nil,
    any,
    boolean,
    unspecified,
    globalFrame, localFrame,
    procedure, signal, error, --transfer-- 
    cardinal, integer, character, longInteger, longCardinal, --basic --
    string, stringBody, text, atomRec,
    mds, ordered, packed, readOnly, -- options
    real,
    paint,
    leftParen, rightParen,
  -- additons by EHS
    safeProc,
    safe,
    var
  };        -- not yet:  code, base
-- Code starts at 200b so that a typestring can be parsed rapidly
-- a character in [000c..'Z] is a string name or length
-- a character in [200b..377b] is a code
-- the only exception is paint(8 chars), which is always proceeded by an opaque or paint code

TypeString:TYPE = LONG STRING;

ExampleOpaque:TYPE; -- for debugging purposes

Create:PROCEDURE[base:SymbolTable.Base,sei:Symbols.SEIndex,z:UNCOUNTED ZONE] 
RETURNS[TypeString];
-- will complain if all of the necessary information isn't in base
-- ASSERTION: TypePack.Equivalent[[base1,sei1],[base2,sei2]]  
-- IFF (Create[base1,sei1]=Create[base2,sei2])  

Substitute:PROCEDURE[concrete,opaque,type:TypeString,z:UNCOUNTED ZONE];
-- Substitute will not attempt to recanonicalize
-- ASSERTION: you only need to recanonicalize if
-- adding the concrete type forms a recursion
-- => ERROR is generated if concrete contains any opaque type

END.