|
@@ -201,8 +201,6 @@ PROCEDURE CurRes (): TypeIndex;
|
|
|
(* Result type of the innermost open procedure,
|
|
(* Result type of the innermost open procedure,
|
|
|
InvalidType outside procedures or for proper procedures. *)
|
|
InvalidType outside procedures or for proper procedures. *)
|
|
|
|
|
|
|
|
-PROCEDURE ProcDepth (): CARDINAL;
|
|
|
|
|
-(* Number of open procedure headings/bodies (nesting depth). *)
|
|
|
|
|
|
|
|
|
|
PROCEDURE ProcDepthOf (name: ARRAY OF CHAR): CARDINAL;
|
|
PROCEDURE ProcDepthOf (name: ARRAY OF CHAR): CARDINAL;
|
|
|
(* Lexical function-nesting depth of the named procedure
|
|
(* Lexical function-nesting depth of the named procedure
|
|
@@ -218,11 +216,6 @@ PROCEDURE ParamType (name: ARRAY OF CHAR; i: CARDINAL): TypeIndex;
|
|
|
PROCEDURE ParamIsVar (name: ARRAY OF CHAR; i: CARDINAL): BOOLEAN;
|
|
PROCEDURE ParamIsVar (name: ARRAY OF CHAR; i: CARDINAL): BOOLEAN;
|
|
|
(* Positional formal access for call checking (233 on mismatch). *)
|
|
(* Positional formal access for call checking (233 on mismatch). *)
|
|
|
|
|
|
|
|
-PROCEDURE ParamName (name: ARRAY OF CHAR; i: CARDINAL;
|
|
|
|
|
- VAR out: ARRAY OF CHAR): BOOLEAN;
|
|
|
|
|
-(* The i-th formal's name (FALSE when out of range). Read-only helper
|
|
|
|
|
- for the two-phase Lower walk. *)
|
|
|
|
|
-
|
|
|
|
|
PROCEDURE VarParamOk (actual, formal: TypeIndex): BOOLEAN;
|
|
PROCEDURE VarParamOk (actual, formal: TypeIndex): BOOLEAN;
|
|
|
(* VAR-formal compatibility: same type, fixed array into open
|
|
(* VAR-formal compatibility: same type, fixed array into open
|
|
|
array with same element, or string literal into open CHAR. *)
|
|
array with same element, or string literal into open CHAR. *)
|
|
@@ -248,19 +241,13 @@ PROCEDURE BeginProg (name: ARRAY OF CHAR): BOOLEAN;
|
|
|
PROCEDURE EndUnit;
|
|
PROCEDURE EndUnit;
|
|
|
(* Returns to the global scope. *)
|
|
(* Returns to the global scope. *)
|
|
|
|
|
|
|
|
-PROCEDURE CurUnit (): INTEGER;
|
|
|
|
|
-(* Unit kind currently open (UnitProg/Def/Impl); -1 between units. *)
|
|
|
|
|
|
|
|
|
|
-PROCEDURE CurModule (VAR name: Name);
|
|
|
|
|
-(* Name of the module currently open ('' between units). *)
|
|
|
|
|
|
|
|
|
|
PROCEDURE HaveProgram (): BOOLEAN;
|
|
PROCEDURE HaveProgram (): BOOLEAN;
|
|
|
(* TRUE once a program module has been opened (a session without
|
|
(* TRUE once a program module has been opened (a session without
|
|
|
one is an error: nothing to link). *)
|
|
one is an error: nothing to link). *)
|
|
|
|
|
|
|
|
PROCEDURE ModKnown (name: ARRAY OF CHAR): BOOLEAN;
|
|
PROCEDURE ModKnown (name: ARRAY OF CHAR): BOOLEAN;
|
|
|
-PROCEDURE ModDefined (name: ARRAY OF CHAR): BOOLEAN;
|
|
|
|
|
-PROCEDURE ModImplemented (name: ARRAY OF CHAR): BOOLEAN;
|
|
|
|
|
|
|
|
|
|
PROCEDURE ImportFrom (mod, name: ARRAY OF CHAR): BOOLEAN;
|
|
PROCEDURE ImportFrom (mod, name: ARRAY OF CHAR): BOOLEAN;
|
|
|
(* Materializes an exported name from mod into the current scope
|
|
(* Materializes an exported name from mod into the current scope
|
|
@@ -271,16 +258,8 @@ PROCEDURE OpaqueBase (name: ARRAY OF CHAR): TypeIndex;
|
|
|
returns that alias descriptor so the implementation can complete
|
|
returns that alias descriptor so the implementation can complete
|
|
|
it via SetTarget; InvalidType otherwise. *)
|
|
it via SetTarget; InvalidType otherwise. *)
|
|
|
|
|
|
|
|
-PROCEDURE QualFind (mod, name: ARRAY OF CHAR): BOOLEAN;
|
|
|
|
|
-(* TRUE when mod exports name. *)
|
|
|
|
|
|
|
|
|
|
-PROCEDURE QualKind (mod, name: ARRAY OF CHAR): INTEGER;
|
|
|
|
|
PROCEDURE QualType (mod, name: ARRAY OF CHAR): TypeIndex;
|
|
PROCEDURE QualType (mod, name: ARRAY OF CHAR): TypeIndex;
|
|
|
-PROCEDURE QualProcUid (mod, name: ARRAY OF CHAR): CARDINAL;
|
|
|
|
|
-PROCEDURE QualProcNPar (mod, name: ARRAY OF CHAR): CARDINAL;
|
|
|
|
|
-PROCEDURE QualParamType (mod, name: ARRAY OF CHAR; i: CARDINAL): TypeIndex;
|
|
|
|
|
-PROCEDURE QualParamIsVar (mod, name: ARRAY OF CHAR; i: CARDINAL): BOOLEAN;
|
|
|
|
|
-PROCEDURE QualProcRes (mod, name: ARRAY OF CHAR): TypeIndex;
|
|
|
|
|
|
|
|
|
|
PROCEDURE ExportUp (name: ARRAY OF CHAR);
|
|
PROCEDURE ExportUp (name: ARRAY OF CHAR);
|
|
|
(* Nested-module END: clones the entry `name` from the just-finished
|
|
(* Nested-module END: clones the entry `name` from the just-finished
|
|
@@ -389,7 +368,6 @@ PROCEDURE PushClassMembers (t: TypeIndex): BOOLEAN;
|
|
|
(* ---------------- type descriptors ---------------- *)
|
|
(* ---------------- type descriptors ---------------- *)
|
|
|
|
|
|
|
|
PROCEDURE NewAlias (): TypeIndex;
|
|
PROCEDURE NewAlias (): TypeIndex;
|
|
|
-PROCEDURE NewSub (base: TypeIndex): TypeIndex;
|
|
|
|
|
PROCEDURE NewSubR (lo, hi: INTEGER): TypeIndex;
|
|
PROCEDURE NewSubR (lo, hi: INTEGER): TypeIndex;
|
|
|
(* Integer subrange [lo..hi] (no base descriptor needed). Bounds
|
|
(* Integer subrange [lo..hi] (no base descriptor needed). Bounds
|
|
|
accessors arrive with step 3; the backend cannot lower them yet. *)
|
|
accessors arrive with step 3; the backend cannot lower them yet. *)
|
|
@@ -411,8 +389,6 @@ PROCEDURE BoundHi (i: CARDINAL): INTEGER;
|
|
|
(* Read back the accumulated bounds (so a caller can snapshot them
|
|
(* Read back the accumulated bounds (so a caller can snapshot them
|
|
|
before parsing a nested element type that reuses the buffer). *)
|
|
before parsing a nested element type that reuses the buffer). *)
|
|
|
|
|
|
|
|
-PROCEDURE NestArray (elem: TypeIndex): TypeIndex;
|
|
|
|
|
-(* Nests the accumulated bounds inside-out around elem. *)
|
|
|
|
|
PROCEDURE NewRecord (): TypeIndex;
|
|
PROCEDURE NewRecord (): TypeIndex;
|
|
|
PROCEDURE IsOrdinal (t: TypeIndex): BOOLEAN;
|
|
PROCEDURE IsOrdinal (t: TypeIndex): BOOLEAN;
|
|
|
(* integer family / CHAR / UCHAR / BOOLEAN / enumeration. *)
|
|
(* integer family / CHAR / UCHAR / BOOLEAN / enumeration. *)
|
|
@@ -465,7 +441,6 @@ PROCEDURE FwdVarRef (name: ARRAY OF CHAR; kind: INTEGER;
|
|
|
body before its declaration (forward variable). kind is KindVar
|
|
body before its declaration (forward variable). kind is KindVar
|
|
|
(variable) or KindProc (procedure); id/t identify the placeholder. *)
|
|
(variable) or KindProc (procedure); id/t identify the placeholder. *)
|
|
|
PROCEDURE FwdVarType (id: INTEGER): TypeIndex;
|
|
PROCEDURE FwdVarType (id: INTEGER): TypeIndex;
|
|
|
-PROCEDURE FwdVarKind (id: INTEGER): INTEGER;
|
|
|
|
|
PROCEDURE IsFwdVar (t: TypeIndex): BOOLEAN;
|
|
PROCEDURE IsFwdVar (t: TypeIndex): BOOLEAN;
|
|
|
(* TRUE for a forward-variable placeholder: type checks are lenient. *)
|
|
(* TRUE for a forward-variable placeholder: type checks are lenient. *)
|
|
|
|
|
|
|
@@ -587,8 +562,6 @@ PROCEDURE ArithCheck (l, r: TypeIndex; divmod: BOOLEAN;
|
|
|
VAR res: TypeIndex): BOOLEAN;
|
|
VAR res: TypeIndex): BOOLEAN;
|
|
|
(* + - * / (divmod FALSE) or DIV MOD (TRUE); res is result type (211). *)
|
|
(* + - * / (divmod FALSE) or DIV MOD (TRUE); res is result type (211). *)
|
|
|
|
|
|
|
|
-PROCEDURE UnaryCheck (t: TypeIndex; VAR res: TypeIndex): BOOLEAN;
|
|
|
|
|
-(* Unary + - (part of 211). *)
|
|
|
|
|
|
|
|
|
|
PROCEDURE BoolCheck (t: TypeIndex): BOOLEAN;
|
|
PROCEDURE BoolCheck (t: TypeIndex): BOOLEAN;
|
|
|
(* BOOLEAN required: NOT/AND/OR operands (212), conditions (214). *)
|
|
(* BOOLEAN required: NOT/AND/OR operands (212), conditions (214). *)
|
|
@@ -616,9 +589,6 @@ PROCEDURE InCheck (l, set: TypeIndex): BOOLEAN;
|
|
|
(* Membership `l IN set`. *)
|
|
(* Membership `l IN set`. *)
|
|
|
PROCEDURE SetElemClassOk (c: INTEGER): BOOLEAN;
|
|
PROCEDURE SetElemClassOk (c: INTEGER): BOOLEAN;
|
|
|
(* TRUE for an element class acceptable in a set constructor. *)
|
|
(* TRUE for an element class acceptable in a set constructor. *)
|
|
|
-PROCEDURE SetElemCheck (first, elem: TypeIndex): BOOLEAN;
|
|
|
|
|
-PROCEDURE SetFor (elem: TypeIndex): TypeIndex;
|
|
|
|
|
-(* Fresh SET OF elem descriptor for set literals. *)
|
|
|
|
|
|
|
|
|
|
PROCEDURE StrLen (s: ARRAY OF CHAR): CARDINAL;
|
|
PROCEDURE StrLen (s: ARRAY OF CHAR): CARDINAL;
|
|
|
|
|
|