Questions 21–30 of 55. Imported answers require independent review unless marked reviewed.

Topic practice 55 questionsPage 3 of 6

Question 40

Open question
CSMCQ2 marksNeeds review
Consider the following context-free grammar where the start symbol is S and the set of terminals is .





The following is a partially-filled LL(1) parse table.

a
b
c
d
$
S


(1)
(2)

A

(3)



B
(4)




Which one of the following options represents the CORRECT combination for the numbered cells in the parse table?
Note: In the options, “blank” denotes that the corresponding cell is empty.
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 43

Open question
CSMCQ2 marksNeeds review
Consider the following expression:

. The following sequence shows the list of triples representing the given expression, with entries missing for triples (1), (3), and (6).
Triple
Operator
Argument 1
Argument 2
(0)
+
p
r
(1)



(2)
minus
(1)

(3)



(4)
/
u
w
(5)
+
(3)
(4)
(6)



(7)
=
(6)
(5)
Which one of the following options fills in the missing entries CORRECTLY?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 65

Open question
CSNAT2 marksNeeds review
Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is {

}

Let

. The number of items in the set

is __________

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 11

Open question
CSMCQ1 markNeeds review
Consider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the target hardware. S2: The back-end includes phases that are specific to the target hardware. S3: The back-end includes phases that are specific to the programming language used in the source code.
Identify the CORRECT option.
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 19

Open question
CSMCQ1 markNeeds review
Consider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions:
letter

[A–Za–z] digit

[0–9] id

letter (letter

digit)

Which one of the following Non-deterministic Finite-state Automata with

-transitions accepts the set of valid identifiers? (A double-circle denotes a final state)
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 37

Open question
CSMCQ2 marksNeeds review
Consider the control flow graph shown.
Diagram for Computer Science and Information Technology question 37

Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 60

Open question
CSNAT2 marksNeeds review
Consider the syntax directed translation given by the following grammar and semantic rules. Here

,

,

and

are non-terminals.

is the starting non-terminal, and #, 0 and 1 are lexical tokens corresponding to input letters “#”, “0” and “1”, respectively.

denotes the synthesized attribute (a numeric value) associated with a non-terminal

.

and

denote occurrences of

and

on the right hand side of a production, respectively. For the tokens 0 and 1,

and

.
Production
Semantic rule














The value computed by the translation scheme for the input string

is __________. (Rounded off to three decimal places)

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 13

Open question
CSMCQ1 markNeeds review
Which one of the following statements is TRUE?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 29

Open question
CSNAT1 markNeeds review
Consider the augmented grammar with

as the set of terminals.




If

is the set of two LR(0) items

, then

contains exactly __________ items.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 65

Open question
CSNAT2 marksNeeds review
Consider the following grammar along with translation rules.





Here # and % are operators and

is a token that represents an integer and

represents the corresponding integer value. The set of non-terminals is

and a subscripted non-terminal indicates an instance of the non-terminal.
Using this translation scheme, the computed value of

for root of the parse tree for the expression

is __________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer