Hi people,

Can anyone helps me out. I need use C++ to do this:
"Use polymorphism to build an object which can be stored in a datastructure such as an stl::map but uses polymorphism to perform different actions depending upon the type. You may find an stl::map is also useful to maintain a list of vairables. Your interpreter should recognise the commands PRINT, LET, GOTO, INPUT. Use overloaded input/output operators to read in the content of the file."

anyone can give me some ideas how to do it. Thanks a lot!!!

Edit: oops, never mind.

Is there a way to delete my own post?

Edited 7 Years Ago by donaldw: n/a

Is there a way to delete my own post?

No there isn't, sorry. Think first, post later ;)
I personally think your original post has some good advice in it and I don't understand why you removed it?

Hint to OP: lexical analyzer

Edited 7 Years Ago by Nick Evan: n/a

Is there only a certain time window in which you can edit posts after you make them? My brain already was not working quite right this morning, even before pouring over thousands of lines of code hundreds of thousands of values along a sine wave looking for anomalies. After that, it was totally shot.

Anyway, OP, the gist of my other post was that you need to tokenize and parse the user input. Lex and Yacc, a lexical analyzer generator and parser generator, respectively, are tools that may be helpful for you.

This article has been dead for over six months. Start a new discussion instead.