CompilerShared.def 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. DEFINITION MODULE CompilerShared ;
  2. (* State shared by the Compiler modules: the image buffer, program counter,
  3. patch list, source/error state, and the error reporter. Keeping this in a
  4. small definition module is the first step of splitting the old monolithic
  5. Compiler.mod; identifiers are imported unqualified so the parser and code
  6. generator read exactly as before. *)
  7. FROM SYSTEM IMPORT BYTE ;
  8. CONST
  9. MaxCode = 0A000H ;
  10. CodeMax = 0A000H ;
  11. MaxPatch = 2000 ;
  12. EMemOvf = 98 ;
  13. ECompOvf = 99 ;
  14. EFileNF = 90 ;
  15. EInclNest = 96 ;
  16. TYPE
  17. PatchRec =
  18. RECORD
  19. place : CARDINAL ;
  20. target : CARDINAL ;
  21. filled : BOOLEAN ;
  22. END ;
  23. VAR
  24. cbuf : ARRAY [0..MaxCode - 1] OF BYTE ;
  25. pc : CARDINAL ;
  26. imgReady : BOOLEAN ;
  27. patches : ARRAY [0..MaxPatch - 1] OF PatchRec ;
  28. nPatch : CARDINAL ;
  29. srcPos : CARDINAL ;
  30. abortFac : BOOLEAN ;
  31. errNum : CARDINAL ;
  32. txerrPos : CARDINAL ;
  33. PROCEDURE Err (n : CARDINAL) ;
  34. PROCEDURE OK () : BOOLEAN ;
  35. END CompilerShared.