|
|
DataMuseum.dkPresents historical artifacts from the history of: RC3500 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC3500 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 4608 (0x1200)
Types: TextFileVerbose
Names: »tpascvalue«
└─⟦2c55ea56f⟧ Bits:30001844 SW-save af projekt 1000, Alarm-system
└─⟦6b41451d2⟧
└─⟦this⟧ »tpascvalue«
job jaba 6 600 time 2 0 perm disc 20 3
; file tpascvalue mini
(pascvalue = set 1 disc
pascvalue = pascal
lookupprog pascvalue
if ok.no
finis
scope user pascvalue
platvalue = assign pascvalue
scope user platvalue
finis output.no )
program value_generator( input, output );
(* program to generate syntactically correct
value statement(s) for the pascal and pascal80
compilers from the bobs generated parse tables
call:
valfile = pascvalue/platvalue tablefile
*)
const
pow_12 = 4096;
name = 10;
equal = 6;
pasc_value = 'pascvalue';
quote = "'";
var
dummy, symbmax, prodmax, lrmax, lxmax, number_to_skip : integer;
prog_name, value_file, table_file : alfa;
last_capital, last_lower, ch1, cc : char;
a, b, c, d, e, step : integer;
begin
if system( 0, dummy, value_file ) mod pow_12 <> name then writeln(input);
if system( 1, dummy, prog_name ) <> equal * pow_12 +name then writeln(input);
if system( 2, dummy, table_file ) mod pow_12 <> name then writeln(input);
open( input, table_file); reset( input );
open( output, value_file); rewrite( output );
readln( input, number_to_skip );
if prog_name = pasc_value then
begin
last_capital := 'Z'; last_lower := 'z';
symbmax := 207;
prodmax := 289;
lrmax := 1129;
lxmax := 178;
end
else
begin (* pascal80 *)
last_capital := ']'; last_lower := '}';
readln( input, symbmax, prodmax,lrmax, lxmax );
number_to_skip := number_to_skip - 4;
end;
for step := 1 to number_to_skip do readln( input ); (* skip constants *)
readln ( input ); (* skip 'comment end' *)
(* now output the start of the value statement *)
writeln( output, nl, 'value ', nl );
writeln( output, 'digitch = (', nl,
"<' ' .. '/'> * false, <'0' .. '9'> * true, <':' .. '~'> * false ); " );
writeln( output, 'namech = (', nl,
"<' ' .. '/'> * false, <'0' .. '9'> * true, <':' .. '@'> * false, ", nl,
"<'A' ..'", last_capital, "'> * true, ");
if last_capital = 'Z' then write( output, "false, false, false, ");
write( output, "false, true (* _ *), false, " );
write( output, nl, "<'a' .. '", last_lower , "'> * true" );
if last_lower = 'z' then write( output, ", false, false, false" );
writeln( output, ", false ); " );
writeln( output, nl, nl, 'entry = (' );
step := 0;
for ch1 := firstch to lastch do
begin
step := step + 1;
if step mod 6 = 0 then writeln( output );
readln( input, cc (* leading space *) , cc, a, b, c );
if cc <> ch1 then writeln(' error, cc, ch1 =', cc, ch1 );
write( output, '( ', a:1, ', ', b:1, ', ', c:1, ', ' );
write( output, "'", cc, "'" );
if cc = quote then write( output, quote );
write( output, ')' );
if ch1 <> lastch then write( output, ', ' );
end;
writeln( output, ' ); ' );
writeln( output, nl, nl, 'lx = (' );
for step := 0 to lxmax do
begin
if step mod 6 = 0 then writeln( output );
readln( input, cc, cc, a, b, c );
write( output, '( ', a:1, ', ', b:1, ', ', c:1, ', ' );
write( output, "'", cc, "'" );
if cc = quote then write( output, quote );
write( output, ')' );
if step <> lxmax then write( output, ', ' );
end;
writeln( output, ' );' );
writeln( output, nl, nl, 'lr = (' );
for step := 0 to lrmax do
begin
if step mod 4 = 0 then writeln( output );
read( input, a, b, c, d );
if c <> 5 then
readln( input, e)
else
readln( input );
write( '(', a:1, ', ', b:1, ', ', c:1, ':( ', d:1 );
if c <> 5 then write( output, ', ', e:1 );
write( output, ' ))' );
if step <> lrmax then write( output, ', ' );
end;
writeln( output, '); ', nl, nl, '(* end of value part *) ' );
if prog_name <> pasc_value then
begin
(* add a value statement for initialization of 'prodtab' *)
writeln( output, 'prodtab = ( 0, ' );
for step := 1 to prodmax do
begin
readln( input, a, b );
if a <> step then writeln( output, ' error!! step =', step );
write( b : 4 );
if step <> prodmax then write( output, ', ' );
if step mod 10 = 0 then writeln( output );
end;
writeln( output, ' );' );
writeln( output, '(* end of value part *) ');
end; (* pascal80 prodtab ! *)
close( output );
end.
«eof»