search
Log In

Recent questions and answers in Compiler Design

0 votes
1 answer
2
Bottom up parser uses right hand derivation or left hand derivation????
answered Oct 21 in Compiler Design abhishek tiwary 35 views
0 votes
1 answer
3
What is actual difference between in LALR(1) and CLR(1). please explain this by taking one example.
answered Oct 21 in Compiler Design abhishek tiwary 31 views
0 votes
1 answer
4
What is the best resources to study Handles in compiler Design ? I can not understand this.
answered Oct 21 in Compiler Design abhishek tiwary 20 views
0 votes
1 answer
5
what is the usage of symbol table in code optimization phase please explain???
answered Oct 21 in Compiler Design abhishek tiwary 23 views
17 votes
2 answers
6
Consider the following code fragment void foo(int x, int y) { x+=y; y+=x; } main() { int x=5.5; foo(x,x); } What is the final value of x in both call by value and call by reference, respectively? 5 and 16 5 and 12 5 and 20 12 and 20
answered Oct 21 in Compiler Design kalin 4k views
0 votes
1 answer
7
0 votes
2 answers
8
S -> S is a context free grammer or not?
answered Oct 11 in Compiler Design JAINchiNMay 154 views
23 votes
4 answers
9
The grammar $A \rightarrow AA \mid (A) \mid \epsilon$ is not suitable for predictive-parsing because the grammar is: ambiguous left-recursive right-recursive an operator-grammar
answered Oct 10 in Compiler Design Sneha negi 7.2k views
0 votes
2 answers
10
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit production (i.e.,of type $A\to\epsilon$ and $A \to a)$ to parse a string with $n$ tokens? $n/2$ $n-1$ $2n-1$ $2^n$
answered Oct 9 in Compiler Design habedo007 154 views
0 votes
1 answer
13
Given the 3-address code for a basic block: The number of registers that are needed to allocate this basic block with no spills are ________.? My doubt here is : Is there any difference in question asking for minimum numbers of registers and minimum number ... If the question ask for minimum number of variables required in three address code, Only then should we optimize the code before counting?
answered Oct 8 in Compiler Design debmalyaSEN 235 views
0 votes
1 answer
14
0 votes
3 answers
15
A symbol is a compile time data structure. In which of the following phase/s a symbol is modified ? Only semantic analysis None of these Only lexical analysis Lexical analysis and syntax analysis
answered Oct 5 in Compiler Design prithatiti 1.3k views
0 votes
2 answers
16
The application of finite automata include:- a)Lexical Analyzer b)Text Editor c)Operating System d)All of the above
answered Oct 4 in Compiler Design Sanandan 187 views
1 vote
5 answers
18
3 votes
2 answers
19
In the Lexical Analysis, regular expression can be used to model A) the structures of lexemes with fixed length identifier excluded B) the structure of tokens C) the structure of tokens but not lexemes D) the structure of lexemes with variable length identifier included
answered Oct 3 in Compiler Design Sanandan 768 views
0 votes
5 answers
20
Consider the following statements related to compiler construction: Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. Syntax Analysis is specified by regular expressions and implemented by finite-state machine. Which of the above statement(s) is/are correct? Only I Only II Both I and II Neither I nor II
answered Oct 3 in Compiler Design Sanandan 338 views
0 votes
5 answers
21
1 vote
1 answer
23
$A→ b.a , \left \{ b \right \}$ $B→ b.,\left \{ a \right \}$ It is a SR conflict in LALR(1). Now how reduce state operated on $a$ for non terminal $B$(and not $b$) ?
answered Sep 26 in Compiler Design target2020 329 views
0 votes
1 answer
24
Which of the following is the most general phase-structured grammar ? Regular Context-sensitive Context free Syntax tree
answered Sep 24 in Compiler Design Gyanu 96 views
0 votes
1 answer
25
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
answered Sep 24 in Compiler Design Gyanu 142 views
0 votes
2 answers
26
Consider the following statements: S1 : Three-address code is a linearized representation of syntax tree. S2 : The syntax tree not depicts the natural hierarchical structure of source programm. Which of the following is true? plz explain s1 statement
answered Sep 23 in Compiler Design shaurabhpatel47 515 views
0 votes
2 answers
27
Identify the total number of tokens in the given statement printf("A%B="&i); $7$ $8$ $9$ $13$
answered Sep 22 in Compiler Design Hira Thakur 526 views
20 votes
3 answers
28
A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar $S \rightarrow xxW \;\text{{print“1"}}$ $S \rightarrow y \;\text{{print“2"}}$ $W \rightarrow Sz\; \text{{print“3"}}$ What is the translation of $xxxxyzz$ using the syntax directed translation scheme described by the above rules? $23131$ $11233$ $11231$ $33211$
answered Sep 22 in Compiler Design varunrajarathnam 3.8k views
24 votes
7 answers
29
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 \mid c)^*a$ $T_2$: $b?(a \mid c)^*b$ $T_3$: $c?(b \mid a)^*c$ Note that ... possible prefix. If the string bbaacabc is processes by the analyzer, which one of the following is the sequence of tokens it outputs? $T_1T_2T_3$ $T_1T_1T_3$ $T_2T_1T_3$ $T_3T_3$
answered Sep 20 in Compiler Design varunrajarathnam 8.1k views
36 votes
4 answers
30
Consider the following two sets of LR(1) items of an LR(1) grammar.$\begin{array}{l|l} X \rightarrow c.X, c/d &X → c.X, \$\\ X \rightarrow .cX, c/d& X → .cX, \$\\ X \rightarrow .d, c/d & X → .d, \$ ... . Cannot be merged since goto on c will lead to two different sets. $1$ only $2$ only $1$ and $4$ only $\text{1, 2, 3}$ and $4$
answered Sep 19 in Compiler Design varunrajarathnam 6.1k views
61 votes
8 answers
31
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit-production (i.e., of type $A \rightarrow \epsilon$ and $A \rightarrow a$) to parse a string with $n$ tokens? $n/2$ $n-1$ $2n-1$ $2^{n}$
answered Sep 19 in Compiler Design varunrajarathnam 10.4k views
30 votes
4 answers
32
A canonical set of items is given below $S \to L .> R $ $Q \to R.$ On input symbol $<$ the set has a shift-reduce conflict and a reduce-reduce conflict. a shift-reduce conflict but not a reduce-reduce conflict. a reduce-reduce conflict but not a shift-reduce conflict. neither a shift-reduce nor a reduce-reduce conflict.
answered Sep 19 in Compiler Design varunrajarathnam 7k views
37 votes
5 answers
34
Consider the following grammar G $S \rightarrow F \mid H$ $F \rightarrow p \mid c$ $H \rightarrow d \mid c$ Where $S$, $F$, and $H$ are non-terminal symbols, $p, d$, and $c$ are terminal symbols. Which of the following statement(s) is/are correct? S1 ... are generated using grammar G S2: LR(1) can parse all strings that are generated using grammar G Only S1 Only S2 Both S1 and S2 Neither S1 and S2
answered Sep 19 in Compiler Design varunrajarathnam 5.7k views
0 votes
1 answer
35
True or False ..detalied explanation will be helpful 1.Every DCFL has corresponding LR(k) Grammar 2.Every NCFL has corresponding LR(k) Grammar 3.Some NCFL which are not inherently ambigous have LR(k) grammar
answered Sep 19 in Compiler Design debasish paramanik 74 views
29 votes
4 answers
36
The attribute of three arithmetic operators in some programming language are given below. $\begin{array}{|c|l|}\hline \textbf{OPERATOR} & \textbf{PRECEDENCE} & \textbf{ASSOCIATIVITY} & \textbf{ARITY} \\\hline \text{$ ... $2-5+1-7*3$ in this language is ________.
answered Sep 19 in Compiler Design varunrajarathnam 3.5k views
16 votes
8 answers
37
Consider the following grammar: $P\rightarrow xQRS$ $Q\rightarrow yz\mid z$ $R\rightarrow w\mid \varepsilon$ $S\rightarrow y$ What is FOLLOW($Q$)? $\left \{ R \right \}$ $\left \{ w \right \}$ $\left \{ w,y \right \}$ $\left \{ w,\$ \right \}$
answered Sep 19 in Compiler Design varunrajarathnam 3k views
12 votes
3 answers
38
Merging states with a common core may produce __________ conflicts and does not produce ___________ conflicts in an LALR purser.
answered Sep 18 in Compiler Design varunrajarathnam 1.6k views
1 vote
3 answers
39
A grammar is defined as $A \rightarrow BC$ $B \rightarrow x \mid Bx$ $C \rightarrow B \mid D$ $D \rightarrow y \mid Ey$ $E \rightarrow z$ The non terminal alphabet of the grammar is $\{A,B,C,D,E\}$ $\{B,C,D,E\}$ $\{A,B,C,D,E,x,y,z\}$ $\{x,y,z\}$
answered Sep 14 in Compiler Design Sanandan 397 views
2 votes
3 answers
40
Given the grammar $s \rightarrow T ^{\ast} S\ \mid T$ $T \rightarrow U+T\ \mid U$ $U \rightarrow a \mid b$ Which of the following statements is wrong? Grammar is not ambiguous Priority of $+$ over $^{\ast}$ is ensured Right to left evaluation of $^{\ast}$ and $+$ happens None of these
answered Sep 14 in Compiler Design Sanandan 424 views
To see more, click for all the questions in this category.
...