Answer the question
In order to leave comments, you need to log in
C++ - how to implement a console command parser?
It is necessary to implement a simple command parser in C++.
A good example of what I want to see can be found in games from Valve or Id Software.
Actually, the implementation options that came to my mind are as follows:
1) Use lua or python as a scripting language (in my opinion, it’s like a cannon on sparrows)
2) Open something from the boost, I didn’t google it right away.
3) A small library that implements the desired functionality. I also couldn't find anything good on the Internet.
Actually, what are the implementation options, so as not to write your bike?
Answer the question
In order to leave comments, you need to log in
If you need something more complicated than assignments, boost::python is not that hard to use.
You do not need a parser, but a full-fledged scripting language. The parser can do nothing but parse, and you also need to do it.
So just take lua or python and go ahead, and they will parse the text themselves as it should.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question