PPS CBP
PPS CBP
Syntax Checker in C
Submitted to the
Department of Information Technology
BACHELOR OF TECHNOLOGY
IN
INFORMATION TECHNOLOGY
Submitted by
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.
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.
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.
The "Syntax Checker for For Loop in C" is a software tool designed to enhance the
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,
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
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
automating the verification process, this tool empowers developers to write more
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];
int i;
arr[i] = str[i];
if(strcmp(arr, "for") != 0)
return;
while(i != strlen(str))
char ch = str[i++];
if(ch == '(')
bracket1 ++;
4
else if(ch == ')')
bracket2 ++;
semicolon ++;
else continue;
if(semicolon != 2)
printf("\nSemicolon Error");
flag++;
flag++;
flag++;
5
else if(bracket1 != 1 || bracket2 != 1 || bracket1 != bracket2)
flag++;
if(flag == 0)
printf("\nNo error");
int main(void) {
char str1[100];
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