Du-chains Definition-use in Compiler Design
Consider the following given grammar:
S \rightarrow Aa A \rightarrow BD B \rightarrow b|\epsilon D \rightarrow d|\epsilon
Let a, b, d and $ be indexed as follows:
Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a, b, d, $}, then the answer should be 3210).
Answer:_____
A | 310 |
B | 3100 |
C | 31 |
D | 220 |
GATE CSE 2019 Parsing
Which one of the following kinds of derivation is used by LR parsers?
A | Leftmost |
B | Leftmost in reverse |
C | Rightmost |
D | Rightmost in reverse |
GATE CSE 2019 Parsing
A particular BNF definition for a "word is given by the following rules.
< word > :: =< letter > I < letter > < charpair > I < letter >< intpair >
< charpair > :: =< letter >< letter > I < charpair >< letter >< letter >
< intpair > :: = < integer >< integer > I < intpair >< integer >< integer >
< letter > :: = a I b I c I ......I Y I Z
< integer > :: = 0 I 1 I 2 I ......I 9
Which of the following lexical entries can be derived from < word >?
I. pick
II. picks
III. c44
A | I, II and III |
B | I and II only |
C | I and III only |
D | II and III only |
ISRO CSE 2018 Lexical Analysis
Which of the following comment about peep-hole optimization is true?
A | It is applied to small part of the code and applied repeatedly |
B | It can be used to optimize intermediate code |
C | It can be applied to a portion of the code that is not contiguous |
D | It is applied in symbol table to optimize the memory requirements. |
ISRO CSE 2018 Intermediate Code Generation
DU-chains(Definition-Use) in compiler design:
A | consist of a definition of a variable and all its uses, reachable from that definition |
B | are created using a form static code analysis |
C | are prerequisite for many compiler optimization including constant propagation and common sub-expression elimination |
D | All of the above |
ISRO CSE 2018
Incremental-Compiler is a compiler:
A | which is written in a language that is different from the source language |
B | compiles the whole source code to generate object code afresh |
C | compiles only those portion of source code that have been modified |
D | that runs on one machine but produces object code for another machine |
ISRO CSE 2018
Which of the following comparisons between static and dynamic type checking incorrect?
A | Dynamic type checking slows down the execution |
B | Dynamic type checking offers more flexibility to the programmers |
C | In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors |
D | Unlike static type checking dynamic type checking is done during compilation |
ISRO CSE 2018 Runtime Environment
C onsider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #.
Which one of the following is correct for the given parse tree?
A | \$ has higher precedence and is left associative; # is right associative |
B | # has higher precedence and is left associative; \$ is right associative |
C | \$ has higher precedence and is left associative; # is left associative |
D | # has higher precedence and is right associative; \$ is left associative |
GATE CSE 2018 Parsing
A lexical analyzer uses the following patterns to recognize three tokens T_{1}, T_{2}, \; and \; T_{3} over the alphabet {a,b,c}.
T_{1}:a?(b|c)^* a
T_{2}:b?(a|c)^* b
T_{3}:c?(b|a)^* c
Note that 'x?' means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix.
If the string bbaacabc is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
A | T_{1}T_{2}T_{3} |
B | T_{1}T_{1}T_{3} |
C | T_{2}T_{1}T_{3} |
D | T_{3}T_{3} |
GATE CSE 2018 Lexical Analysis
Which one of the following statements is FALSE?
A | Context-free grammar can be used to specify both lexical and syntax rules. |
B | Type checking is done before parsing. |
C | High-level language programs can be translated to different Intermediate Representations. |
D | Arguments to a function can be passed using the program stack. |
GATE CSE 2018 Syntax-directed Translation
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- ...
- 17
- 18
There are 30 questions to complete.
Du-chains Definition-use in Compiler Design
Source: https://practicepaper.in/gate-cse/compiler-design?page_no=3
Post a Comment for "Du-chains Definition-use in Compiler Design"