I have input blocks of text with commands and arguments, one per line, for example
XYZ ARG1,ARG2,ARG3,...,ARGN
And I want to check that the arguments for are XYZwell-formed for this particular command and execute the correct block of code, if any. There is something like ~ 100 commands, some of which have a variable number of arguments, different relationships (i.e. if a command was called XYZ, then I also need to call the command ABC).
There are also commands:
COMMAND
XYZ ARG1
BEF ARG1 ARG2
ENDCOMMAND
It is important that the text is contained in COMMANDand ENDCOMMAND.
Usually for something like this I would use Lex and Yacc rather than regex's, but is there anything more modern? The code is written in C #. Is there anything on MSDN that does this, and not the old C Lex and Yacc school?
Steve
source
share