procedure execute(prog:tree); #include "lazy.type.P" var evals, envcells, conscells :integer; { statistics } LastId :alfa; { debugging} procedure error( m:alfa ); begin writeln; writeln('Error: ', m, ' LastId=', LastId); goto 99 {error abort} end; #include "lazy.mkval.P" { Make various Values } function eval( x:tree; rho:Env ):Value; forward; #include "strict.env.P" { manipulate Environment } #include "strict.D.P" { Execute Declarations } #include "strict.apply.P" { Apply a Function } #include "strict.U.P" { Execute Unary Operators } #include "lazy.O.P" { Execute Binary Operators } #include "strict.eval.P" { eval an Expression } #include "strict.show.P" { Output Values } begin{execute} evals := 0; envcells := 0; conscells := 0; {zero counters} LastId := '-start- '; ShowValue(eval(prog, {Env=}nil)); { Execution } writeln; write( evals, ' evals'); write( envcells, ' env cells used, '); writeln( conscells, ' cells used') end{execute}; {\fB Shell of Interpreter for Strict Functional Language. \fP} {Do not remove: Lazy.p, Strict.p, lazy.*.P, strict.*.P, lex.*.P, & syntax.*.P } { are released under Gnu `copyleft' General Public Licence (GPL) } { - L. Allison, CSSE, Monash Uni., .au, 7/2003. }