!IMP driver %EXTERNALROUTINESPEC concf(%STRING (255) s) %ROUTINE cross reference printstring("Cross reference not available") newline %END {cross reference} %OWNINTEGER cross=0 %OWNSTRING (25) pass1= "ercm09:pass1y", pass2 = "ercm09:ass11y", pass3 = "ercm09:Gen11Y", prim file = "ERCm09:PRIMS" %EXTERNALROUTINE nIMP11 %alias "C#NIMP11" %EXTERNALROUTINESPEC EMAS3STRING(%STRINGNAME vector, value) %EXTERNALINTEGERFUNCTIONSPEC exist %ALIAS "S#EXIST"(%STRING (255) file) %ROUTINE destroy(%STRING (255) s) %EXTERNALROUTINESPEC emas3(%STRINGNAME command,params, %INTEGERNAME flag) %INTEGER flag emas3("DESTROY",s,flag) %END; ! Of %ROUTINE destroy. %EXTERNALSTRINGFUNCTIONSPEC date %ALIAS "S#DATE" %EXTERNALSTRINGFUNCTIONSPEC time %ALIAS "S#TIME" %ROUTINE run(%STRING (255) s) %EXTERNALROUTINESPEC emas3(%STRINGNAME command,params, %INTEGERNAME flag) %INTEGER flag emas3("RUN",s,flag) %END; ! Of %ROUTINE run. %ROUTINE define(%STRING (255) s) %EXTERNALROUTINESPEC emas3(%STRINGNAME command,params, %INTEGERNAME flag) %INTEGER flag emas3("DEFINE",s,flag) %END; ! Of %ROUTINE define. %EXTERNALINTEGER IMPFLAG= 0 %INTEGER Statements %STRING (63) source,object,listing %ROUTINE Delete(%STRING (63) File) Destroy(File) %IF Exist(File)#0 %END emas3string("Source;file,char,exist;?", source) emas3string("Primfile;file,ornull;;", Prim File) emas3string("Listing;file,char,ornull;;", Listing) %if Prim File="" %then Prim File=".NULL" %if Listing="" %then Listing=".NULL" Define("1,".source); Define("2,".Prim File) Define("3,T#1"); Define("4,".listing) select output(4) printstring("Source file: "); printstring(source) printstring(" compiled on ") printstring(date); printstring(" at "); printstring(time) newlines(2) run(pass1) select input(0); select output(0) printstring("Pass 1 completed"); newline close stream(1); close stream(2); close stream(3) Statements = IMPFLAG ->BANG %IF Statements<=0 %IF cross=1 %START selectinput(3); selectoutput(4) newpage newlines(2) cross reference selectinput(0); selectoutput(0) closestream(3) %FINISH closestream(4) Define("1,T#1") Define("2,T#2"); Define("3,T#3") IMPFLAG = 0 run(pass2) Select input(0); select output(0) printstring("Pass 2 completed"); newline Close stream(1); close stream(2); close stream(3) %IF IMPFLAG#0 %START Fail: Printstring("Compilation failed"); Newline ->Done %FINISH Define("1,T#2"); Define("2,T#3"); Define("3,".object) IMPFLAG = 0 run(pass3) select input(0); select output(0) printstring("Pass 3 completed"); newline Close stream(1); Close Stream(2); Close Stream(3) ->Fail %IF IMPFLAG#0 Bang: %IF Statements<=0 %START Printstring("Program contains") write(~Statements,1) Printstring(" fault"); printsymbol('s') %IF Statements#-2 %FINISHELSESTART concf(object.",t#1/".object) Write(Statements,4) printstring(" statements compiled") %FINISH newline Done: { Delete("T#1"); Delete("T#2"); Delete("T#3")} %END %EXTERNALROUTINE DIMP11 %alias "C#DIMP11" prim file = "ERCm09:DPRIMS" nIMP11 %END %EXTERNALROUTINE XIMP11 %alias "C#XIMP11" cross = 1 nIMP11 %END %EXTERNALROUTINE XDIMP11 %alias "C#XDIMP11" Prim file = "ERCm09:DPRIMS" cross = 1 nIMP11 %END %EXTERNALROUTINE TIMP11 %alias "C#TIMP11" prim file = "ERCm09:DPRIMS" pass3 = "ercm09:gen11newy" nimp11 %END %ENDOFFILE