0% found this document useful (0 votes)
15 views

CD Lab List

List

Uploaded by

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

CD Lab List

List

Uploaded by

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

CD LAB PROGRAMS

UNIT I

1. Implement transition diagram for identifying an identifier and classify whether it is


variable, array, or function.

2. Implement transition diagram for identifying constant and classify whether it is integer or
real.

3. Write a LEX program to count number of characters, words, lines, and blanks in the given
input file.

4. Write a LEX program to recognize all the tokens in the given input file. Here the input file
is having source code.

UNIT II

5. Write a program which reads CFG and check for left recursion then display the CFG after
elimination of left recursion.

6. Write a program which reads CFG and if required apply the left factoring then display the
resulting CFG.

7. Write a program to implement Recursive Descent Parser for the given grammar.

UNIT III

8. Write a program to check given expression is valid or not using YACC for the following
grammar.

E -> E+E
E -> E-E
E -> E*E
E -> E/E
E -> E%E
E -> (E)
E -> number
E ->id
UNIT IV

9. Write a program to evaluate the given expression using LEX and YACC for the following
grammar.

E -> E+E
E -> E-E
E -> E*E
E -> E/E
E -> E%E
E -> (E)
E -> number
E -> id

10. Write a program to covert infix expression to postfix expression using LEX and YACC for
the following grammar.

E -> E+T | E-T | T


T -> T*F | T/F | F
F -> (E) | -F | id

11. Write a program to generate Quadruples (Three address code) for the given expression
using LEX and YACC for the following grammar.

E -> E+E
E -> E-E
E -> E*E
E -> E/E
E -> E%E
E -> (E)
E -> number
E -> id

UNIT V

12. Write a program to implement simple Code Generator for the given three address code.

You might also like