Assignment 1 Group2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Unity University

Principles of Compiler Design


Assignment-1

The assignment will submitted online by the representatives of each section.


The submission deadline will be on September 10, 2020.

Part I – Give your short answer questions on the space provided.

1. Compiler translates the source code to __________________________________.



2. Compiler should report the presence of _______________ in the source program, in translation
process.

3. What is the output of lexical analyzer? Ans. _______________________________________.

4. Grammar of the programming is checked at _______________________________ phase of compiler.

5. _____________________________________ is a process of finding a parse tree for a string of
tokens.


6. Compiler can check ______________________________ error.

7. A grammar that produces more than one parse tree for some sentence is called as

______________________________.

8. Lexical analysis is about breaking a sequence of characters into ___________________________.

9. ___________________________ is considered as a sequence of characters in a token.



10. When expression result=3+2*8 is tokenized then identify the token category of each token in
expression?
Ans. _____________________________________________________________

1
Part II – Give brief answers for the following questions.

1. List the various phases of a compiler?

2. What is a Symbol Table?

3. Mention some of the cousins of a compiler.

4. List the phases that constitute the Front-end and Back-end Phases of a compiler.

5. List the various compiler construction tools.

6. Differentiate Tokens, Patterns, Lexeme.

7. List the operations on languages.

8. Write a Regular Expression for an Identifier.

9. Describe the languages denoted by the following regular expressions: a(a|b)*a

10. Mention the various notational short hands for representing Regular Expressions.

11. List the various Error Recovery strategies for a Lexical Analysis.

12. Define a Context Free Grammar.

13. Define Ambiguous Grammar.

14. What are the problems with Top-Down Parsing?

15. Given the grammar G:

G: S  aABf
A  bc|d
Be

Draw the parse tree for the input string adef using RDP.

You might also like