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

Sample Entry: Khushboo TCS Female 9.4 CSE 600000 9999999999: Khuranak1@rknec - Edu

This document outlines a practical assignment on lexical analysis using the FLEX tool for a Compiler Design lab, including instructor-led, semi-instructor, and student evaluation practical exercises focusing on writing Lex specifications to analyze input files and text and identify tokens, counts, and other parameters such as student records. Students are asked to write a Lex program to parse a text file containing sample student records and output specific fields including names, numbers, counts and more.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Sample Entry: Khushboo TCS Female 9.4 CSE 600000 9999999999: Khuranak1@rknec - Edu

This document outlines a practical assignment on lexical analysis using the FLEX tool for a Compiler Design lab, including instructor-led, semi-instructor, and student evaluation practical exercises focusing on writing Lex specifications to analyze input files and text and identify tokens, counts, and other parameters such as student records. Students are asked to write a Lex program to parse a text file containing sample student records and output specific fields including names, numbers, counts and more.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Shri Ramdeobaba College of Engineering and Management, Nagpur

Department of Computer Science and Engineering


Session: 2020-2021

Compiler Design Lab

PRACTICAL No. 1

Topic: Lexical Analysis

Platform: Windows or Linux

Tool to be used: FLEX

CO Mapped:

CO1. Use Open Source tools to create a lexical analyzer and parser.

Aim:

Instructor Led Practical:


I1: Write a Lex specification to declare whether the entered word starts with a vowel or not.

I2: Write a Lex Specification to count the number of words, lines, small letters, capital letters,
digits and special characters in a given input file.

Semi-Instructor Practical:
S1: Design a lexical analyser to identify the tokens such as keywords, identifiers, operators,
symbols and strings for C language using Lex.

Student Evaluation Practical:


E1:
 Create a txt file to containing the following without heading: Name of Student, Company
Placed in (TCS, Infosys, Wipro, Accenture, Informatica), Male/female, CGPA (floating
point number), Department (CSE, IT, EC), Package (floating point number), mail id,
mobile number (integer exactly 10 digits). At least 25 records must be present.
Sample entry: Khushboo TCS Female 9.4 CSE 600000 [email protected] 9999999999

 Write a Lex program to find the parameters given below:


o Identify Name of student and display it.
o Identify CGPA and display (should be less than 10)
o Identify Package and display it
o Identify mail id and display
o Identify mobile number and display
o Find number of students placed in each of the company
o Number of female students
o Number of male students
o Number of CSE, IT and EC students who are placed

Sample Output:
Name of student: Khushboo
CGPA: 9.4
Package: 600000
Mail id: [email protected]
Mobile: 9999999999

Name of student: ----


CGPA: ----
Package: ----
Mail id: -----
Mobile: ----

Number of students placed in TCS:


Number of students placed in Infosys:
.
.
.So on
Number of female students:
Number of male students:
Number of CSE students:
Number of IT students:
Number of EC students:

You might also like