Run-Time-Environment
Question 1 |
Consider the following statements.
- I. Symbol table is accessed only during lexical analysis and syntax analysis.
II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment.
III. Errors violating the condition ‘any variable must be declared before its use’ are detected during syntax analysis.
Which of the above statements is/are TRUE?
II only | |
I only | |
I and III only
| |
None of I, II and III |
Question 1 Explanation:
I is wrong as Symbol table is also accessed during semantic analysis phase.
II is wrong as compilers which supports recursion require stack memory in run time environment.
III is wrong “any variable must be declared before its use” is a semantic error and not syntax error.
II is wrong as compilers which supports recursion require stack memory in run time environment.
III is wrong “any variable must be declared before its use” is a semantic error and not syntax error.
Question 2 |
A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which of the following is true?
A compiler using static memory allocation can be written for L | |
A compiler cannot be written for L; an interpreter must be used | |
A compiler using dynamic memory allocation can be written for L | |
None of the above |
Question 2 Explanation:
Compiler is use dynamic memory allocation then the memory will be allocated to an array at runtime.
Question 3 |
Heap allocation is required for languages
that support recursion | |
that support dynamic data structures | |
that use dynamic scope rules | |
None of the above |
Question 3 Explanation:
Heap allocation is required for languages that support dynamic data structures.
Question 4 |
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?
Assembler | |
Linker | |
Loader | |
Compiler |
Question 4 Explanation:
In many operating system loader is permanently resident in memory.
Some OS may allow virtual memory may allow the loader to be located in a region of memory that is in page table.
Some OS may allow virtual memory may allow the loader to be located in a region of memory that is in page table.
There are 4 questions to complete.
