+1 vote
18 views

1 Answer

+1 vote
by (user.guest)
selected by (user.guest)
 
Best answer

There are two methods of implementing block structure in compiler construction:

1. STACK ALLOCATION: This is based on the observation that scope of a declaration does not extend outside the block in which it appears, the space for declared name can be allocated when the block is entered and de-allocated when controls leave the block. The view treat block as a "parameter less procedure" called only from the point just before the block and returning only to the point just before the block. 

2. COMPLETE ALLOCATION: Here you allocate the complete memory at one time. If there are blocks within the procedure, then allowance is made for the storage needed for declarations within the books. If two variables are never alive at the same time and are at same depth they can  be assigned same storage.

Related questions

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...