Regular expression – the best modern text parsing? When is AKA to use Lex and Yacc?

I have commands and parameters for inputting text blocks, one per line, such as

XYZ ARG1,ARG2,ARG3, ..., ARGN

I want to verify whether the parameters of XYZ are applicable to that particular command, and if they are, execute the correct code block. There are about 100 commands, some of which have a variable number of parameters, Different relationships (that is, if the command XYZ is called, then I also need the command ABC to call).

There are also commands, for example:

COMMAND
XYZ ARG1
BEF ARG1 ARG2
ENDCOMMAND

The important thing is that the text is included in COMMAND and ENDCOMMAND.

Usually for such things, I would use Lex and Yacc instead of regular expressions, but is there something more modern? The code is written in C#. Is there anything in MSDN that can do this instead of the old school C Lex and Yacc?

If you are looking for an alternative to Lex / Yacc, please check ANTLR. It supports various languages Code generation for, including C#.

I have commands and parameters for inputting text blocks, one per line, such as

 XYZ ARG1,ARG2,ARG3,...,ARGN

I want to verify whether the parameters of XYZ are applicable to that particular command, and if so, execute the correct code block. There are about 100 commands, some of them There are a variable number of parameters and different relationships (that is, if the command XYZ is called, then I also need the command ABC to call).

There are also commands, such as:

COMMAND
XYZ ARG1
BEF ARG1 ARG2
ENDCOMMAND

The important thing is that the text is contained in COMMAND and ENDCOMMAND.

Usually For such things, I would use Lex and Yacc instead of regular expressions, but is there something more modern? The code is written in C#. Is there anything in MSDN that can do this instead of the old school C Lex and Yacc?

If you are looking for an alternative to Lex/Yacc, please check ANTLR. It supports code generation in various languages, including C#.

< p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5447 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.