I'm working on a DSL in Microsoft's new M Grammar, and it needs to allow decimal values. I've defined decimal as
token digits = "0".."9";
token spot = ".";
token decimal = digits+ | digits+ spot digits+ | spot digits+;
That seems to work, but is there a better way? It just feels like I'm missing something.
After much digging I found that you can use the build in Language.Grammar.Decimal. As in
The Language.Base "namespace" also has some useful bits. Both Language.Base and Language.Grammar are built in to intellipad.