Hello everybody, I need your help for my C project.....

The details of the program is given below :----

1) The input of the program will be another C program, and that is from a file.....( Please note this carefully)

2) You have to check the syntax of the code , i.e , whether " ," ";" are placed properly or not.....

3) You have to check whether the variables are properly declared or not....

4) Have to check the functions.....

So, if anyone of you can help me out of this trouble , I will be very grateful to him/her............

Dear this is a forum. It is not a play-ground. First, one thing you must have to learn from your parents - "How to ask question?".

Use lex , yacc , bison, etc. it is not that difficult , give it a try.

Comments
Balance out the undeserved negatives.
Let's try and make it red, everyone join in!
You solved.
I thought it was a marvellous answer :)
how is this supposed to help?
This doesn't make sense at all

Use lex , yacc , bison, etc. it is not that difficult , give it a try.

Tell me how this advice will help the op solves his(her) problem, I'm curious...

Load the file into memory. Scan the file for 1 type of error, print errors to the screen and scan for another type of error. Continue the process for each type of error. Making a perfect one would be vary hard, but if you only need to check for a few specific errors, it would be easy. For example, assuming that there is a new line after each semicolon except for lines that start with "#" would be easer than trying to find when a line is suppost to end.

Good luck.

> Tell me how this advice will help the op solves his(her) problem, I'm curious...
The OP is basically looking for the front end of a C compiler.
This is far from being a trivial problem.

lex / yacc / bison are parser generator tools (perfect for this problem).

Comments
Thanks. ithelp
Thanx for correcting my FAIL

i think you can do this for the ; thing u do a list with stuff that doesnt have have ;(that is if it has more than 1 line) like for example for while if else if etc then after that if its not in the list chk the last char in line
if its ; or blank if its blank you just replace it with ; i think you can use strchr will help you for this and for other indetation

> Tell me how this advice will help the op solves his(her) problem, I'm curious...
The OP is basically looking for the front end of a C compiler.
This is far from being a trivial problem.

lex / yacc / bison are parser generator tools (perfect for this problem).

I completely misunderstood the question :confused:. So Ithelp: I apologize for the reply and neg-rep. Now if someone would please give ithelp some +rep to balance it out, I'd be grateful. :)

Comments
Let's see how grateful you are :P

Salem gave him (+) that far outweighed any (-) you and i gave.

I don't think anyone has ever gotten so may rep comments on one post :) The fact that the rep now is overall positive makes my slightly less ashamed of reply...

Comments
ya, he netted about +50 on a "let me google that for you". not too bad :P
This article has been dead for over six months. Start a new discussion instead.