|
|
1
2
恐怕没有这样的语法。之前有过几次尝试。Pegged示例中的PEG语法可能与您想要的最接近,但已有五年没有更新,因此可能不再完全准确: https://github.com/PhilippeSigaud/Pegged/blob/master/pegged/examples/dgrammar.d
D-Grammar是最新的:
您还可以查看一些解析器: https://github.com/dlang-community/D-Scanner/ https://github.com/aBothe/D_Parser/tree/master/DParser2/Parser https://github.com/SDC-Developers/SDC/tree/master/src/d/parser https://github.com/D-Programming-Language/dmd/blob/master/src/parse.c
DDT也有一个,但我不知道在哪个源文件中:
|