Programmimg Language

(10%) Given the following Ada program: (a) (5%) Please show the reference tree (b) (5%) Please show the calling sequence (or (10%) Given the following Ada program: (a) (5%) Please show the reference tree (b) (5%) Please show the calling sequence (or chain) (c) (5%) For each of the four marked points, list each visible variable if the static scoping is used (d) (5%) For each of the four marked points, list each visible variable if the dynamic scoping is used procedure Main is X, Y: Integer; procedure Sub1 is Y, Z: Integer begin of Sub1 point 1 Sub2; -of Sub1 end; procedure Sub2 is X: Integer; procedure Sub3(B: Integer) is W: Integer begin – of Sub3 point 2 end; – of Sub3 begin of Sub2 point 3 Sub3(X); — of Sub2 end; begin –of Main point 4 Sub1; end; –of Main



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *