home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
- The GRS programming language
- and environment.
-
- Archimedes Version Manual.
-
- Steven Inkster.
- Guy Verbist.
-
- Department Of Computer Science.
- Heriot Watt University.
-
- Archimedes Public Domain Release 1.05
- September 1991
-
-
-
-
- Contents
-
-
-
- 0.0 Introduction. 1
- 0.1 Installation and Directory
- Organisation. 1
- 0.2 Editing files. 2
- 0.3 Running GRS 2
- 0.31 Environment 2
- 0.32 Loading files 2
-
- 1.0 Running real programs. 3
- 1.1 The examples. 3
- 1.2 Your own programs. 4
-
-
-
-
-
-
-
- 0.0 Introduction.
-
- This manual is intended as a guide to getting GRS started on the Acorn
- Archimedes series of machines. Some general information about running GRS
- is given in the Language Reference Manual, but this guide is specifically
- for the Archimedes.
-
- 0.1 Installation and Directory Organisation.
-
- GRS requires two main files
-
- * the compiler / interpreter called "grs"
- * the bootstrapped definitions of some GRS classes called "g.bootclass"
-
- GRS also requires the following system resources
-
- * shared C library 3.50 or later
- * floating point emulator 2.80 or later
-
- These should be found on the "Risos extras" disc, with Acorn Ansi C release
- 3, or with many commercial applications which use them. Since they are not
- in the public domain they cannot accompany this distribution.
-
- The following directory structure is suggested:
-
- <graphic - "directory">
-
- A directory called "GRS", containing the compiler, an obey file to load
- system resources and to set the current directory to "GRS", and a directory
- which contains "g.bootclass" and any other grs programs.
-
- 0.2 Editing files.
-
- Obviously there will be a need to edit GRS programs. The !Edit application
- is recommended, but any other editor which can export text files will do.
-
- 0.3 Running GRS
-
- 0.31 Environment
-
- GRS can be run in any command line environment which can provide sufficient
- memory. Pressing f12 from the desktop will place the user in the CLI
- environment which is the optimum environment from which to run GRS. Before
- going to the CLI, the 'Next' slot should be set to as great a value as
- possible
-
- GRS can also be run from an !Edit task window, however using the cls() or
- tab() functions will not work from a task window because these two functions
- use screen control codes. Before creating the task window it is recommended
- that the user sets the 'Next' slot on the task manager as above.
-
- In either of the above cases the 'Next' slot should be set to at least 640k.
-
- Using GRS within the Twin editor is not recommended, since GRS requires a
- great deal of contiguous memory,
-
- On start up, GRS must be able to locate the "g.bootclass" file, which will
- be possible when using the directory structure detailed above and the !Start
- file supplied.
-
- 0.32 Loading files
-
- A file can be loaded into GRS in one of two ways
-
- * at start up, by typing GRS <filename>
-
- * by using the consult() function
-
- If the file is loaded at start up, then the GRS compiler / interpreter will
- be loaded, and then the named file will be loaded and run.
-
- To use the consult() function, type
-
- consult(<filename>);<ctrl-d>
-
- at the GRS command line. The named file will be loaded and run.
-
-
- 1.0 Running real programs.
-
- 1.1 The examples.
-
- Several example programs are given in the supplied "g" directory. Try
- running these and observing their effects, in conjunction with the Language
- Reference Manual:
-
- Files: Book1, Book2, Book3, Books.
-
- An example showing objects, objects as slots, objects as parameters. Run with
-
- grs g.books
-
- or
-
- grs <cr> consult("g.books");<ctrld>
-
-
- File: BootClass
-
- Essential resource which must be present as g.bootclass. Editing this file
- is not recommended.
-
- File: calc
-
- Resident calculator, run as 'books' example, then do your calculating e.g.
-
- 3+4 <cr>
-
- or len("fred") <cr>
-
- or ["hello"] + ["world"] <cr>
-
- Leave with quit <cr>
-
- Call up again with calc(); <ctrld>
-
- File: DataBase
-
- A rather extreme use of the callable compiler, valid types for the database
- are valid GRS types, eg integer, string, listof integer etc.
-
- File: firework
-
- Silly fireworks demo, firework movements are (null) expression's
-
- File: frontend
-
- A simple frontend, using the callable compiler.
-
- File: lists
-
- A lists example.
-
- Files: m1, m2, m3, maketank
-
- A tank game, run with consult("g.maketank"); <ctrld>
- The tank tactics are (null) expression's chosen at random.
-
- Files: makep, p1, p2, p3
-
- Demo of inheritance, deletion, and how to cause a run time error (!)
-
- File: mid
-
- A demonstration of string handling.
-
- File: Speedtest
-
- A silly speed test, which shows how slow the interpreter is.
-
- Files: person, student
-
- Two demonstration classes, 'student' has a slot which is a (not isa) 'person'
-
-
- 1.2 Your own programs.
-
- Once you are satisfied that you understand the concepts behind GRS, you will
- be ready to write your own programs. There are two main provisos with this
- implementation
-
- * the file "g.bootclass" must always be available to the compiler.
- * if the callable compiler (compile()) is used, then GRS must be able to write
- to the current drive, and there must be a directory $.tmp on that drive.
-
- It is possible to edit "g.bootclass" to alter the behaviour of the compiler
- and the interpreter, but it is not recommended.
-