Compiler Lab ip

  • Upload
    savi

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • 8/15/2019 Compiler Lab ip

    1/4

    Lovely Professional University, Punjab

    Course Code Course Title Course Planner Lectures Tutorials Practicals Credits

    CSE419 COMPILER DESIGN LABORATORY 14623::Pushpendra Kumar Pateriya 0 0 2 1

    Course Weightage ATT: 5 CAP: 40 ETP: 55 Exam Category: X6: Mid Term Exam: Not Applicable – End Term Exam:Practical

    Course Orientation KNOWLEDGE ENHANCEMENT, SKILL ENHANCEMENT, SOFTWARE SKILL

    Reference Books ( R )

    Sr No Title Author Edition Year Publisher Name

    R-1 LEX & YACC JOHN R. LEVINE, TONYMASON, DOUG BROWN

    2nd 1992 O'REILLY

    R-2 COMPILERS PRINCIPLES,TECHNIQUES AND TOOLS

    ALFRED V. AHO,JEFFREY D. ULLMAN,MONICA S LAM, RSETHI

    2nd 2007 PEARSON

    R-3 COMPILER DESIGN IN C ALLEN I. HOLUB 1st 1994 PEARSON

    Other Reading ( OR )

    Sr No Journals articles as Compulsary reading (specific articles, complete reference)

    OR-1 Programming examples in C: ht tp: //mason.gmu.edu/~white/C/ ,

    Relevant Websites ( RW )

    Sr No (Web address) (only if relevant to the course) Salient Features

    RW-1 http://www.cs .bilkent.edu.tr/~guvenir/courses/CS315/lex-yacc/linux.html Running lex and yacc on Linux systems

    RW-2 http://alumni.cs.ucr.edu/~lgao/teaching/bison.html Bison Tutorial

    RW-3 http://epaperpress.com/lexandyacc/index.html Lex & Yacc Tutorial

    RW-4 https://www.cs.princeton.edu/~appel/modern/c/software/flex/flex.html Flex version 2.5

    Audio Visual Aids ( AV )

    Sr No (AV aids) (only if relevant to the course) Salient Features

    AV-1 http://nptel.ac.in/courses/106104123/ Compiler Design video lectures by IIT Kanpur

    AV-2 http://nptel.ac.in/courses/106108052/ Compiler Design video lectures by IISc Banglore

    Software/Equipments/Databases

    Sr No (S/E/D) (only if relevant to the course) Salient FeaturesSW-1 http: //www.cs.arizona.edu/~debray/Teaching/CSc453/DOCS/tutorial- large.pdf Lex and Yacc: A Brisk Tutorial

    An instruction plan is a tentative plan only and a teacher may make some changes in his/her teaching plan. The students are advised to use syllabus for preparation of all examinations. The students are expected to keep themselvesupdated on the contemporary issues related to the course. Upto 20% of the questions in any examination/Academic tasks can be asked from such issues even if not explicitly mentioned in the instruction plan.

  • 8/15/2019 Compiler Lab ip

    2/4

    SW-2 https:/ /www.cs.princeton.edu/~appel/modern/c/software/bison/bison_toc.html Bison The YACC-compatible Parser Generator

    SW-3 https://www.l2f.inesc-id.pt/~david/w/pt/The_YACC_Parser_Generator/Example:_Calculator_with_Variables

    The YACC Parser Generator/Example: Calculator with Variables

    Scheme for CA:

    Component Frequency Out Of Each Marks Total Marks

    Practical 3 4 10 30

    Total :- 10 30

    Details of Academic Task(s)

    AT No. Objective Topic of the Academic Task Nature of Academic Task(group/individuals/field

    work

    Evaluation Mode Allottment /submission Week

    Practical1 To check thetheoratical andpractical subjectundestanding ofstudents.

    Syllabus will covered up to 2nd practical. Individual Studentperformance in vivaand execution.Assign 50-50 Marksfor Viva andExecution.

    2 / 3

    Practical2 To check thetheoratical andpractical subjectundestanding ofstudents.

    Syllabus will be covered up to 5th practical. Individual Studentperformance in vivaand execution.Assign 50-50 Marksfor Viva andExecution.

    5 / 6

    Practical3 To check thetheoratical andpractical subjectundestanding ofstudents.

    The syllabus will be covered up to 8th practical. Individual Studentperformance in vivaand execution.Assign 50-50 Marksfor Viva andExecution.

    8 / 9

    Practical4 To check thetheoratical andpractical subjectundestanding ofstudents.

    Syllabus will be covered up to 11th practical. Individual Studentperformance in vivaand execution.Assign 50-50 Marksfor Viva andExecution.

    11 / 12

    *Each experiment of the lab will be evaluated using following relative scheme:

    An instruction plan is a tentative plan only and a teacher may make some changes in his/her teaching plan. The students are advised to use syllabus for preparation of all examinations. The students are expected to keep themselvesupdated on the contemporary issues related to the course. Upto 20% of the questions in any examination/Academic tasks can be asked from such issues even if not explicitly mentioned in the instruction plan.

  • 8/15/2019 Compiler Lab ip

    3/4

    Detailed Plan For Practicals

    Practical No Broad topic (Subtopic) Practical Description Learning Outcomes Equipment Used

    Practical 1 Introduction to compiler design(Keyword identification in a C/C++program)

    Write a program in C/C++ to identifykeywords in a C/C++ program. he students will learn to identify andount the number of keywords in a C/C++rogram using C/C++ language.

    C compiler and text editor.

    Practical 2 Introduction to compiler design(Operator identification in a C/C++program)

    Write a program in C/C++ to count thenumber of operators in a C/C++ program.

    he students will learn to identify andount the operators available in a C/C++rogram.

    C compiler and text editor.

    Practical 3 Introduction to compiler design(Program execution time calculation)

    Write a program in C/C++ language to findout the execution time of your ownprogram. Practical Evaluation 1 will betaken.

    he students will learn to calculate therogram execution time in C/C++

    language.

    C compiler and text editor.

    Practical 4 Lexical Analyzer(Introduction to LEX) In this practical the description andinstallation of LEX will be covered.

    he students will got to know about the usf flex and its installation steps.

    Flex, Windows/Linux Platform

    Lexical Analyzer(Installation of flex) In this practical the description andinstallation of LEX will be covered.

    he students will get to know about theuse of flex and its installation steps.

    Flex, Windows/Linux Platform

    Practical 5 Programming with LEX(LEX Programto count number of vowels andconsonants in a file)

    Write a program in LEX to count thenumber of vowels and consonants present ina file.

    he students will learn the use of flex. GCC, Flex, Bison, Linux

    Practical 6 Programming with LEX(LEX Programto count number of blank spaces,characters, lines, words from giveninput)

    Write a program to count number of blankspaces, characters, lines, words from giveninput.

    he students will learn the basics of flex. flex, bison, Linux

    Practical 7 Syntax Analyzer(Introduction toYACC)

    In this practical the description andinstallation of Bison will be covered.

    he students will get to the use of YACCnd its installation steps.

    Bison/BYACC, Linux platform

    Syntax Analyzer(Installation ofbison/byacc)

    In this practical the description andinstallation of Bison will be covered.

    he students will get to the use of YACCnd its installation steps.

    Bison/BYACC, Linux platform

    Practical 8 Syntax Analyzer(Computing FIRST ofNon terminals in C)

    Write a program to to calculate the FIRSTof non terminals of a given grammar.Practical Evaluation 2 will be taken.

    tudents will learn how to calculateFIRST of non terminals of a given

    rammar using C language.

    Lex, Bison, GCC, text editor

    Practical 9 Syntax Analyzer(Computing FOLLOWof Non terminals in C)

    Write a program to compute the FOLLOWof Non terminals of a given grammar usingC language.

    he students will learn about YACC andits use to create desk calculator.

    LEX, YACC, Linux platform

    Practical 10 Programming with YACC(Deskcalculator with error recovery)

    Write a program for desk calculator witherror recovery using YACC. Practicalevaluation 3 will be taken in 9th Lab.

    he students will learn about YACC andits use to create desk calculator.

    LEX, YACC, Linux platform

    Practical 11 Programming with YACC(Simplespecifications for desk calculator)

    Write a program for simple specification ofdesk calculator.

    he students will learn about the deskalculator in YACC.

    Bison, Flex, Linux Platform

    Component % of Marks

    Performance/Jobevaluation/conduct/execution/demonstration

    50

    Viva 50

    An instruction plan is a tentative plan only and a teacher may make some changes in his/her teaching plan. The students are advised to use syllabus for preparation of all examinations. The students are expected to keep themselvesupdated on the contemporary issues related to the course. Upto 20% of the questions in any examination/Academic tasks can be asked from such issues even if not explicitly mentioned in the instruction plan.

  • 8/15/2019 Compiler Lab ip

    4/4

    Practical 12 Programming with YACC(Variabledeclarations in C)

    Write a program for defining tokens andvalues in flex/bison. Practical evaluation 4will be taken.

    he students will learn specification oftokens in flex/bison.

    Lex, Bison, Linux platform

    Practical 13 Symbol table generation(Symbol tablegeneration in C)

    Write a program in C to generate symboltable for an input C program.

    he students will learn the basic structuref symbol table and its generation and its

    updation.

    C compiler, a text editor, LinuxPlatform

    Practical 14 Symbol table generation(Symbol tablegeneration in C)

    Write a program in C to generate symboltable for an input C program.

    he students will learn the basic structuref symbol table and its generation and its

    updation.

    C compiler, a text editor, LinuxPlatform

    SPILL OVERPractical 15 Spill Over

    An instruction plan is a tentative plan only and a teacher may make some changes in his/her teaching plan. The students are advised to use syllabus for preparation of all examinations. The students are expected to keep themselvesupdated on the contemporary issues related to the course. Upto 20% of the questions in any examination/Academic tasks can be asked from such issues even if not explicitly mentioned in the instruction plan.