0% found this document useful (0 votes)
116 views4 pages

Compiler Design Project

The document is a project report submitted by three students, Bhaskar Yadav, Shikha Singh, and Shishir Singh, for their Bachelor of Technology degree in Computer Science and Engineering. It includes an acknowledgment thanking those who provided guidance and support for the project, and details an experiment on writing a C program to test whether a given identifier is valid or not by checking the initial character and subsequent characters. The report describes the objective, resources, program logic, and procedure for the experiment along with providing the C++ program code and an example of its input and output.

Uploaded by

SHIVAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views4 pages

Compiler Design Project

The document is a project report submitted by three students, Bhaskar Yadav, Shikha Singh, and Shishir Singh, for their Bachelor of Technology degree in Computer Science and Engineering. It includes an acknowledgment thanking those who provided guidance and support for the project, and details an experiment on writing a C program to test whether a given identifier is valid or not by checking the initial character and subsequent characters. The report describes the objective, resources, program logic, and procedure for the experiment along with providing the C++ program code and an example of its input and output.

Uploaded by

SHIVAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PROJECT REPORT

OF
“Compiler Design”

Submitted in partial fulfillment of the requirements for the award degree


of

Bachelor of Technology
In

Computer Science and Engineering

Bundelkhand Institute of Engineering and Technology, Jhansi (U.P)


(BIET Jhansi)
ACADEMIC SESSION 2023-24

Submitted by
Bhaskar Yadav (2100430100012)
Shikha Singh (2200430109004)
Shishir Singh (2100430100047)

Under the guidance of


Prof. Sanjai Kumar Gupta
ACKNOWLEDGEMENT

We are indebted to our respected Head of the Department Dr. Yashpal Singh for guiding us.

The team is also grateful to our project guide Prof. Sanjai Kumar Gupta, for their

invaluable guidance for this project. We also thank our respected faculty members of the

Computer Science and Engineering department for their indomitable contribution and

guidance without which this project would have been impossible to complete.Our sincerest

thanks to all the teachers, seniors and colleagues whose help and guidance brought this project

to successful completion.

Submitted by:

Bhaskar Yadav (2100430100012)


Shikha Singh (2200430109004)
Shishir Singh (2100430100047)
EXPERIMENT
OBJECTIVE:

Write a C program to test whether a given identifier is valid or not

RESOURCE:

C++

PROGRAM LOGIC:

Read the given input string.


Check the initial character of the string is numerical or any special character except ‘_’ then
print it is not a valid identifier.
Otherwise print it as valid identifier if remaining characters of string doesn't contains any
special characters except ‘_’

PROCEDURE:

Go to run or press Ctrl+Atl+N run the program.

PROGRAM:
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<iostream>
using namespace std;
int main()
{
char a[10];
int flag,i=1;
cout<<"\n Enter an Identifier:";
gets(a);
if(isalpha(a[0]))
{
flag=1;
}
else
{
cout<<"\n Not A valid identifier:";
}
while (a[i]!='\0')
{
if(!isdigit(a[i]) && !isalpha(a[i]))
{
flag=0;
break;
}
i++;
}
if(flag==1)
{
cout<<"\nValid Identifier";
}
return 0;
}

INPUT & OUTPUT:

You might also like