This project has moved and is read-only. For the latest updates, please go here.

Question about using Irony.

Apr 6, 2013 at 6:06 PM
Edited Apr 6, 2013 at 6:06 PM
Hello. From several days I'm writing a simple 2D game in C# presenting programming basic in an accessible form. In this game the player must write instructions for the robot to perform its task and upload it. Now all commands must be write in textbox (one command per lane) and then assign to string array. This string array is parsed by string split method and switch with a lot of cases. But I want to make this better and learn something new so maybe Irony will be better solution for parsing? How you think it’s worth using Irony in game when I want get maybe 40-50 commands?

Sample commands:
Apr 6, 2013 at 7:16 PM
Edited Apr 7, 2013 at 4:08 AM
well, it depends.. you might be quite OK without Irony. Irony and alike BNF-based parsers are good for languages described by recursive(!) BNF expressions. ASM-like languages do not have recursive definitions, every command is a self-contained thing. The last few commands in your table - arithm expressions - if they might be more complex, then you would need Irony to parse and interpret them. For other commands, you might be OK as it is (as you have now)