Photo by Jan Loyde Cabrera on Unsplash

Parsing Enum values with Sprache

Sprache is a fantastic little library for creating parsers in C#. It's great for situations where you want to create a fairly simple DSL; something beyond what you can get with String.Split() and regular expressions, but not at the level where you need to learn a language workbench tool. I used it a few years ago to create a very simple language to define rules for an alert system - my clients needed a way for their customers to create custom rules to alert them when a piece of equipment was operating outside of parameters. I'm using it now to write a simple language for defining video game characters and NPCs.