OVERVIEW OF CLEO Programming Language Version: 1.00 (Dec 1992) Author : DIALLO Barrou Introduction This work consists in a Pascal-like experimental programming language including some 3d and 2d mathematical stuffes to generate 3D scenes for a soon coming ray-tracer. This version includes loop-instructions, standard I/O controls, expressions tests, floating point numbers, special 3d/2d types. Package Contents: cleo:/ Author (Author's name & Adress , Copyright advertissement) makefile (Compiling rules to Amiga users) /bin cleo (Executable-code Encoder) inter (Interpreter program) /etc Cleo_exe_cfg (Interpreter Configuration file) Cleo_int_cfg (Encoder Configuration file) /cleobin (Cleo's executable-code files) cleo.out (Default Cleo's executable-code) /include (Encoder's include source files) /source (Encoder's code source files) /obj (Object.o files) /examples (Some demo samples) /inter makefile (Compiling rules to Amiga users) /include (Interpreter's include source files) /source (Interpreter's code source files) How can I recompile the Encoder and the interpreter? On Amiga machines: ( Release 1.3 , 2.0 or 3.0) 1. Assign the cleo: directory Assign cleo: my_dir 2. add a path to the interpreter and compiler: path cleo:bin add Ensure that you've got the Aztec C v5.01 compiler and the make command on your disk and type this. 3. Edit these files : CLEO:makefile and CLEO:inter/makefile to change the path behind PROJET = 4. Under your Shell type please: cd cleo: make cd inter make cd / And then if no errors occurs, you've got two executable files in the bin directory. How can I compile and run a cleo program? The easiest way to show how cleo works, is to compile a sample in the Examples directory: (type what's following) 1> cleo examples/hello.cl This will compile the hello.pas sample which stay the Examples directory. The default output file (etc/cleobis.out) is used to put the produced cleo-code. 1> inter (This will execute the default cleo-code) Types: Types lenght depends to the machine on which Cleo was compiled. 1. LONGREAL ( = double in C language) 2. REAL ( = float in C language) 3. LONGINT ( = long int in C language) 4. INTEGER ( = int in C language) 5. CHAR ( = char in C language) 6. STRING ex: str : STRING; str2 : STRING; str := 'Hello World!' ; str2 : =str; writeln(str2); 7. BOOLEAN ( = 1 unsigned byte ) 8. POINT2D ( = 2 floats in C language) ex: pnt : POINT3D; pnt.x := 111; pnt.y := 222; writeln( ' coords(x y) =' , pnt.x, ' ', pnt.y ); 9. POINT3D ( = 3 floats in C language) ex: pnt1, pnt2 : POINT3D; pnt1.x := 111; pnt1.y := 222; pnt1.z := 333; pnt2 := pnt1; writeln(' y= ', pnt2.y); 10. RGB ( = 3 unsigned char in C language) ex: col : RGB; col.r := 111; col.g := 222; col.b := 333; writeln(' red = ', col.r); 11. ARRAY ... OF CHAR, OF INTEGER, OF REAL, OF BOOLEAN, OF POINT3D, OF POINT2D, OF RGB. Mathematical operators: +, -, /, * . % , mod : modulo Logical operators: And, Or, Xor. Operators priority: (High priority) * / AND MOD DIV + - OR < <= => > <> Mathematical functions: abs , atan, acos, asin, cosh, sinh, cos, sin, exp, ln, sqr, sqrt, inv, rnd, tan, tanh, Extra functions: odd(x) : return 1 if x is an odd value else return 0 even(x) : return 1 if x is an even value else return 0 pred(x) : return the predececor of x succ(x) : return the successor of x int(x) : return the integer part of x frac(x) : return the floating part of x Break Instructions: 1. WHILE expression DO instruction; 2. REPEAT instruction UNTIL expression; Tests Instructions: 1. IF expression THEN instruction; I/O Functions: 1. Output functions: 1.1. WRITE ( EXPRESSION | CONSTANTS ...); 1.2. WRITELN < (EXPRESSION | CONSTANTS) ...> | <;> Write and Writeln are the same functions. Writeln just prints out a carriage return at the end of line. A Writeln function alone (without arguments) stands for a carriage return. 2. Input functions: 2.1. READ ( variable, variable, ...); 2.2. READLN ( variable, variable, ...); Porting Conventions: This language was developped with Aztec C 5.01 on Commodore Amiga and entirely written in C language. It can be compiled on UNIX* Workstations or on IBM PC/XT/AT by #defining during compilation 'unix' or 'msdos'. Known bugs: 1. Types conversions are not yet implemented, no errors or warning will occurs when you attempt to assign a real to an integer variable! 2. Array under-overflow aren't ckecked. 3. Arrays fisrt index must be 1. Author: Please help me to improve new versions of Cleo, send please bug reports, or suggestions to : DIALLO Barrou 23, rue des enfants de choeur 51210 MONTMIRAIL FRANCE *UNIX is a trademark of AT&T Bell Laboratories.