Вы находитесь на странице: 1из 10

MERI COLLEGE OF ENGGINEERING AND TECHNOLOGY,

SAMPLA

Compiler Design Lab


Lab Manual

Index
S. no. Contents
1

Syllabus as per M. D. University

Hardware and Software requirements

Rationale behind CD LAB

List of Programs

Lab Plan

List of Projects

Project plan

Project allocation table

Practical details:
Algorithm
Program code
Output

Syllabus as per M. D. University


Session: 2013-2014
B.TECH (CSE) SEMESTER VII
Subject: COMPILER DESIGN LAB
Subject Code: CSE-407 E

1 .Practice of Lex/Yacc of Compiler writing.


2. Write a program to check whether a string belongs to the grammar
or not.
3. Write a program to generate a parse tree.
4. Write a program to find leading terminals.
5. Write a program to find trailing terminals.
6. Write a program to compute FIRST of non-terminals.
7. Write a program to compute FOLLOW of non-terminals.
8. Write a program to check whether a grammar is left recursive and
remove
left recursion.
9. Write a program to remove left factoring.
10. Write a program to check whether a grammar is Operator
precedent.
11. To show all the operations of a stack.
12. To show various operations i.e read,write and modify in a text
file.

Note :
At least 10 programs are required to be developed in the semester.

Hardware and software


requirements
Hardware Requirements:
Processsor: Pentium I
RAM:
128MB
Hard Disk
40 GB
Floppy Drive 1.44MB
Software Requirements:
Lex and Yacc tools.(A Linux Utility)
Language:
C/C++
System Configuration on which lab is conducted
Processor:
RAM
HDD
FDD
Monitor
Keyboard
Operating System
Mouse

PIV(1.8Ghz)
256MB
40GB
1.44MB
14''Color
Multimedia
Windows XP
Scroll

Rationale behind CD
LAB

Compiler is a System Software that converts High level language to low level
lang. We human beings can't program in machine lang (low level lang.) understood
by Computers so we prog. In high level lang and compiler is the software which
bridges the gab between user and computer.
It's a very complicated piece of software which took 18 man years to build first
compiler To build this S/w it is divided into six phases which are
1)
2)
3)
4)
5)
6)

Lexical Analysis
Syntax Analysis
Semantic Analysis
Intermediate Code Generation
Code Optimization
Code Generation.

Subject: COMPILER DESIGN LAB


Subject Code: CSE-407 E
Section A
Session : 2013-14
of Labs : 14

Total No

List of Programs to be executed in lab


S. No.

Programs List

STUDY OF LEX & YACC TOOLS

PROGRAM TO CHECK WHEATHER A STRING BELONGS TO A GRAMMAR OR


NOT.

PROGRAM IS TO CALCULATE LEADING FOR ALL THE NON-TERMINALS OF


THE GIVEN GRAMMAR

PROGRAM IS TO CALCULATE TRAILING FOR ALL THE NON-TERMINALS OF


THE GIVEN GRAMMMAR

PROGRAM FOR COMPUTATION OF FIRST

PROGRAM TO FIND THE NUMBER OF WHITESPACES AND NEWLINES


CHARACTERS

TO IMPLEMENT STACK USING ARRAY

TO IMPLEMENT STACK AS LINKED LIST

ALGORITHM TO IDENTIFY WHETHER A GIVEN STRING IS AN IDENTIFIER OR


NOT

10

THIS PROGRAM IS TO FIND OUT WHETHER A GIVEN STRING IS A


IDENTIFIER OR NOT

11

ALGORITHM TO CHECK WHETHER A STRING IS A KEYWORD OR NOT

12

PROGRAM TO FIND WHETHER STRING IS A KEYWORD OR NOT

13

ALGORITHM TO FIND WHETHER A STRING IS A CONSTANT OR NOT

14

PROGRAM TO FIND WHETHER THE STRING IS CONSTANT OR NOT

Subject: COMPILER DESIGN LAB


Subject Code: CSE-407 E
Section B

List of Projects to be developed in Lab


1. To develop basic compiler for arithmetic expressions in C language.
2. To develop basic compiler for logical expressions in C language.
3. To develop basic compiler for arithmetic expressions in C++ language.
4. To develop basic compiler for logical expressions in C++ language.
5. To develop basic compiler for logical expressions in JAVA language.
6. To develop basic compiler for arithmetic expressions in JAVA language.
7. To develop basic shell script interpreter for shell scripting.
8. To develop basic compiler for case statements in C++ language.
9. To develop basic compiler for case statements in C language.
10.

To develop basic compiler for case statements in Java language.

Subject: COMPILER DESIGN LAB


Subject Code: CSE-407 E

PROJECT PLAN
Project work will pass through given stages:
Stages
Project design as a
whole
Modular design
Algorithm
Coding
Error Removal/Handling
Testing
Submission

Project Plan
August Fourth Week
September First Week
September Second Week
September Third Week October
Second Week
October Third Week
October Fourth Week
November First Week

Subject: COMPILER DESIGN LAB


Subject Code: CSE-407 E
Section - C

Project Allocation Table

Project
No.

Student Roll-No

1
2
3
4
5
6
7
8
9
10

1-4
5-8
9-12
13-16
17-20
21-24
25-28
29-32
33-36
37 last rollno

Вам также может понравиться