17.05.2015 Views

Pascal News

Pascal News

Pascal News

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.

1569<br />

1570<br />

1571<br />

1572<br />

1573<br />

1574<br />

1575<br />

1576<br />

1577<br />

1578<br />

1579<br />

1580<br />

1581<br />

1582<br />

158~<br />

1585<br />

1586<br />

1587<br />

1588<br />

1589<br />

1590<br />

1591<br />

1592<br />

1593<br />

1594<br />

1595<br />

1596<br />

1597<br />

1598<br />

1599<br />

1600<br />

1601<br />

1602<br />

1603<br />

160q<br />

1605<br />

1606<br />

1607<br />

1608<br />

1609<br />

1610<br />

1612<br />

1613<br />

1614<br />

1615<br />

1616<br />

1617<br />

1618<br />

1619<br />

1620<br />

1621<br />

1622<br />

1623<br />

162q<br />

end<br />

end;<br />

if name=fip' .name then ad:=fip' .vpos.ad<br />

end<br />

else<br />

begin<br />

if not (refer in fip' .iflag) then<br />

begin genl (op_mrk,O);<br />

gen1(op lal,fip".vpos.ad); gen13p(CLS)<br />

end -<br />

end<br />

else<br />

if leveH>1 then errid(-(+021) ,fip' .name)<br />

end<br />

procedure constanh(fsys:sos; var fsp:sp; var fval:integer);<br />

var signed,min:boolean; lip:ip;<br />

begin signed :=(sy=plussy) or (sy=m1nsy);<br />

if signed then begin min:=sy=minsy; insym end else min:=false;<br />

if find1([ident •• l\IUcstJ,fsys.+022) then<br />

begin fval :=val;<br />

case sy of<br />

stringcst: f5P: =stringstruct;<br />

charest: fap: :charptr;<br />

intcst: fsp: =lntptr;<br />

realest: fsp:=realptr;<br />

longest: fsp:=longptr;<br />

nUest: fsp:=nilptr;<br />

ident:<br />

begin lip: =searchid ( [konst J );<br />

fsp:=lip·.idtype; fval:=lip".value;<br />

end<br />

end; {case)<br />

if signed then<br />

if (fsp 1ntptr) and (fsprealptr) and (fsp longptr) then<br />

error(+023)<br />

else if min then fval:= -fval;<br />

{note: negating the v-number for reals and longs)<br />

insym;<br />

end<br />

else begin fsp:=n11; fval:=O end;<br />

end;<br />

function cstinteger(fsys:sos; fSp:sp; err:integer):integer;<br />

var lsp:sp; lval ,min ,max : integer ;<br />

begin constant(fsys,lsp,lval);<br />

if fs p lsp then<br />

if eqstruct(desub(fsp) ,lsp) then<br />

begin<br />

if bounds( fsp,min ,max) then<br />

if (lvalmax) then error(+024)<br />

end<br />

else<br />

begin error(err); Ival:=O end;<br />

cstinteger: =lval<br />

end;<br />

1626<br />

1628<br />

1629<br />

1630<br />

1631<br />

1632<br />

1633<br />

1634<br />

1636<br />

1637<br />

1638<br />

1639<br />

1640<br />

1641<br />

1642<br />

16q3<br />

164q<br />

16q5<br />

1646<br />

1647<br />

1648<br />

16q9<br />

1650<br />

1651<br />

1652<br />

1653<br />

1654<br />

1655<br />

1656<br />

1657<br />

1658<br />

1659<br />

1660<br />

1661<br />

1662<br />

1663<br />

1664<br />

1665<br />

1666<br />

1667<br />

1668<br />

1669<br />

1670<br />

1671<br />

1672<br />

1673<br />

167q<br />

1675<br />

1676<br />

1678<br />

1679<br />

1680<br />

{= = = == = = === === == = = = == == = == ==== = ==== = === == ==== = = = == = == == = ==== ===== = = = )<br />

fun"t10n typid"Cerr:integer):sp;<br />

var lip:1p; lsp:sp;<br />

beg1n Isp:=n11;<br />

if syident then error(err) else<br />

begin lip:=searchid([typesJ); Isp:=lip' .idtype; insym end;<br />

typid :=lsp<br />

end;<br />

function simpletyp( fsys :sos) :5P;"<br />

var lsp,lsp1:sp; lip,hip:ip; min,max:integer; Inp:np;<br />

newsubrange:boolean;<br />

begin 15p:=n11;<br />

if find1 ([ident •• lparentJ,fsys,+D25) then<br />

if sy=lparent then<br />

begin insym; Inp:=top; {declo consts local to innermost block)<br />

while top' .occurblck do top:=top' .nlink;<br />

,lsp:=newsp(scalar,wordsize); hip:=nil; max:=O;<br />

repeat lip:=newident(konst ,lsp,hip,+026);<br />

if lipn11 then<br />

begin enterid(lip);<br />

hip:=lip; lip ..... value:=max; max:=max+1<br />

end;<br />

until endofloop( fsys+[rparentJ, [identJ ,comma,+027); {+028)<br />

if maxmax then beg1n error(+033); max:=min end;<br />

if (min>=O) and (max<br />

,."<br />

."<br />

-I<br />

,."<br />

:3<br />

..., co<br />

""<br />

....<br />

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

Saved successfully!

Ooh no, something went wrong!