954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C program needed...URGENT !!!!!

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

shou2009
Newbie Poster
3 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

We only give homework help to those who show effort
Are these just empty words to you, or are you someone special deserving of free homework, where everyone else has to do it themselves?

Nor is it urgent (least not to anyone else)
http://www.catb.org/~esr/faqs/smart-questions.html#urgent

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

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

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

We only give homework help to those who show effort Are these just empty words to you, or are you someone special deserving of free homework, where everyone else has to do it themselves?

Nor is it urgent (least not to anyone else) http://www.catb.org/~esr/faqs/smart-questions.html#urgent

Ok, Ok, I am sorry..........
But, tell me one thing how can I prove that I my willingness ?

shou2009
Newbie Poster
3 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

Show us your code work.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

must not be too urgent.

you havent given us anything to review.

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 

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

ithelp
Nearly a Posting Maven
Banned
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
 
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...

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

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.

Hiroshe
Posting Whiz in Training
256 posts since Jun 2008
Reputation Points: 431
Solved Threads: 17
 

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

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

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

MrNoob
Posting Whiz in Training
218 posts since May 2009
Reputation Points: 34
Solved Threads: 7
 

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

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

i second that ^ :$

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

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 
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...

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You