Hi...I have to bulit code for a parser in c++ which takes a simple txt file in which there are two functions 1 is for addtion of two numbers and 2nd is for printing of result. Parser have to open the file read it line by line and then tell on which line there is an error...like if semicolon is missing at line 6 then it shoud tell that
; missing at L6
Please someone help me on this..thanks in advance

Recommended Answers

All 2 Replies

sI think there should be an error of closing and opening bracket. Some time problem is of logical error and we can't identify this error. So you have to check first your logic.

I have the second edition of "The C++ programming language" by Bjarne Stroustrup.
In it he describes a parser.
Every C++ programmer should have a copy of it. I guess newer prints do exist.
I devised a console calculator out of it (pity for you in C#) but if it would interest you, just look in my code snippets. C++ and C# are in a way "cousins"

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.