The Gateway to Computer Science Excellence
+1 vote
935 views
Can anybody explain me access link and control link in activation record?I am confused what is different between them

IF POSSIBLE GIVE EXAMPLE ALSO

THANKS A LOT
in Compiler Design by (379 points) | 935 views
+2
control link is used to return back to the scope of caller function..

access link is used to access data from the scope where the function(the function whose activation record is currently processed) is defined..
0
Please can u explain by an example :)

THANKS
0

@Himanshu Goyal,

main() {
    int x, y;
    #Calling a function
    fun();
}

fun() {
    #Function called from main()
    return;
}

During the function call fun(), if the function wants to access the variables x, y (statically scoped) of it's calling function i.e main(), it makes the use of access link.

Now when this function fun() terminates/returns, it's activation record is popped from the stack and the control is given back to the main() function. This is done using the control link.

Please correct me if I'm wrong anywhere.

0

@Akash Mishra Your first line is completely wrong.

Access link is defined for the static and not dynamic.

Read @joshi_nitish comment.

0

@`JEET, yes, thank you. I'll correct it.

Please log in or register to answer this question.

Related questions

+1 vote
1 answer
2
asked Nov 23, 2016 in Compiler Design by vaishali jhalani Active (4.7k points) | 558 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,644 questions
56,511 answers
195,559 comments
101,071 users