Parsing text
Hi, I am hoping someone could help me with a few links here.
I am looking to making a simple command processor. Just a command line program that will parse a string, the first bit being the command, the rest its arguments. So for example "calc 25*4" would pass "25*4" to the calc function, which would be hard coded. Eventually I will be adding user assigned variables, and extra commands, all tied in with the eve-online API.
I figure this would be a fun project, as a) theirs lots I can add to it whenever I fancy learning something new (the eve api is accessed via the interweb and returns xml data) and b) if I do it right, most of the code could easl be dropped into a GUI app should I chose to learn a GUI library.
Main issue is, I have no idea how to handle the string initially, I need to tokenize it right?
Thanks in advance.
I am looking to making a simple command processor. Just a command line program that will parse a string, the first bit being the command, the rest its arguments. So for example "calc 25*4" would pass "25*4" to the calc function, which would be hard coded. Eventually I will be adding user assigned variables, and extra commands, all tied in with the eve-online API.
I figure this would be a fun project, as a) theirs lots I can add to it whenever I fancy learning something new (the eve api is accessed via the interweb and returns xml data) and b) if I do it right, most of the code could easl be dropped into a GUI app should I chose to learn a GUI library.
Main issue is, I have no idea how to handle the string initially, I need to tokenize it right?
Thanks in advance.
