- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How are access links and displays used to access non-local names?
An access link is a pointer to each activation record that obtains a direct implementation of lexical scope for nested procedures. In other words, an access link is used to implement lexically scoped language. An “access line” can be required to place data required by the called procedure.
An improved scheme for handling static links defined at various lexical levels is the usage of a data structure called display. A display is an array of pointers to the activation records. Display  contains a pointer to the activation record of the most recent activation of a procedure defined at lexical level 0.
The number of elements in the display array is given by the maximum level of nesting in the input source program. In the display scheme of accessing the non-local variables defined in the enclosing procedures, each procedure on activation stores a pointer to its activation record in the display array at its lexical level.
It saves the previous value at that location in the display array and restores it when the procedure exits. The advantage of the display scheme is that the activation record of any enclosing procedure at lexical level ‘n’ can be directly fetched using Display [n] as opposed to traversing of the access links in the previous scheme.
There are two types of scope rules for the non-local names are as follows −
Static Scope or Lexical Scope
Lexical scope is known as static scope. In this type of scope, the scope is tested by determining the text of the program. An example such as PASCAL, C and ADA are the languages that use the static scope rule. These languages are also known as blockstructured languages.
The dynamic scope allocation rules are used for non-block structured languages. In this type of scoping, the non-local variables access refers to the non-local data which is declared in most recently called and still active procedures. There are two methods to implement non-local accessing under dynamic scoping are −
Deep Access − The basic concept is to keep a stack of active variables. Use control links instead of access links and to find a variable, search the stack from top to bottom looking for the most recent activation record that contains the space for desired variables. This method of accessing nonlocal variables is called deep access. Since search is made “deep” in the stack, hence the method is called deep access. In this method, a symbol table should be used at runtime.
Shallow Access − The idea to keep central storage and allot one slot for every variable name. If the names are not created at runtime then the storage layout can be fixed at compile time.
- What are access modifiers and non-access modifiers in Java?
- Access and Non Access Modifiers in Java
- Local Access and Transport Areas
- What are the differences between access modifiers and non-access modifiers in Java?
- Can access modifiers be used for local variables in Java?
- How many non-access modifiers are there in Java?
- Non Access Modifiers in Java
- What are final, abstract, synchronized non-access modifiers in Java?
- Multi-access Channels and Random Access Channels
- Why Protected access modifier used in Java?
- Can a method local inner class access the local final variables in Java?
- What are Remote Access Trojans?
- What are the principles of Access and Correction?
- What are various inbuilt methods used to access constants database in scipy.constants() module?
- WiFi Protected Access (WPA) and WiFi Protected Access 2 (WPA2)