
Hello friends
Here I am going to post PREVIOUS YEAR SOLVED QUESTIONS OF TOC AND COMPILER 2005 .
There are 2 Questions from TOC and 3 from COMPILER IN YEAR 2005 (D2)
Q. 1 Which sentence can be generated by
S -> d | bA, A -> d | ccA
a) bccccd
b) aabccd
c) ababccd
d) abbbd
Ans- A -> d|ccA
Explanation: A -> (cc)*d
Then S -> d| bA it give
S -> d| b(cc)*d
L= b( c c )* d+d
Now finally it become
bccccd ,which is generated by the language.
Q 2. Regular expression a+b denotes the set:
a) {a}
b) {€,a,b}
c) {a,b}
d) Non of these
Ans: c) {a,b}
Explanation: a+b is used to accept either a or b only in a regular expression. So we can say that c is the ans.
Q 3. A Top-down Parse generates:
a) Left most derivation
b) Right most derivation
c) Right most derivation in reverse
d) Left most derivation in reverse
Ans: a) Left most derivation
Explanation:
top down parsing -left most derivation
Q 4. A general macroprocessor is an in built function of:
a) Loader
b) Linker
c) Editor
d) Assembler
Ans: d) Assembler
Explanation: An assembler is a program that takes basic computer instructions and it converts them into a pattern of bits that the computer’s processor can use to perform it’s basic operations ,so ans is assembler.
Q 5. Which activities is not included in the first pass of two pass assembler?
a) build the symbol table
b) Construct the Intermediate code
c) seperats memonic opcode and operand field.
d) Non of these
Ans: d) Non of these
Explanation: In Question asked not included but all the three options are included in the first Parse of two pass assembler so ans is d.
Hope you all are defenately benefited by this post and understand well. If required more detail explanation then comment in comment section ,will defenately explain that topic. And also mention is this sufficient explanation so that I can improve the pattern of post and make it more easier to you .
Thanks a lot☺️