Poor man's "lexer" for C#
- by Paul Hollingsworth
I'm trying to write a very simple parser in C#.
I need a lexer -- something that lets me associate regular expressions with tokens, so it reads in regexs and gives me back symbols.
It seems like I ought to be able to use Regex to do the actual heavy lifting, but I can't see an easy way to do it. For one thing, Regex only seems to work on strings,…