Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Compiler Design:
Recent questions tagged compiler-design
0
votes
0
answers
271
#self doubt
https://gateoverflow.in/908/Gate-cse-2003-question-18 Here In fact only for the L-attributed grammar made from a LL(1) grammar, we can always guarantee a bottom-up parsing. Even for LR(1) grammar, bottom-up parsing is not a guarantee for all ... . ...I am not getting this line...Can somebody please explain with suitable example? @Arjun Sir @Deepak Poonie Sir can you please explain
https://gateoverflow.in/908/Gate-cse-2003-question-18Here ” In fact only for the L-attributed grammar made from a LL(1) grammar, we can always guarantee a bottom-up par...
samarpita
231
views
samarpita
asked
Dec 13, 2021
Compiler Design
compiler-design
syntax-directed-translation
+
–
0
votes
0
answers
272
#self doubt
we know that a + *b there is no semantic error but a + /b is a syntax error or semantic error?
we know that a + *b there is no semantic error but a + /b is a syntax error or semantic error?
samarpita
224
views
samarpita
asked
Dec 10, 2021
Compiler Design
compiler-design
+
–
1
votes
0
answers
273
#self doubt
My question is here that...we know what is static single assignment code ...that the left side we will be a new variable...and in 3 address code there is no such thing...now my question is if we use simply 3 address code then what will be the minimum number of temporary variables?
My question is here that...we know what is static single assignment code ...that the left side we will be a new variable...and in 3 address code there is no such thing......
samarpita
436
views
samarpita
asked
Dec 10, 2021
Compiler Design
compiler-design
+
–
0
votes
0
answers
274
#self doubt
float a =10 is not a semantic error but in the semantic phase int a =10.0 will be a semantic error or not bcz compiler cannot do explicit type conversion..so it must be an error...but when I am running this program this is showing no error...
float a =10 is not a semantic error but in the semantic phase int a =10.0 will be a semantic error or not bcz compiler cannot do explicit type conversion..so it must be a...
samarpita
255
views
samarpita
asked
Dec 10, 2021
Compiler Design
compiler-design
+
–
1
votes
0
answers
275
#self doubt
int 7=10; It is a semantic error or syntax error? My thinking is that it can be tokenized as id id = id ;….So it is valid statement...so it must be semantic error? Correct me if I am wrong.
int 7=10;It is a semantic error or syntax error?My thinking is that it can be tokenized as id id = id ;….So it is valid statement...so it must be semantic error?Correct...
samarpita
260
views
samarpita
asked
Dec 10, 2021
Compiler Design
compiler-design
+
–
0
votes
0
answers
276
#self doubt
Assembler,Linker,Macros are there in compiler design?
Assembler,Linker,Macros are there in compiler design?
samarpita
316
views
samarpita
asked
Dec 9, 2021
Compiler Design
compiler-design
macros
linker
assembler
+
–
0
votes
0
answers
277
NPTEL Assignment Question
Suppose there is a compiler for C language that can generate code for Computer A. Which of the following statements is true (A) It can be used for Computer A only (B) It can be used for any computer (C) It can be used only for computers with similar processor and operating system (D) It can be used only for computers with similar processor, operating system and peripherals
Suppose there is a compiler for C language that can generate code for Computer A. Which of the following statements is true (A) It can be used for Computer A only(B) It c...
rsansiya111
1.0k
views
rsansiya111
asked
Dec 6, 2021
Compiler Design
nptel-quiz
compiler-design
+
–
1
votes
1
answer
278
NPTEL Assignment Question
Natural language constructs are (A) Unambiguous (B) Ambiguous (C) May be unambiguous or ambiguous (D) None of the other options
Natural language constructs are(A) Unambiguous (B) Ambiguous (C) May be unambiguous or ambiguous (D) None of the other options
rsansiya111
795
views
rsansiya111
asked
Dec 6, 2021
Compiler Design
compiler-design
nptel-quiz
ambiguous-grammar
+
–
0
votes
2
answers
279
lexical and syntax error
what is the difference between lexical error and syntax error?
what is the difference between lexical error and syntax error?
Mohit Aggarwal
1.3k
views
Mohit Aggarwal
asked
Dec 1, 2021
Compiler Design
compiler-design
lexical-analysis
+
–
0
votes
1
answer
280
#self doubt
What is the difference between recursive descent parser and ll(1) parser, since in both no left recursion and left factoring is allowed…..then what is the advantage of using recursive descent parser??
What is the difference between recursive descent parser and ll(1) parser, since in both no left recursion and left factoring is allowed…..then what is the advantage of ...
samarpita
266
views
samarpita
asked
Nov 18, 2021
Compiler Design
compiler-design
ll-parser
+
–
1
votes
4
answers
281
#self doubt
Every unambiguous grammar is LR(0) grammar?
Every unambiguous grammar is LR(0) grammar?
samarpita
1.2k
views
samarpita
asked
Nov 18, 2021
Compiler Design
compiler-design
lr-parser
+
–
0
votes
2
answers
282
#Selfdoubt How L-attributed semantic rules are evaluated? Whether they are evaluated simultaneously during parsing?
If the grammar has only S-attributed semantic definitions, in a top down parser we will add the semantic action at the end of production and it will we executed when we...
jaswanth431
792
views
jaswanth431
asked
Nov 16, 2021
Compiler Design
compiler-design
syntax-directed-translation
+
–
1
votes
2
answers
283
Applied Test Series
Consider the following code 1. location = -1 2. i=0 3. if (i<100) goto 5 4. goto 13 5. t1 = 4*i 6. go to 3 7. t2 = A[t1] 8. if t2 = x goto 10 9. goto 11 10.location = i 11.t3 = i+1 12.i = t3 13.goto 3 The number of basic blocks from the given code are______
Consider the following code 1. location = -12. i=03. if (i<100) goto 54. goto 135. t1 = 4*i6. go to 37. t2 = A[t1]8. if t2 = x goto 109. goto 1110.location = i11...
LRU
681
views
LRU
asked
Nov 13, 2021
Compiler Design
test-series
compiler-design
intermediate-code
+
–
0
votes
0
answers
284
DAG ( compiler Design)
How Directed acyclic graph would be constructed for this instruction? b[j] = a ;
How Directed acyclic graph would be constructed for this instruction?b[j] = a ;
Ankita87077
574
views
Ankita87077
asked
Oct 28, 2021
Compiler Design
compiler-design
directed-acyclic-graph
+
–
1
votes
1
answer
285
Directed acyclic graph
Consider the following three address code: T1= a+b T2= c+d T3=a-b T4= T1+T3 T5= T2+T1 T6 = T5+T4 T7 = c + T6 Number of nodes and edges in DAG of the above code? If we'll do simplification , then T4 would be T4 = a+b+a-b => a+a , after this simplification T3 is not used anywhere in the program, so it can be eliminated or we'll include it in DAG??
Consider the following three address code:T1= a+bT2= c+dT3=a-bT4= T1+T3T5= T2+T1T6 = T5+T4T7 = c + T6Number of nodes and edges in DAG of the above code?If we'll do simpli...
Ankita87077
967
views
Ankita87077
asked
Oct 27, 2021
Compiler Design
compiler-design
intermediate-code
three-address-code
+
–
1
votes
1
answer
286
Compiler Design (register allocation)
In such questions, In which it is asked " minimum number of registers required for executing this three address code without spilling", can we apply code motion optimization or not? As in a question of made easy test series : T1 = a; ... = R1} So,which one is correct, made easy one or second one applying code motion? Can anybody please clarify this.
In such questions, In which it is asked " minimum number of registers required for executing this three address code without spilling", can we apply code motion optimizat...
Ankita87077
509
views
Ankita87077
asked
Oct 27, 2021
Compiler Design
compiler-design
intermediate-code
three-address-code
made-easy-test-series
+
–
1
votes
1
answer
287
Made Easy Test Series
According to the solution, there is no error in the program. And I ran the program there is no error. But how the rank is declared as int and initialized by 10.3 which is float. So, there should be a semantic error.
According to the solution, there is no error in the program. And I ran the program there is no error. But how the rank is declared as int and initialized by 10.3 which is...
Nihal Singh
506
views
Nihal Singh
asked
Oct 4, 2021
Compiler Design
compiler-design
compilation-phases
+
–
1
votes
1
answer
288
3-Address Code Generation
Hi Everyone, For this the Given Answer is 5, I got 4. I am now confused about how the 3 address code is generated here.
Hi Everyone,For this the Given Answer is 5, I got 4. I am now confused about how the 3 address code is generated here.
Nihal Singh
1.4k
views
Nihal Singh
asked
Oct 4, 2021
Compiler Design
compiler-design
three-address-code
static-single-assignment
test-series
+
–
1
votes
2
answers
289
#compiler-design
Which of the following statements are true. Please give a detailed explanation. 1) If the given grammar is not operator grammar then we can’t design an operator precedence table and there doesn’t exist an operator precedence parser. 2) If the given grammar is operator grammar then it is guaranteed that there exists an operator precedence parser.
Which of the following statements are true. Please give a detailed explanation.1) If the given grammar is not operator grammar then we can’t design an operator precede...
Crackca
757
views
Crackca
asked
Sep 19, 2021
Compiler Design
compiler-design
operator-grammar
operator-precedence
+
–
3
votes
1
answer
290
#compiler-design
Design predictive parsing table for below grammar. How many multiple entries are there? S → AA | ab A → Bd | ε B → SB | d
Design predictive parsing table for below grammar.How many multiple entries are there?S → AA | abA → Bd | εB → SB | d
Crackca
606
views
Crackca
asked
Sep 18, 2021
Compiler Design
compiler-design
parsing
numerical-answers
+
–
4
votes
1
answer
291
S->AA/ab A->Bd/null B->SB/d remove left recursion
S->AA/ab A->Bd/null B->SB/d remove left recursion
S->AA/ab A->Bd/null B->SB/dremove left recursion
vrajdobariya
1.1k
views
vrajdobariya
asked
Sep 6, 2021
Compiler Design
compiler-design
left-recursion
grammar
+
–
3
votes
1
answer
292
GATE CSE 1994 | Question: 17b
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.
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.
gatecse
2.3k
views
gatecse
asked
May 3, 2021
Compiler Design
gate1994
compiler-design
normal
assembler
true-false
descriptive
+
–
5
votes
1
answer
293
GATE CSE 1994 | Question: 18b
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.
State whether the following statements are True or False with reasons for your answerA symbol declared as ‘external’ in an assembly language program is assigned an ad...
gatecse
1.3k
views
gatecse
asked
May 3, 2021
Compiler Design
gate1994
compiler-design
normal
assembler
true-false
descriptive
+
–
21
votes
7
answers
294
GATE CSE 2021 Set 2 | Question: 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
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?Lex...
Arjun
17.0k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set2
compilation-phases
compiler-design
1-mark
+
–
9
votes
4
answers
295
GATE CSE 2021 Set 2 | Question: 13
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
In the context of compilers, which of the following is/are $\text{NOT}$ an intermediate representation of the source program?Three address codeAbstract Syntax Tree $\text...
Arjun
6.7k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set2
multiple-selects
compiler-design
intermediate-code
1-mark
+
–
19
votes
2
answers
296
GATE CSE 2021 Set 2 | Question: 30
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; } ... $\textsf{y ->f2}$) in the optimized code, respectively, are: $403$ and $102$ $203$ and $2$ $303$ and $102$ $303$ and $2$
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;...
Arjun
9.6k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set2
code-optimization
compiler-design
2-marks
+
–
12
votes
4
answers
297
GATE CSE 2021 Set 2 | Question: 38
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 ... S_2$) }\cup \text{ OUT ($S_2$)}$ $\text{OUT ($S_1$)} = \text{USE ($S_1$)} \cup \text{IN ($S_2$)}$
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)$ : t...
Arjun
6.7k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set2
code-optimization
live-variable-analysis
compiler-design
2-marks
+
–
8
votes
1
answer
298
GATE CSE 2021 Set 2 | Question: 51
Consider the following augmented grammar with $\{ \#, @, <, >, a, b, c \}$ ... $\text{GOTO(GOTO}(I_0<), <)$ is ___________
Consider the following augmented grammar with $\{ \#, @, <, >, a, b, c \}$ as the set of terminals. $$\begin{array}{l} S’ \rightarrow S \\ S \rightarrow S \# cS \\ S \r...
Arjun
6.5k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set2
compiler-design
lr-parser
numerical-answers
2-marks
+
–
10
votes
2
answers
299
GATE CSE 2021 Set 1 | Question: 5
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 ... 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
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 a...
Arjun
7.7k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set1
compiler-design
lr-parser
1-mark
+
–
18
votes
3
answers
300
GATE CSE 2021 Set 1 | Question: 26
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation $\text{(SDT)}$ ... used to type-check syntactically correct boolean variable declarations and boolean expressions. The actions will lead to an infinite loop
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation $\text{(SDT)}$ acti...
Arjun
10.3k
views
Arjun
asked
Feb 18, 2021
Compiler Design
gatecse-2021-set1
compiler-design
syntax-directed-translation
2-marks
+
–
Page:
« prev
1
...
5
6
7
8
9
10
11
12
13
14
15
...
67
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register