Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Microsoft 的新 M 语法中的 DSL,它需要允许十进制值。我将小数定义为
token digits = "0".."9"; token spot = "."; token decimal = digits+ | digits+ spot digits+ | spot digits+;
这似乎有效,但有更好的方法吗?只是觉得我错过了一些东西。
经过大量挖掘,我发现您可以使用 Language.Grammar.Decimal 中的构建。如在
syntax Cost = Language.Grammar.Decimal
Language.Base “命名空间”也有一些有用的位。Language.Base 和 Language.Grammar 都内置于智能小键盘中。