0% found this document useful (0 votes)
6 views19 pages

CD Solution

The document contains a series of assignments focused on language processing, compilers, and lexical analysis, covering topics such as the phases of a compiler, the differences between compilers and interpreters, and the construction of deterministic finite automata. It also includes questions on syntax analysis, context-free grammar, and parsing techniques. The assignments require explanations, diagrams, and examples related to the theoretical aspects of programming languages and compilers.

Uploaded by

heetkalariya404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views19 pages

CD Solution

The document contains a series of assignments focused on language processing, compilers, and lexical analysis, covering topics such as the phases of a compiler, the differences between compilers and interpreters, and the construction of deterministic finite automata. It also includes questions on syntax analysis, context-free grammar, and parsing techniques. The assignments require explanations, diagrams, and examples related to the theoretical aspects of programming languages and compilers.

Uploaded by

heetkalariya404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Assignment : 1

1. What is language processing?

2. Explain application, PL and Execution domain.

3. Differentiate compilers and interpreters.

4. Explain analysis of source program for compilers.


5.

Explain the phase of compiler with an example.

6. Explain lexical analysis phase of a


compiler and for a statement given
below, write output of all phases of compiler. Assumes a, b and c of Type
float a = a + b*c*2;
7. Explain lexical analysis phase of a compiler and for a statement given
Below, write output of all phases of compiler. Assumes P, Q and R of Type
float P= Q + R * 3.
8. List the cousins of compiler and explain the role of any two of them.
9. Define types of compiler.
10. Explain intermediate code generation.

Assignment : 2
1. Define Lexemes, patterns and tokens.

2. Draw transition diagram for relational operators.


3. Write the two methods used in lexical analyzer for buffering the input.
Which technique is used for speeding up the lexical analyzer?

4. Write a short note on LEX Tool.


4. Draw Deterministic Finite Automata for the binary string ending with 10.
5. Construct DFA for following Regular expression. Use firstpos, Lastpos and
followpos function to construct DFA.(a*|b*)*

8. Draw syntax tree and DAG for the statement a= (a * b + c) ^(b + c)*b + c
9. Draw deterministic finite automata for: 1) (0 + 1)*101 (0+1)*
2) 10(0+1)*1
10. Construct a DFA for given regular expression (010+00)*(10)*.

Assignment : 3
1. Explain Syntax Analyser and CFG?
2. Difference between Top Down Parser and Bottom Up Parser?

3. Construct leftmost and rightmost derivation for the sentence abab


S→aSbS|bSaS|€.
4. Define following terms: Augmented Grammer, LR (0), and LR (1)?
5. Describe Ambiguous Grammer with example?

6. What are conflicts in LR Parser? What are their types? Explain with an
example?

7. What is left factoring


in CFG? Perform the
Left factoring of
following Grammar. S
→ iEtS / iEtSaS / a E →
b
8. Differentiate ambiguous and unambiguous grammar?
9. What is ambiguous grammar? Show that S ->aS|Sa|aia an ambiguous
grammar

10. Define: Left Recursive Grammar. Check Following grammar is left


recursive or not, if yes, remove left recursive from it. A → ABd / Aa / a B →
Be / b?
11. Explain shift reduce parsing technique in brief?

You might also like