Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lab Manual: Shri S'ad Vidya Mandal Institute of Technology

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Enrollment No :- 160450107010 2019

Shri S’ad Vidya Mandal Institute of Technology


Department of Computer Engineering and Information Technology
Academic Year: 2019-20 (Odd Semester)

(B.E. Final Year – Sem - VII)


Branch : Computer Engineering

LAB MANUAL
COMPILER DESIGN (2170701)

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
21
22

S. V. M. I. T., Bharuch| Branch – Computer Engineering 1


Enrollment No :- 160450107010 2019

23 [REFERENCE BOOK:- Aho, Lam, Sethi, and Ullman, “Compilers: Principles, Techniques and Tools”
Shri S’ad Vidya Mandal Institute of Technology
Department of Computer Science Engineering and Information Technology

(B.E. Final Year – Sem – VII) Branch : Computer Engineering


SUBJECT :- COMPILER DESIGN (2170701)

NAME:- ___________________________________________________________________________

ENROLLMENT NO: ________________________________________________________________

INDEX
SR.
PRACTICAL TITLE DATE SIGN
NO.
1A. Design a lexical analyzer for given language and the lexical
analyzer should ignore redundant spaces, tabs and new lines.
It should also ignore comments. Although the syntax
specification states that identifiers can be arbitrarily long, you
may restrict the length to some reasonable value.
1B. Design a lexical analyzer for given language in C language.
2A. Write a LEX program to identify whether a given line is a
comment or not
2B. Write a C program to identify whether a given line is a
comment or not
3A. Write a LEX program to test whether a given identifier is valid
or not.
3B. Write a C program to test whether a given identifier is valid or
not.
4A. Write a LEX program to simulate lexical analyzer for
validating operators
4B. Write a C program to simulate lexical analyzer for validating
operators
5. To Study about Lexical Analyzer Generator (LEX) and Flex
(Fast Lexical Analyzer).
6. Implement following programs using Lex.
S. V. M. I. T., Bharuch| Branch – Computer Engineering 2
Enrollment No :- 160450107010 2019

a. Create a Lexer to take input from text file and count no of


characters, no. of lines & no. of words.
b. Write a Lex program to count number of vowels and
consonants in a given input string.
7. Implement following programs using Lex.
a. Write a Lex program to print out all numbers from the given
file.
b. Write a Lex program to printout all HTML tags in file.
c. Write a Lex program which adds line numbers to the given
file and display the same onto the standard output.
8. Write a Lex program to count the number of comment lines in
a given C program. Also eliminate them and copy that
program into separate file.
9. Write a C program for implementing the functionalities of
predictive parser for the mini language.
10. Write a C program for constructing of LL (1) parsing.
11. Write a C program for constructing recursive descent parsing
12. Write a C program to implement LALR parsing.
13. Write a C program to implement operator precedence parsing.
14. To Study about Yet Another Compiler-Compiler(YACC).
15. Create Yacc and Lex specification files to recognizes arithmetic
expressions involving +, -, * and / .
16. Create Yacc and Lex specification files are used to generate a
calculator which accepts, integer and float type arguments.

S. V. M. I. T., Bharuch| Branch – Computer Engineering 3


Enrollment No :- 160450107010 2019

Shri S’ad Vidya Mandal Institute of Technology


Department of Computer Science Engineering and Information Technology

CERTIFICATE
This is to certify that this manual contains practical work performed by

Mr. / Miss ____________________________________ of B.E. – COMPUTER

ENGINEERING studying in 7th Semester - FINAL YEAR having Enrollment

No. ________________________ has satisfactorily completed his/her practical

work in the subject of COMPILER DESIGN (2171701) for the term ending in

OCTOBER 2019-20.

DATE :- ______________

Signature of Subject Faculty Signature of Head of Department

_________________________ _____________________________

________________

(Institute/ Department Seal)

S. V. M. I. T., Bharuch| Branch – Computer Engineering 4

You might also like