Cannot be merged but will result in R-R conflictĬ. Cannot be merged since look aheads are different.ī. Related to the merging of two sets in the corresponding parser, the statement that does not hold true isĪ. Absolute addresses of internal symbolsĪNS:- Absolute addresses of internal symbolsġ2) We have two sets of LR (1) items of LR (1) grammar described below. Names and locations of all external symbols defined in the object moduleĬ. Those that allow dynamic data structureĪNS:- Those that allow dynamic data structureġ0) When is the type checking usually done?ġ1) What information need to be included in an object module, if a linker is given object modules for a set of programs that were compiled separately?Ī. The handles in the right-sentential form of the reduction for a sentence n + n x n areĩ) The languages that need heap allocation in the runtime environment areĭ.
DEFINITION OF PARSING IN 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ī.
DEFINITION OF PARSING IN 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 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Ī. There is a scope of dead code eliminationĬ.
COMPILER DESIGN Multiple Choice Questions :-ġ) For the C program given below the statement that does not hold true isī.