17.05.2015 Views

Pascal News

Pascal News

Pascal News

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1905<br />

1906<br />

1907<br />

1908<br />

1909<br />

1910<br />

1911<br />

1912<br />

1913<br />

1914<br />

1915<br />

1916<br />

1917<br />

1918<br />

1920<br />

1921<br />

1922<br />

1923<br />

1924<br />

1925<br />

1926<br />

1927<br />

1928<br />

1929<br />

1930<br />

1931<br />

1932<br />

1933<br />

1934<br />

1935<br />

1936<br />

1937<br />

1938<br />

1939<br />

1941<br />

1942<br />

1943<br />

1944<br />

1946<br />

1947<br />

1948<br />

1949<br />

1950<br />

1951<br />

1952<br />

1953<br />

1954<br />

1955<br />

1956<br />

1957<br />

1958<br />

1959<br />

1960<br />

repeat lip: =newident( types,nil,nil,+(90);<br />

if lipnil then<br />

begin next1f( eqsy, +(91);<br />

lip· .idtype :=typ( fsys+[semicolon,identl);<br />

nextif(semicolon,+092); enterid( lip);<br />

end:<br />

until not find2([identl,fsys,+093);<br />

while fwptrnil do<br />

begin assert syident;<br />

id: =fwptr· .name; lip: =searchid ([ typesl);<br />

fwptr· • idtype· .eltype: =lip· .idtype; fwptr: =fwptr· .next<br />

end;<br />

lntypedec: :false:<br />

end;<br />

procedure var.declaration( f3ys :S08);<br />

var lip,hip,vip:ip; lsp:sp;<br />

begin with b do begin<br />

repeat hip:=nil; lip:=nil;<br />

repeat vip: =newident(vars ,nil ,nil ,+094 );<br />

if vipnil then<br />

begin enterid(vip); vip· .iflag:=[];<br />

if lip=nil then hip:=vip else lip· .next:=yip; lip:=vip;<br />

end;<br />

until endofloop( fsys+[colon1, ident •• packedsyl, [identl,comma,+095);<br />

{+096)<br />

nextif( colon1, +(97);<br />

lsp:=typ( fsys+[semicolon,identl);<br />

while hipnil do<br />

begin hip· .idtype :=lsp;<br />

hip· • vpos .ad: =address( lc ,sizeof( lsp) ,false); hip: =hip· .next<br />

end;<br />

next1f( semicolon ,+098);<br />

until not find2 ([ identl, fsys, +(99);<br />

end end;<br />

procedure pfhe ad ( fs ys : so s ;<br />

var fip:ip;<br />

var again :boolean;<br />

param:boolean); forward;<br />

function parlist(fsys:sos; var hlc:integer):ip;<br />

var lastip,hip,lip,pip:ip; lsp,tsp:sp; iflag:iflagset; again:boolean;<br />

sz:integer;<br />

begin parl1st:=nil; lastip:=nil;<br />

repeat {once for each formal-parameter-section)<br />

if find1 ([ ident, varsy ,procsy ,funcsyl,fsys+[semicolonl, +01 00) then<br />

begin<br />

if (sy=procsy) or (sy=funcsy) then<br />

begin<br />

pfhead (fsys+ [semicolon, ident, varsy .procsy, funcsyJ,<br />

hip,again, true);<br />

hip· .pfpos.ad: =address(hlc ,pnumsize+ptrsi ze ,false);<br />

hip· .pfkind:=formal; lip:=hip;<br />

top:=top· .nlink; level :=level-1<br />

end<br />

1961<br />

1962<br />

1963<br />

1964<br />

1965<br />

1966<br />

1967<br />

1968<br />

1969<br />

1970<br />

1971<br />

1972<br />

1973<br />

1974<br />

1975<br />

1976<br />

1977<br />

1978<br />

1979<br />

1980<br />

1981<br />

1982<br />

1983<br />

1984<br />

1985<br />

1986<br />

1987<br />

1988<br />

1989<br />

1990<br />

1991<br />

1992<br />

1993<br />

1994<br />

1995<br />

1996<br />

1998<br />

1999<br />

2000<br />

2001<br />

2002<br />

2003<br />

2004<br />

2005<br />

2006<br />

2007<br />

2008<br />

2009<br />

2010<br />

2011<br />

2012<br />

2013<br />

2014<br />

2015<br />

2016<br />

else<br />

begin hip:=nil; lip:=nil; iflag:=[assigned,noregl;<br />

if sy=varsy then<br />

begin iflag:=[refer,assigned,used,noregl; insym end;<br />

repeat pip:=newident( vars,nil,nil,+(101);<br />

if pipnil then<br />

begin enterid(pip); pip· .iflag:=iflag;<br />

if lip=nil then hip:=pip else lip· .next:=pip;<br />

lip:=pip;<br />

end;<br />

iflag: =iflag+[samesectl;<br />

until endofloop( fsys+[semicolon,colon 1l,<br />

[identl,comma,+(102); (+0103)<br />

nextif(colon1, +01 04);<br />

if refer in iflag then<br />

begin lsp:=vpartyp(fsys+[semicolonl);<br />

sz:=ptrsize; tsp:=lsp;<br />

while formof(tsp,[carrayl) do<br />

begin tsp· .arpos.ad :=address(hlc,ptrsize,false);<br />

tsp:=tsp· .aeltype<br />

end;<br />

end<br />

else<br />

begin Isp:=typid(+0105); sz:=sizeof(lsp) end;<br />

pip:=hip;<br />

while pipnil do<br />

begin pip· .vpos.ad: =address(hlc,sz,false);<br />

pip· .idtype:=lsp; pip:=pip· .next<br />

end;<br />

end;<br />

if lastip=nil then parlist:=hip else lastip· .next:=hip;<br />

lastip:=lip;<br />

end;<br />

until endofloop(fsys, [ident,varsy,procsy,funcsyl,<br />

semicolon ,+01 06); {+01071<br />

end;<br />

procedure pfhead; (forward declared)<br />

var l1p:ip; ISp:sp; lnp:np; kl :idclass;<br />

begin lip:=nil; again:=false;<br />

if sy=procsy then kl: =proc else<br />

begin kl:=func; fsys:=fsys+[colon1,identl end;<br />

insym;<br />

if syident then begin error(+0108); id:=spaces end;<br />

if not param then lip:=searchsection(top· .fname);<br />

if lipnil then<br />

if (lip·.klasskl) or (lip· .pfkindforwrd) then<br />

errid (+0109, id)<br />

else<br />

begin b.forwcount::b.forwcount-1; again:=true end;<br />

if again then insym else<br />

begin lip:=newip(kl,id,nil,nil);<br />

if sy=ident then begin enterid(lip); insym end;<br />

lastpfno: =lastpfno+1; lip· .pfno: =lastpfno;<br />

end;<br />

level: =level+ 1;<br />

....<br />

<br />

oc<br />

....<br />

-0<br />

»<br />

'" m<br />

N<br />

....

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

Saved successfully!

Ooh no, something went wrong!