0% found this document useful (1 vote)
136 views13 pages

PPS CBP

C language cbp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
136 views13 pages

PPS CBP

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

A Course Based Project Report on

Syntax Checker in C
Submitted to the
Department of Information Technology

in partial fulfillment of the requirements for the completion of course


PROGRAMMING FOR PROBLEM SOLVING LABORATORY (22ES2CS101)

BACHELOR OF TECHNOLOGY

IN

INFORMATION TECHNOLOGY

Submitted by

CHERUKU ABHINAV 23071A12E2


CHINNAM ELIJAH 23071A12E3
C PRASHANTH 23071A12E4
PARIMALA 23071A12E5
SHARANYA 23071A12E6

Under the guidance of


Mrs. ANOOSHA
(Course Instructor)
Assistant Professor, Department of IT, VNRVJIET

DEPARTMENT OF INFORMATION TECHNOLOGY

VALLURUPALLI NAGESWARA RAO VIGNANA


JYOTHI INSTITUTE OF ENGINEERING &
TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBA
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet (S.O), Hyderabad – 500 090, TS,
India
DECEMBER 2023
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI
INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBA Accredited for CE, EEE, ME, ECE,
CSE, EIE, IT B. Tech Courses, Approved by AICTE, New Delhi, Affiliated to JNTUH, Recognized as
“College with Potential for Excellence” by UGC, ISO 9001:2015 Certified, QS I GUAGE Diamond Rated
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet(SO), Hyderabad-500090, TS, India

DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE

This is to certify that the project report entitled “Syntax checker in C” is a bonafide
work done under our supervision and is being submitted by Mr.Abhinav
cheruku(23071A12E2), Mr.Elijah Chinnam(23071A12E3), Mr.Prashanth kumar
(23071A12E4), Miss. Parimala (23071A12D5),Miss. Sharanya(23071A12E6) in
partial fulfilment for the award of the degree of Bachelor of Technology in
Information Technology, of the VNRVJIET, Hyderabad during the academic year
2023-2024.

Mrs.Anoosha Dr D Srinvasa Rao

Assistant Professor, IT Associate Professor & HOD, IT

Course based Projects Reviewer


VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI
INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade,
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet(SO), Hyderabad-500090, TS, India

DEPARTMENT OF INFORMATION TECHNOLOGY

DECLARATION

We declare that the course based project work entitled “Syntax checker in C”
submitted in the Department of Information Technology, Vallurupalli Nageswara
Rao Vignana Jyothi Institute of Engineering and Technology, Hyderabad, in partial
fulfilment of the requirement for the award of the degree of Bachelor of Technology
in Information Technology is a bonafide record of our own work carried out under
the supervision of Mrs Anoosha, Department of IT, VNRVJIET. Also, we
declare that the matter embodied in this thesis has not been submitted by us in full or
in any part thereof for the award of any degree/diploma of any other institution or
university previously.
Place: Hyderabad.

Ch.Abhinav Ch.Elijah Ch.Prashanth Ch.parimala

(23071A12E2) (23071A12E3) (23071A12E4) (23071A12E5


)

D.Sharanya

(23071A12E6)
ACKNOWLEDGEMENT

We express our deep sense of gratitude to our beloved President, Sri. D. Suresh Babu,
VNR Vignana Jyothi Institute of Engineering & Technology for the valuable
guidance and for permitting us to carry out this project.

With immense pleasure, we record our deep sense of gratitude to our beloved
Principal, Dr. C.D Naidu, for permitting us to carry out this project.

We express our deep sense of gratitude to our beloved Professor Dr. SRINIVASA
RAO DAMMAVALAM, Associate Professor and Head, Department of Information
Technology, VNR Vignana Jyothi Institute of Engineering & Technology,
Hyderabad-500090 for the valuable guidance and suggestions, keen interest and
through encouragement extended throughout the period of project work.

We take immense pleasure to express our deep sense of gratitude to our beloved
Guide, Mrs Anoosha, Assistant Professor in Information Technology, VNR Vignana
Jyothi Institute of Engineering & Technology, Hyderabad, for his/her valuable
suggestions and rare insights, for constant source of encouragement and inspiration
throughout my project work.

We express our thanks to all those who contributed for the successful completion of
our project work.

Mr. Ch.Abhinav (23071A12E2)


Mr. Ch.Elijah (23071A12E3)
Mr. C.Prashanth kumar (23071A12E4)
Miss.Ch.parimala (23071A12E5)
Miss.D.Sharanya (23071A12E6)
ABSTRACT

The "Syntax Checker for For Loop in C" is a software tool designed to enhance the

programming experience by providing a reliable mechanism for verifying the

correctness of for loops in C programming language. This tool aims to assist

developers in identifying and rectifying syntax errors related to for loops, thereby

improving code quality and reducing debugging time. Through a systematic analysis

of C code, the syntax checker ensures adherence to the proper structure of for loops,

promoting code reliability and maintainability.

1
TABLE OF CONTENTS

S No Contents Page No

1. INTRODUCTION 3

2. SOURCE CODE 4

3. INPUT CASE/OUTPUT 7

4. CONCLUSION 8

5. REFERENCES 9

2
INTRODUCTION
1.1 PROBLEM DEFINITION

C programming language stands as a cornerstone in software development, and for

loops are fundamental constructs frequently used by developers to iterate over a range

of values. However, syntactical errors in for loops can lead to unexpected behavior,

runtime issues, and hinder the overall functionality of the program. The "Syntax

Checker for For Loop in C" addresses this concern by offering a dedicated tool that

thoroughly examines C code to ensure the accurate implementation of for loops. By

automating the verification process, this tool empowers developers to write more

robust and error-free code.

1.2OBJECTIVE

The primary objective of this project is to develop a specialized syntax checker that
focuses on the for loop structure in C programming. The tool aims to:

Detect Syntax Errors: Identify and flag syntactical errors within for loops, including
issues related to loop initialization, condition, and iteration expressions.

Provide Feedback: Offer clear and actionable feedback to developers, guiding them
on correcting syntax errors and ensuring compliance with C language standards.

3
2. SOURCE CODE
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

char arr[3];

void isCorrect(char *str)

int semicolon = 0, bracket1 = 0, bracket2 = 0, flag = 0;

int i;

for (i = 0; i < 3; i++)

arr[i] = str[i];

if(strcmp(arr, "for") != 0)

printf("Error in for keyword usage");

return;

while(i != strlen(str))

char ch = str[i++];

if(ch == '(')

bracket1 ++;

4
else if(ch == ')')

bracket2 ++;

else if(ch == ';')

semicolon ++;

else continue;

if(semicolon != 2)

printf("\nSemicolon Error");

flag++;

else if(str[strlen(str) - 1] != ')')

printf("\nClosing parenthesis absent at end");

flag++;

else if(str[3] == ' ' && str[4] != '(' )

printf("\nOpening parenthesis absent after for keyword");

flag++;

5
else if(bracket1 != 1 || bracket2 != 1 || bracket1 != bracket2)

printf("\nParentheses Count Error");

flag++;

if(flag == 0)

printf("\nNo error");

int main(void) {

char str1[100];

printf("Enter Test case: \n");

gets(str1);

isCorrect(str1);

return 0;

6
3. TEST CASES/ OUTPUT
3.1 Test case 1:

3.2Test case 2:

3.3Test case 3:

3.4Test case 4:

7
CONCLUSION
In conclusion, the "Syntax Checker for For Loop in C" emerges as a valuable tool in the
realm of C programming, addressing a crucial aspect of code quality and reliability. By
focusing on the intricate details of for loop syntax, this tool aids developers in crafting robust
and error-free code, ultimately contributing to the efficiency and effectiveness of the software
development process.

8
REFERENCES
www.w3schools.com

www.programiz.com

www.geeksforgeeks.com

You might also like