Source language issue (Run Time Memory Management)

1. Procedure call
  • A procedure definition is a declaration that associates an identifier with a statement.
  • The identifier is the procedure name and the statement is the procedure body.
  • For example, the following is the definition of procedure named readarray:
Procedure readarray
Var i: integer;
Begin
     For i=1 to 9 do real(a[i])
End;
  • When a procedure name appears within an executable statement, the procedure is said to be called at that point.

2. Activation tree
  •  An activation tree is used to depict the way control enters and leaves activations. In an activation tree,
    1. Each node represents an activation of a procedure.
    2. The root represents the activation of the main program.
    3. The node for a is the parent of the node b if and only if control flows from activation a to b.
    4. The node for a is to the left of the node for b if and only if the lifetime of a occurs before the lifetime of b.

3. Control stack
  • A control stack is used to keep track of live procedure activations.
  • The idea is to push the node for activation onto the control stack as the activation begins and to pop the node when the activation ends.
  • The contents of the control stack are related to paths to the root of the activation tree.
  • When node n is at the top of the stack, the stack contains the nodes along the path from n to the root.

4. The scope of declaration
  • A declaration is a syntactic construct that associates information with a name.
  • Declaration may be explicit, such as:
var i: integer;
  • Or they may be implicit. Example, any variable name starting with i is assumed to denote an integer.
  • The portion of the program to which a declaration applies is called the scope of that declaration.

5. Bindings of names
  • Even if each time name is declared once in a program, the same name may denote different data objects at run time.
  • “Data object” corresponds to a storage location that holds values.
  • The term environment refers to a function that maps a name to a storage location.
  • The term state refers to a function that maps a storage location to the value held there.

Source language issue (Run Time Memory Management)


Download the Android app to get all Government Job Notifications on your Mobile.
Download Now
Important: Please always Check and Confirm the above details with the official Advertisement / Notification.
Previous Post Next Post