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............

Recommended Answers

All 13 Replies

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?".

Show us your code work.

commented: Yes, that would be a good first step :) +17

must not be too urgent.

you havent given us anything to review.

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

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

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).

commented: Thanx for correcting my FAIL +23
commented: Thanks. ithelp +10

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. :)

commented: Let's see how grateful you are :P +18

i second that ^ :$

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

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...

commented: ya, he netted about +50 on a "let me google that for you". not too bad :P +14
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.