13.07.2015 Views

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

18Pascal Implementation: Compiler and Asscall.1,4InterprcterCompiler Listing 1995395495595695795895996096196296396496596696796896997097191297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016if (fspl nil) and (1.p2 0 nil) than ,if fepl".form fsp2".form thencase fepl".form ofscalertcomptypes im false;(A identical scalars declared on different levels eranot recognized to be compatible)subrangotcomptypes 1m comptypes(fspr.rengetype.lsp2".rangotype),pointertbegincomp im false; ltestpl globteetp;lteetp2 1- globteetp;while ltestpl nil dowith ltestpl" dobeginif (elt1 m fepl".eitype) and(e1t2 - fep2".eltype) then comp rm true;lteetpl tm lastteetpend;if not comp thenbegin now(Itestpl);with lteetpl" dobegin olt1 im fepl".eltypelelt2 1m fspr.eityps:lastteetp tm globteetpend;globteetp 1• ltestpl;comp tm comptypes(fspl".eltype,fsp2".eltype)end;comptypes tm comp; globtestp tm lteetp2end;power:comptypee tm comptypes(fspl".elset,fsp2".eleet);arrays,begincomp tm comptypee(fspl".aoltype,fep2".aeltypo)and comptypes(repl".inxtype,fsp2".inxtype);comptypes tm comp and (fspl".siee • fsp2".site) andequalboundo(fspl".inxtypo,fep2".inxtype)end:records,begin nxtl I. fepl".fstfldy nxt2 t• fsp2".fetfld; comp:mtruelwhile (nxtl nil) and (nxt2 nil) dobegin comptmcomp and comptypes(nxtr.idtype,nxt2".idtype),<strong>net</strong>' nxtr.next; nxt2 tm nxt2".nextend;comptypes 1- comp and (nxtl - nil) end (nxt2 - nil)and(fapl".recvar • ni1)and(fep2".recvar m nil)end;("identical records are recognized to be , compatibleiff no variants occur")comptypes tm comptypes(fsprailtype,fsp2".filtype)end (AcatleA)else (*fspl".form fsp2".form 4 )it fepl".form subrenge thencomptypoe im comptypes(fspl".rangetype,f.p2)elseif fep2".form m subrenge thencomptypes tm comptypes((sp1,fsp2".rangetype)also comptypes falseelse comptypos tm trueend ("comptypes")1017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104U10491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210131074107310761077107810791080function string(rept stp) t boolean;begin string i ■ felee;if fop nil thenif fep".form m array. thenif comptypes(fsp".seitype,cherptr) then stringend ("string")trueprocedure typ(fayst setoteyel var fepr etp; var (sire' addrrange);var Iap,lapl,lap21 stp; oldtopi disprengol lcp: ctp;Isite,displi addrrange; Imin,lmaxt Integer;procedure simpletype(feysteetofeys; var fep:stp; var (eiteraddrrange),var lep s lepli etp; icp,Icplt ctp; ttopt diaprenge;lcrat integer; lvalut volu;begin flare 1- 11if not (sy in simptypebegeye) thenbegin error(1); skip(fsys + simptypebegeye) end;if ay in simptypobegeye thenbeginif ay - iperent thanbegin ttop 1m top; (Adecl. conste local to innermost block")while dieplayitophoccur blck do top 1m top - 1;new(lep,scaler,declared);with lap" dobegin size 1- intmize; form im scaler;ecalkind :- declaredend;lcpl t. n11; lent a - 01repoat insymbol;if ay .• ident thenbegin new(lcp,ko<strong>net</strong>);with lcp' dobegin name id; idtype a.. lap; next 1.. Icpl,veluea.ival :- lent; klaaa konatend;enterld(lcp);lent lcnt + 1;lcpl t• lcp; insymbolendelse error(2);if not (sy in (eye + (comme,rperent)) thenbegin orror(6); skip(fays + Icommaprperent)) enduntil sy comma;lep"aconot im lcpl; top :- ttop;if sy - rparent then insymbol else error(4)endelsebeginif sy - ident thenbegin searchid(Itypee ; konat],lcp):ineymbol;if icp".klase konst thenbegin new(lep,eubronge);with ler, lcp" dobegin rangetype idtype; form :- subrange;if string(rangetype) thenbegin error(148); rangetype im nil end;min values; size 1 - intettoend;if sy • colon then insymbol elee error(S);constant(fiya,lap1,1valu);lep".max lvalu;If ler.rangetype 0 lap! then error(107)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!