-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadgen.plm
54 lines (44 loc) · 1.25 KB
/
readgen.plm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/****h* plm/readgen
*
* NAME
* readgen -- read PL/M code and generate output code
*
* DESCRIPTION
* The purpose of this module is to read PL/M files and to generate code,
* which is typically assembly, but can also be binary or source code of
* another programming language. The code generated is the translation of
* PL/M code into the output language.
* The output language is controlled using compilation parameters (not
* implemented yet).
*
******
*/
readgen:
do;
$include (..\plmlib\plmlib.inc)
$include (tokpars.inc)
reader$set$ptr: procedure (ptr) external;
declare ptr pointer;
end reader$set$ptr;
tok$next: procedure external;
end tok$next;
get$token: procedure byte external;
end get$token;
print$token: procedure external;
end print$token;
declare tail$len literally '128';
declare tail (tail$len) byte;
call get_command_tail(@tail, tail$len);
call print_string(@('String entered {', 0));
call print_string(@tail);
call print_line(@('}', 0));
call print_line(@('==============', 0));
call reader$set$ptr(@tail);
do while get$token <> tok$eof;
call print$token;
call new_line;
call tok$next;
end;
call terminate(0);
end;