USE THIS SEARCH BOX AND GET MORE QUESTIONS UPDATES

Saturday, August 20, 2016

Compiler Design

1. In compilers generation of intermediate code based on an abstract machine model is useful because
Syntax-directed translations can be written for intermediate code generation To generate code for real machines directly from high-level language programs is not possible Portability of the front end of the compiler is enhanced Implementation of lexical and syntax analysis is easier

2.Which one of the following statement is false for the SLR (1) and LALR (1) parsing tables for a context free grammar?
The reduce entries in both the tables may be different The error entries in both the tables may be different The go to part of both tables may be different The shift entries in both the tables may be identical

3.Only two registers are available in the instruction set architecture of the processor. The code motion moves the statements from one place to another while preserving correctness. The only allowed complier optimization is code motion. In the compiled code, the minimum number of spills to memory is
0 1 2 3

4.Assume that no other optimization other than optimizing register allocation is applied. To compile this code segment without any spill to memory the minimum number of registers needed in the instruction set architecture of the processor is
3 6 4 5

5.The languages that need heap allocation in the runtime environment are
Those that use global variables Those that use dynamic scoping Those that support recursion Those that allow dynamic data structure

No comments:

Post a Comment