for in D versus C and C++

Walter Bright newshound1 at digitalmars.com
Sat Mar 21 10:47:11 PDT 2009


Georg Wrede wrote:
> Sometimes I need to have a command line UI in a program. Such programs 
> usually have 5 to 10 commands, with their parameters. One command per line.
> 
> So far I have tested and split the command line with regular 
> expressions, because using a parser generator has felt like shooting 
> mosquitos with a shotgun.
> 
> What would your strategy be?

If it's 5 or 10, you can get by with ad-hoc. But if you find yourself 
repeatedly fixing bugs in the parsing, it's time to consider a more 
principled approach.



More information about the Digitalmars-d mailing list