Sie sind auf Seite 1von 3

Lovely Professional University, Punjab

Course Code CSE419 Course Category Course Title COMPILER DESIGN PRACTICAL NA Course Planner 16806::Kundan Munjal Lectures 0.0 Tutorials Practicals Credits 0.0 2.0 1.0

TextBooks Sr No T-1 Title Author Edition Year 2007 Publisher Name Pearson Compilers Principles, Techniques and Alfred V.Aho, Monica 2nd Tools S.Lam, Ravi Sethi, Jeffrey D.Ullman Reference Books Sr No R-1 R-2 Title Lex & Yacc Compiler Design using Flex and YACC Author Levine,Mason and Brown Vinu V. Das Edition 1st 1st Year 1998 2005 Publisher Name OREILLY PHI (Pretice Hall India)

Relevant Websites Sr No RW-1 RW-2 RW-3 RW-4 RW-5 RW-6 (Web address) (only if relevant to the course) http://www.cs.rug.nl/~jjan/vb/lextut.pdf http://www.cs.washington.edu/education/courses/csep501/08wi/lectures/slides/Fllparsing. pdf http://nptel.iitm.ac.in/courses/106108052/ http://csvls.blogspot.in/2010/07/compiler-design-video-lectures10-videos.html Salient Features Lex and Yacc tutorial Recursive Descent Parsing Video Lecture Video Lecture

http://www.cs.washington.edu/education/courses/csep501/08wi/lectures/slides/Cgramm Parsing Techniques ars. pdf http://www.cs.washington.edu/education/courses/csep501/08wi/lectures/slides/GIRs. pdf Intermediate Code Generation

Scheme for CA:


Component Lab Evaluation Frequency 8 Out Of 10 Total :Each Marks Total Marks 10 10 80 80

*Each experiment of the lab will be evaluated using following relative scheme:
Component Performance % of Marks 100

Detailed Plan For Practicals


Practical No Practical 1 Broad topic (Subtopic) Lexical Analyzer(Dividing the given input program into lexemes) Practical Description Program using the lex or Flex tool that allows one to specify a lexical analyzer by specifying regular expressions to describe pattern for tokens Program using the lex tool to Implement Symbol table for insertion and searching of tokens in it Program for the identification of tokens like identifiers, Numbers and comments and many other tokens for C/ C++ Learning Outcomes Student will be able to write and execute the lex program Equipment Used C/C++/Flex

Practical 2

Lexical Analyzer(Generate and populate a symbol table)

Student will be able to implement symbol table so that they can add tokens and also search and access existing tokens in the symbol table

C/C++/Flex

Practical 3

Lexical Analyzer(Lex specifications for tokens such as, identifiers, numbers, comments in C/C++, etc.)

Student will be able to clear with Lex C/C++/Flex tool after complete identification of different types of tokens for a particular language. C/C++/Flex C/C++/Flex

Practical 4 Practical 5

Lex Programming(LEX specification for Program for LEX specification for tokens Students will learn LEX specification tokens of the small languag) of the small language for tokens of the small language Yacc Programming(Parser for function definition) A Simple program of yacc for different production grammars to check the acceptance and rejection of input strings Student will be able to understand the yacc tool as well as structure and compilation of yacc programs

Practical 6

Yacc Programming(Desk calculator with Program using Yacc to implement the error recovery) desk calculator MTP to be conducted in the 7th lab

Student will clearly understand Yacc C/C++/Flex tool by applying different rules for implementing desk calculator program Student will clearly understand Yacc C/C++/Flex tool by applying different rules for implementing desk calculator program Students will learn the Simple specifications for desk calculator C/C++/Flex

Practical 7

Yacc Programming(Desk calculator with Program using Yacc to implement the error recovery) desk calculator MTP to be conducted in the 7th lab

Practical 8

Yacc Programming(Simple Specification writing for desk calculator specifications for desk calculator, variable and variable declaration in c declarations in C)

Practical 9

Syntax Analysis(Recursive-descent parsing)

Program for implementation of recursive descent parsing that result into acceptance and rejection of the input string with the help of production grammars.

Student will be able to implement C/C++/Flex recursive descent parsing for production grammars that results into acceptance and rejection of input string.

Practical 10

Syntax Analysis(Implement shift-reduce parsing algorithm)

Program for implementation of shift reduce parsing using stack that results into acceptance and rejection of the input string with help of production grammars

Student will be able to implement shift C/C++/Flex reduce parsing for production grammars that results into acceptance and rejection of input string Student will be able to understand the C/C++/flex rules for computing the first and follow that are basically used in predictive and LALR parsing techniques Students will be able to understand the significance of using Synthesized attributes C/C++/flex

Practical 11

Syntax Analysis(Compute first and follow Program for implementing the rules to of non terminals) compute first and follow for different production grammars Syntax-Directed Translation(S-Attributed Program to Implement the use of specification) Synthesized attribute Intermediate Code-Generation(Three address code generation of array, control statements, backpatching)

Practical 12

Practical 13

Program to generate the intermediate Students will be able to understand the C/C++/Flex code by defining different semantic rules intermediate code generation for arrays w.r.t to three address code of arrays, , control statements and also able to control statements and also it includes define the semantic rules backpatching

Practical 14

Intermediate Code-Generation (Intermediate code generation for the constructs of the small language)

A program for intermediate code generation for the constructs of the small language MTP to be conducted in the 2nd hour of 14th lab

Students will be able to understand the C/C++/Flex intermediate code generation for arrays , control statements and also able to define the semantic rules

SPILL OVER
Practical 15 Spill Over

Das könnte Ihnen auch gefallen