home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / grs / Text_Man / arc_man next >
Encoding:
Text File  |  1993-02-27  |  5.4 KB  |  220 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. The GRS programming language
  15. and environment.
  16.  
  17. Archimedes Version Manual.
  18.  
  19. Steven Inkster.
  20. Guy Verbist.
  21.  
  22. Department Of Computer Science.
  23. Heriot Watt University.
  24.  
  25. Archimedes Public Domain Release 1.05
  26. September 1991
  27.  
  28.  
  29.  
  30.  
  31. Contents
  32.  
  33.  
  34.  
  35. 0.0  Introduction.                      1
  36. 0.1  Installation and Directory 
  37.         Organisation.                   1
  38. 0.2  Editing files.                     2
  39. 0.3  Running GRS                        2
  40. 0.31  Environment                       2
  41. 0.32  Loading files                     2
  42.  
  43. 1.0  Running real programs.             3
  44. 1.1  The examples.                      3
  45. 1.2  Your own programs.                 4
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. 0.0  Introduction.
  54.  
  55. This manual is intended as a guide to getting GRS started on the Acorn
  56. Archimedes series of machines.  Some general information about running GRS
  57. is given in the Language Reference Manual, but this guide is specifically
  58. for the Archimedes.
  59.  
  60. 0.1  Installation and Directory Organisation.
  61.  
  62. GRS requires two main files
  63.  
  64.         * the compiler / interpreter called "grs"
  65.         * the bootstrapped definitions of some GRS classes called "g.bootclass"
  66.  
  67. GRS also requires the following system resources
  68.  
  69.         * shared C library 3.50 or later
  70.         * floating point emulator 2.80 or later
  71.  
  72. These should be found on the "Risos extras" disc, with Acorn Ansi C release
  73. 3, or with many commercial applications which use them.  Since they are not
  74. in the public domain they cannot accompany this distribution.
  75.  
  76. The following directory structure is suggested:
  77.  
  78. <graphic - "directory">
  79.  
  80. A directory called "GRS", containing the compiler, an obey file to load
  81. system resources and to set the current directory to "GRS", and a directory
  82. which contains "g.bootclass" and any other grs programs.
  83.  
  84. 0.2  Editing files.
  85.  
  86. Obviously there will be a need to edit GRS programs.  The !Edit application
  87. is recommended, but any other editor which can export text files will do.
  88.  
  89. 0.3  Running GRS
  90.  
  91. 0.31  Environment
  92.  
  93. GRS can be run in any command line environment which can provide sufficient
  94. memory.  Pressing f12 from the desktop will place the user in the CLI
  95. environment which is the optimum environment from which to run GRS.  Before
  96. going to the CLI, the 'Next' slot should be set to as great a value as
  97. possible
  98.  
  99. GRS can also be run from an !Edit task window, however using the cls() or
  100. tab() functions will not work from a task window because these two functions
  101. use screen control codes.  Before creating the task window it is recommended
  102. that the user sets the 'Next' slot on the task manager as above.
  103.  
  104. In either of the above cases the 'Next' slot should be set to at least 640k.
  105.  
  106. Using GRS within the Twin editor is not recommended, since GRS requires a
  107. great deal of contiguous memory,
  108.  
  109. On start up, GRS must be able to locate the "g.bootclass" file, which will
  110. be possible when using the directory structure detailed above and the !Start
  111. file supplied.
  112.  
  113. 0.32  Loading files
  114.  
  115. A file can be loaded into GRS in one of two ways
  116.  
  117.         * at start up, by typing GRS <filename>
  118.  
  119.         * by using the consult() function
  120.  
  121. If the file is loaded at start up, then the GRS compiler / interpreter will
  122. be loaded, and then the named file will be loaded and run.
  123.  
  124. To use the consult() function, type
  125.  
  126.         consult(<filename>);<ctrl-d>
  127.  
  128. at the GRS command line.  The named file will be loaded and run.
  129.  
  130.  
  131. 1.0  Running real programs.
  132.  
  133. 1.1  The examples.
  134.  
  135. Several example programs are given in the supplied "g" directory.  Try
  136. running these and observing their effects, in conjunction with the Language
  137. Reference Manual:
  138.  
  139. Files: Book1, Book2, Book3, Books.
  140.  
  141. An example showing objects, objects as slots, objects as parameters. Run with
  142.  
  143.                 grs g.books
  144.  
  145. or
  146.  
  147.                 grs <cr> consult("g.books");<ctrld>
  148.  
  149.  
  150. File: BootClass
  151.  
  152. Essential resource which must be present as g.bootclass.  Editing this file
  153. is not recommended.
  154.  
  155. File: calc
  156.  
  157. Resident calculator, run as 'books' example, then do your calculating e.g. 
  158.  
  159.                 3+4 <cr>
  160.  
  161. or              len("fred") <cr>
  162.  
  163. or              ["hello"] + ["world"] <cr>
  164.  
  165. Leave with              quit <cr>
  166.  
  167. Call up again with      calc(); <ctrld>
  168.  
  169. File: DataBase
  170.  
  171. A rather extreme use of the callable compiler, valid types for the database
  172. are valid GRS types, eg integer, string, listof integer etc.
  173.  
  174. File: firework
  175.  
  176. Silly fireworks demo, firework movements are (null) expression's
  177.  
  178. File: frontend
  179.  
  180. A simple frontend, using the callable compiler.
  181.  
  182. File: lists
  183.  
  184. A lists example.
  185.  
  186. Files: m1, m2, m3, maketank
  187.  
  188. A tank game, run with consult("g.maketank"); <ctrld>
  189. The tank tactics are (null) expression's chosen at random.
  190.  
  191. Files: makep, p1, p2, p3
  192.  
  193. Demo of inheritance, deletion, and how to cause a run time error (!)
  194.  
  195. File: mid
  196.  
  197. A demonstration of string handling.
  198.  
  199. File: Speedtest
  200.  
  201. A silly speed test, which shows how slow the interpreter is.
  202.  
  203. Files: person, student
  204.  
  205. Two demonstration classes, 'student' has a slot which is a (not isa) 'person'
  206.  
  207.  
  208. 1.2  Your own programs.
  209.  
  210. Once you are satisfied that you understand the concepts behind GRS, you will
  211. be ready to write your own programs.  There are two main provisos with this
  212. implementation
  213.  
  214.         * the file "g.bootclass" must always be available to the compiler.
  215.         * if the callable compiler (compile()) is used, then GRS must be able to write
  216.            to the current drive, and there must be a directory $.tmp on that drive.
  217.  
  218. It is possible to edit "g.bootclass" to alter the behaviour of the compiler
  219. and the interpreter, but it is not recommended.
  220.