What is activation record? Explain clearly the components of an activation record.
Activation Record: A data structure containing the important state information for a particular instance of a function call (or something that resembles a function call). May exist entirely in memory, or be partially stored in registers. Typically, an ActivationRecord contains the following:
In many (most) programming languages, ActivationRecords maintains a strict LastInFirstOut discipline and is thus stored on a stack (often referred to as TheStack). For this reason, ActivationRecords is also commonly known as stack frames. In the context of languages (like C) where a stack is always used; this terminology is correct. As other languages don't use stacks for this purpose (many Smalltalk implementations, ActivationRecord is a more correct term when talking about languages in general.
Each activation record is a separate heap object, chained together by a pointer to its caller. Continuation capture saves the pointer to the current record, which prevents it and all stack frames under it from being garbage collected. Continuation reinstatement restores the PC, registers, and current record. Stack frames are allocated normally, but when a continuation is captured, the whole stack is copied and saved in the continuation. Continuation reinstatement restores the register state and sets the stack and frame pointers to the continuation's stack. The old stack can be deallocated or freed by the garbage collector.
What is activation record? Explain clearly the components of an activation record.
Explain different stages of compiler with a suitable example. What is token, Patterns and Lexeme?
Write the recursive algorithm to find x^ n.
What are the propositions of Putnam’s model?
Write short notes on the following :
a) BFS
b) Tail recursion
Explain left factoring with suitable example.
Write a C program to print pattern below:
*
* *
* * *
* * * *