Check.def 935 B

123456789101112131415161718192021222324252627282930
  1. DEFINITION MODULE Check;
  2. (* Resolve / check pass (two-phase, part 2). A walk over a parsed unit's
  3. AST that binds identifiers to symbols, resolves and completes types,
  4. and emits the 2xx diagnostics -- run by the driver between Parse and
  5. Lower. See docs/plan-resolve-check.md. *)
  6. IMPORT AST;
  7. PROCEDURE BeginSession (progName: ARRAY OF CHAR);
  8. (* Per-session setup (alongside Lower.BeginSession). *)
  9. PROCEDURE BeginUnit;
  10. (* Per-unit setup (called before Parse). *)
  11. PROCEDURE NoteForward (id: INTEGER);
  12. (* Records a forward module-level reference noted by the parser (Design);
  13. FlushForward resolves it once the unit's declarations are complete. *)
  14. PROCEDURE FlushForward;
  15. (* Resolve every noted forward reference against the unit's declarations;
  16. an unresolved name is 201. *)
  17. PROCEDURE Resolve (unit: AST.Node);
  18. (* Resolve and check the parsed unit. *)
  19. PROCEDURE EndSession;
  20. (* Per-session teardown. *)
  21. END Check.