The process of assigning load addresses to the various parts of the program and adjusting the code and date in the program to reflect the assigned addresses is called
Assembly
Parsing
Relocation
loading
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which one of the following is NOT performed during compilation?
Removal of comments
Type checking
Symbol table management
Inline expansion
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
One of the purposes of using intermediate code in compilers is to
make parsing and semantic analysis simpler.
improve error recovery and error reporting.
increase the chances of reusing the machine-independent code optimizer in other compilers.
improve the register allocation.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Which languages necessarily need heap allocation in the runtime environment?
Those that support recursion
Those that use dynamic scoping
Those that allow dynamic data structures
Those that use global variables
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
In a compiler, keywords of a language are recognized during
Lexical analysis phase
During syntax analysis phase
During semantic analysis phase, with the help of SDTs
During code optimization phase
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Some code optimizations are carried out on the intermediate code because
They enhance the portability of the compiler to other target processors
Program analysis is more accurate on intermediate code than on machine code
The information from dataflow analysis cannot otherwise be used for optimization
The information from the front end cannot otherwise be used for optimization
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Which of the following statements are CORRECT? [MSQ]
Static allocation of all data areas by a compiler makes it impossible to implement recursion.
Automatic garbage collection is essential to implement recursion.
Dynamic allocation of activation records is essential to implement recursion.
Both heap and stack are essential to implement recursion.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider the following Syntax directed translation scheme (SDTs), with non-terminals {S, Z} and terminals {p,q}.

S→ pZ {print a}

S→ p {print b}

Z→ Sq {print c}

Using the above SDTs, the output printed by a bottom-up parser, for the input “ppq”

acb
bbc
bca
None of these
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following attribute grammar with SDT

S-> (S) { S.count =P1}

S-> SS { S.count = P2}

S-> ϵ {S.count = 0}

If the above SDT count the number of balanced parenthesis, then select the correct value of P1 and P2 from options.

P1= S1.count , P2 = S1.count + S2.count
P1= S1.count+1 , P2 = S1.count + S2.count
P1= S1.count+1 , P2 = 2* S1.count
P1= S1.count , P2 = 2* S1.count
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following statements

S1: A parse tree showing the values of its attributes is called annotated parse tree.

S2: The process of computing the attribute values at the nodes is called annotating the parse tree.

Select the correct option.

Both S1 and S2 are true.
Both S1 and S2 are false.
S1 is true and S2 is false.
S1 is false and S2 is true.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Which of the following is correct?

S1: The drawback for quadruple representation of 3-address code is it requires more space compared to triple notation.

S2: The drawback of indirect triples is that it requires two memory access.

Only S1
Neither S1 nor S2
Only S2
Both S1 and S2
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider three programming languages viz. C, C++, C# and JAVA and three machines which have different configuration (such as OS, hardware). If someone needs to write a compiler for the above mentioned languages and machines, then the number of compilers required with and without intermediate code phase are --------- and -------- respectively.
7 and 12
15 and 18
12 and 6
6 and 14
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following SDT:

S→AB

A→ val {print (val) }

B→ *A {print (+) } B | ϵ

For the input string: 1*2*3, what will be output?

1+2+3
12+3+
123++
++123
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the productions A→BC and A→XY. Each of the five non-terminals A,B,C,X and Y has two attributes: “s” is a synthesized attribute and “i” is an inherited attribute. Consider the following rules.

Rule 1: B.i=A.i+5, C.i=B.i+A.i and A.s=B.s+C.s

Rule 2: X.i=A.i+Y.s , and Y.i=X.s +A.i

Select the correct option.

Only Rule 1 is L attributed.
Only Rule 2 is L attributed.
Both rule 1 and rule 2 are L attributed.
Neither rule 1 nor rule 2 are L attributed.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the SDT given below

S → aSb {S.val = S.val+2}

| bSa {S.val = S.val+2}

| ϵ {S.val = 0}



The above SDT performs:

Counts the total number of reductions.
Counts the total number of a’s and b’s
counts the number of pairs of a’s and b’s
None of these
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66