Writing a Parser for a Simplistic Dice Expression Using Nearley
Too Long; Didn't Read
I got the urge to write a parser for table top gaming. For example 4d6+1 meaning roll 4 6 sided dices, sum it all up and add 1 to the result. A pretty simple task, that could probably be done by just looking at the string and doing some splits or substrings. But I want to do it with nearley, because that sound like fun to me.