Readme.txt 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. This directory and its subdirectories contain the sources of Coco/R itself,
  2. and also source code for various implementations of the compiler-specific
  3. module FileIO used by Coco/R itself for I/O, and also, in many cases, by
  4. the applications it produces.
  5. Coco/R can be recompiled and bootstrapped from these sources - but PLEASE
  6. BE CAREFUL!
  7. Recompiling Coco/R
  8. ==================
  9. To do so you are advised to create a working directory, copy all of the
  10. files from this directory to it, and then copy all the files from the
  11. subdirectory specific to your compiler. For example, assuming you have the
  12. XDS compiler (used here for illustration only):
  13. MD C:\WORK
  14. CD C:\WORK
  15. COPY C:\COCO\SOURCES\*.*
  16. COPY C:\COCO\SOURCES\XDSISO\*.*
  17. SET CRFRAMES=C:\COCO\FRAMES
  18. (The "traditional" FileIO-based frame files must be used).
  19. followed by
  20. XC =m CR
  21. which will produce a new executable CR.EXE that you might rename to
  22. COCOR.EXE when you are satisfied.
  23. Note that some compilers will require you to choose between various memory
  24. models, and may provide various optimization options that we cannot discuss
  25. here. For example, the StonyBrook 16 bit DOS compiler require you to use a
  26. large data model.
  27. Some compilers _require_ FORWARD declarations to be generated before they
  28. will accept the code generated by Coco/R, others require that no such
  29. directives be present. The $M pragma (or -m command line option) will
  30. suppress the generation of the FORWARD declarations (or, more honestly,
  31. will comment them out). The XDS and JPI compilers require that they be
  32. present.
  33. Coco/R itself makes use of 32-bit integers. This should be handled
  34. automagically by the appropriate definition of the INT32 type in
  35. FileIO.DEF.
  36. Modifying and bootstrapping Coco/R
  37. ==================================
  38. Executing
  39. COCOR CR.ATG
  40. will cause Coco to regenerate the parser (CRP), scanner (CRS) and main module
  41. (CR) from the attribute grammar CR.ATG.
  42. Thus, if you wish, you can modify CR.ATG and/or CR.FRM and subtly modify
  43. the behaviour od Coco/R, or he form of the grammars that it will accept.
  44. For example, you might want to add to the possible command line
  45. options/pragmas, or modify Coco/R so that it suppresses the generation of
  46. FORWARD declarations in the parser, or produce error messages in a
  47. different format.
  48. It is recommended that if you want to experiment with this, that you work
  49. in a very different directory from the one in which you have filed the
  50. original sources, lest you erase valuable original files.
  51. Table size limitations
  52. ======================
  53. The symbol tables used internally by Coco/R make use of fixed length arrays
  54. - always a rather dangerous thing to do. The dimensions of these arrays
  55. have been chosen to ensure that the data segments for the modules will
  56. remain within the limits imposed by MS-DOS system compilers that typically
  57. impose a 64K limit on structures. The limits can be extended for compilers
  58. that allow this (such as 32 bit compilers) by editing CRT.DEF and CRT.MOD
  59. appropriately, and recompiling Coco/R. This may have to be done if a user
  60. wishes to handle large grammars with many productions, for example.
  61. Alternative versions of Coco/R
  62. ==============================
  63. CRQ.FRM and CR.FRM are alternative compiler frame files. They produce the
  64. main driver routines CR.MOD and CRQ.MOD. The first of these is the
  65. "classic" Coco/R driver program; CRQ is an alternative that produces error
  66. messages in a format that can be used to interface easily to various
  67. editors that provide for constructing IDE environments. By simply renaming
  68. CRQ.FRM as CR.FRM and recompiling Coco/R you can easily generate this
  69. "editor oriented" version.
  70. =END=