Rutgers ALGOL 68: Difference between revisions
lang -> syntaxhighlight
(lang -> syntaxhighlight) |
|||
Line 19:
=== Lexical style ===
Rutgers ALGOL 68 is case-sensitive and uses quote-stropping. The standard bold-words are in lower case, e.g.:
<
print( ( "Hello, World!", newline ) )
'end'</
=== Transput ===
Line 41:
Place the following batch file into the the folder and execute it. The batch file asumes TCC is being used as the C compiler, change as appropriate. The DEFINES and ALINC variables may also need to be changed.
<
rem set CC and DEFINES as appropriate for your C compiler
Line 72:
cd ..
cd ..</
Note that the interpreter requires <sys/times.h>, the TCC compiler used in the batch file above did not have one, the following dummy times.h can be used. If needed it should be placed in a sub-folder of the installation folder, called '''sys'''.
<
#include <time.h>
#define times(x) (unsigned) time(x)
// end RutgersAlgol68 times.h</
The following batch file can be used to execute the interpreter with an upper-stropping source (as used by most of the samples on RC):
<
@
@set p=%1
Line 132:
@ %rBin%\dump.exe _.d68
@ exit /b 7
@:endR68</
The '''prelude.r68''', '''postlude.r68''' and '''upperToQuote.r68''' soureces used by the above batch-file should be placed in the installation folder (\algolRutgersAlgol8 is assumed here). They are in the following sections on Using upper-stropping and Additional prelude items.
Line 142:
This should be placed in the installation folder (\algol\RutgersAlgol68 is assumed here) and called '''upperToQuote.r68'''.
<
'proc' control = ( 'char' letter )'char': 'repr' ( 1 + ( 'abs' letter - 'abs' "A" ) );
'char' ctrlE = control( "E" );
Line 338:
'fi'
'od'
'end'</
Note that Rutgers Algol 68 does not implement transput event routines, so cannot detect EOF. The above program assumes EOF will be indicated by control-E followed by control-O followed by control-F.
Line 348:
The following source should be placed in the instalation folder (\algol\RutgersAlgol68 is assumed here) and named '''prelude.r68''':
<
'int' max abs char = 255;
'mode' 'complex' = 'compl';
Line 391:
found
'end'; # char in string #
'begin'</
The following source should be placed in the installaton folder (\algol\RutgersAlgol68 is assumed here) and named '''postlude.r68'''.
Line 397:
'''Note''' that ^E^O^F should be replaced with the seuence of characters control-E, control-O and control-F.
<
'end'
^E^O^F</
|