#Quiz questions answers compiler design code
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Ĩ) We have the grammar E->E + n I E x n I n. In the compiled code, the minimum number of spills to memory isħ) Assume that no other optimization other than optimizing register allocation is applied. The only allowed complier optimization is code motion. The code motion moves the statements from one place to another while preserving correctness. Assume that all the variables are dead after this code segment.Ħ) Only two registers are available in the instruction set architecture of the processor. For each instruction almost two source operands and one destination The processor allows only register operands in its instructions and the given code segment is executed in that processor. What is the maximum number of reduces moves that can be taken by a bottom-up parser for this grammar?įor questions 6 and 7 refer to the data given below: of type A->ε andĪ ->a) to parse a string, with n tokens. The shift entries in both the tables may be identicalĪNS:- The go to part of both tables may be differentĥ) We have a grammar with not epsilon and unit production (i.e. The go to part of both tables may be differentĭ. The error entries in both the tables may be differentĬ. The reduce entries in both the tables may be differentī.
#Quiz questions answers compiler design free
The grammar rules that violate the requirements of an operator grammar isĤ) Which one of the following statement is false for the SLR (1) and LALR (1) parsing tables for a context free grammar?Ī. Implementation of lexical and syntax analysis is easierĪNS:- Implementation of lexical and syntax analysis is easierģ) Consider the grammar where P, Q, R are not terminals and r, s, t are terminals
![quiz questions answers compiler design quiz questions answers compiler design](https://engineeringinterviewquestions.com/wp-content/uploads/2017/11/COMPILER-DESIGN-Questions-and-Answers.png)
Portability of the front end of the compiler is enhancedĭ. To generate code for real machines directly from high-level language programs is not possibleĬ. Syntax-directed translations can be written for intermediate code generationī. There is a scope of common sub-expression eliminationĪNS:- There is a scope of dead code eliminationĢ) In compilers generation of intermediate code based on an abstract machine model is useful becauseĪ.
![quiz questions answers compiler design quiz questions answers compiler design](https://s3.studylib.net/store/data/007626334_2-0a47157d4dc8493b72a40d249cf7a0a2-768x994.png)
There is a scope of dead code eliminationĬ.
![quiz questions answers compiler design quiz questions answers compiler design](https://d20ohkaloyme4g.cloudfront.net/img/document_thumbnails/d321a6aa9d1bd12aba3ac8ad8599d5b1/thumb_1200_1698.png)
COMPILER DESIGN Multiple Choice Questions :-ġ) For the C program given below the statement that does not hold true isī.