search
Log In

Recent questions tagged compiler-design

0 votes
1 answer
1
State whether the following statements are True or False with reasons for your answer: A two pass assembler uses its machine opcode table in the first pass of assembly.
asked May 3 in Compiler Design gatecse 296 views
0 votes
1 answer
2
State whether the following statements are True or False with reasons for your answer A symbol declared as ‘external’ in an assembly language program is assigned an address outside the program by the assembler itself.
asked May 3 in Compiler Design gatecse 96 views
10 votes
6 answers
3
Consider the following $\text{ANSI C}$ program: int main () { Integer x; return 0; } Which one of the following phases in a seven-phase $C$ compiler will throw an error? Lexical analyzer Syntax analyzer Semantic analyzer Machine dependent optimizer
asked Feb 18 in Compiler Design Arjun 3.6k views
1 vote
3 answers
4
In the context of compilers, which of the following is/are $\text{NOT}$ an intermediate representation of the source program? Three address code Abstract Syntax Tree $\text{(AST)}$ Control Flow Graph $\text{(CFG)}$ Symbol table
asked Feb 18 in Compiler Design Arjun 1.6k views
4 votes
2 answers
5
Consider the following $\text{ANSI C}$ code segment: z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z > i) { p = p + x + 3; q = q + y->f1; } else { p = p + y->f2; q = q + x + 3; } } Assume that the variable $y$ points to ... the form $\textsf{ y ->f1}$ or $\textsf{y ->f2}$) in the optimized code, respectively, are: $403$ and $102$ $203$ and $2$ $303$ and $102$ $303$ and $2$
asked Feb 18 in Compiler Design Arjun 1.4k views
2 votes
3 answers
6
For a statement $S$ in a program, in the context of liveness analysis, the following sets are defined: $\text{USE}(S)$ : the set of variables used in $S$ $\text{IN}(S)$ : the set of variables that are live at the entry of $S$ $\text{OUT}(S)$ : the set of variables that are live at the ... $) }\cup \text{ OUT ($S_2$)}$ $\text{OUT ($S_1$)} = \text{USE ($S_1$)} \cup \text{IN ($S_2$)}$
asked Feb 18 in Compiler Design Arjun 608 views
0 votes
1 answer
7
Consider the following augmented grammar with $\{ \#, @, <, >, a, b, c \}$ ... $I_0 = \text{CLOSURE}(\{S' \rightarrow \bullet S\})$. The number of items in the set $\text{GOTO(GOTO}(I_0<), <)$ is ___________
asked Feb 18 in Compiler Design Arjun 714 views
1 vote
2 answers
8
Consider the following statements. $S_1:$ Every $\text{SLR(1)}$ grammar is unambiguous but there are certain unambiguous grammars that are not $\text{SLR(1)}$. $S_2:$ For any context-free grammar, there is a parser that takes at most $O(n^3)$ time to parse a string of length $n$. ... $S_2$ is false $S_1$ is false and $S_2$ is true $S_1$ is true and $S_2$ is true $S_1$ is false and $S_2$ is false
asked Feb 18 in Compiler Design Arjun 1k views
1 vote
2 answers
9
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation $\text{(SDT)}$ ... The actions can be used to type-check syntactically correct boolean variable declarations and boolean expressions. The actions will lead to an infinite loop
asked Feb 18 in Compiler Design Arjun 1.4k views
3 votes
2 answers
10
Consider the following context-free grammar where the set of terminals is $\{a,b,c,d,f\}$ ... $\boxed{1}\;\text{blank} \qquad \boxed{2}\;\text{S} \rightarrow \text{R}f \qquad \boxed{3}\; \text{blank} \qquad \boxed{4}\;\text{blank} $
asked Feb 18 in Compiler Design Arjun 604 views
1 vote
2 answers
11
Consider the following $C$ code segment: a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; In a compiler, this code segment is represented internally as a directed acyclic graph $\text{(DAG)}$. The number of nodes in the $\text{DAG}$ is _____________
asked Feb 18 in Compiler Design Arjun 717 views
2 votes
1 answer
12
Which of the following is not an intermediate code form? Syntax trees Three address codes Quadrupules Post fix Notation
asked Nov 20, 2020 in Compiler Design jothee 2.7k views
2 votes
1 answer
13
Which of the following are applications of symbol table? Storage allocation Checking type compatibility Suppressing duplicate error messages Choose the correct answer from the options given below: $(a)$ and $(b)$ only $(a)$ and $(c)$ only $(b)$ and $(c)$ only $(a)$ $(b)$ and $(c)$
asked Nov 20, 2020 in Compiler Design jothee 236 views
0 votes
1 answer
14
Find the lexicographic ordering of the bit strings given below based on the ordering $0<1$. $001$ $010$ $011$ $0001$ $0101$ Choose the correct answer from the options given below: $001 < 010 < 011 < 0001 < 0101$ $0001 < 001 < 010 < 0101 < 011$ $0001 < 0101 < 001 < 010 < 011$ $001 < 010 < 0001 < 0101 < 011$
asked Nov 20, 2020 in Compiler Design jothee 299 views
0 votes
1 answer
15
Which of the following can be accessed by transfer vector approach of linking? External data segments External subroutines Data located in other procedure All of these
asked Apr 2, 2020 in Compiler Design Lakshman Patel RJIT 385 views
0 votes
1 answer
16
0 votes
1 answer
17
0 votes
1 answer
18
0 votes
6 answers
19
Context-free grammar can be recognized by finite state automation $2$- way linear bounded automata push down automata both (B) and (C)
asked Apr 2, 2020 in Compiler Design Lakshman Patel RJIT 851 views
0 votes
1 answer
20
Consider an $\varepsilon$-tree CFG. If for every pair of productions $A\rightarrow u$ and $A\rightarrow v$ If $\text{FIRST(u)} \cap \text{FIRST(v)}$ is empty then the CFG has to be $LL(1).$ If the CFG is $LL(1)$ then $\text{FIRST(u)} \cap \text{FIRST(v)}$ has to be empty. Both $(A)$ and $(B)$ None of the above
asked Apr 1, 2020 in Compiler Design Lakshman Patel RJIT 407 views
...