I started to code a parser for a new game project I've been thinking about a while. The parser in this case is an adventure game parser obviously. I did some research to figure out how to do that, but I think resources in this subject are bit lacking to be honest, or I didn't just find the right thing. The difficult part being how to map the input to commands and state that the game can understand.
This far I have discovered that even using C++ it was surprisingly easy to write the input part. I programmed a small console/terminal for that purpose which has less than 100 lines of code in the .cpp file. The only feature it's missing is the ability to recall previous/next lines with arrow up/down keys. At the moment I'm cleaning up the input, to save only pure words.
I don't yet know how to implement the command part, but I think you can approach it with simple if-else style or go really far with data-driven/scripted style. Or it's going to be something between it. I'm thinking about it as if the text input was transformed into commands you enter let's say in a roguelike game.