You can look up "Recursive descent parser" on the net or read the post
http://www.cplusplus.com/forum/general/1116/page2.html ( the post that starts "Here is some code put together from Stroustrups book" has code to do what you want).
Hi,
i wrote this simple C++programm in TurboC++ but it Gives me this error:"Declaration syntax error and it's about using namespace std;" i guess :D.
my programm is this :
#include<iostream>
using namespace std;
int main()
{
int a,b;
int result;
a=5;
b=2;
a= a+1;
result=a-b;
cout<<Result;
return0;
}
AFAIR, Turbo C++ is old and does not support namespaces.
You could try removing the usingnamespace std; line to see what it does. (I'm sure return0; is a typo that should be return 0; and cout<<Result; should be cout << result;)
If it works without the using line, I would consider getting hold of a newer compiler, the forums are full of suggestions.
HTH
EDIT: Looks like I might have been misguided about the aged of Turbo C++ (if you have Turbo C++ Explorer edition). I thought Borland had Kill the Turbo C++ name long ago.