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

Recommended Answers

All 4 Replies

Edit: oops, never mind.

Is there a way to delete my own post?

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

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.

Is there only a certain time window in which you can edit posts after you make them?

Yep. Half an hour.

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.