Parser for the Mathematica syntax?

后端 未结 4 515
孤城傲影
孤城傲影 2021-02-02 01:05

Is there a built parser that I can use from C# that can parse mathematica expressions?

I know that I can use the Kernel itself to parse an expression, and use .NET/Link

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 02:06

    The mathematica grammar isn't well documented, true. But AFAIK, it is LALR(1) and likely LL(1); the bracketed /tagged syntax from gives the parser complete clues about what to expect next, just like LISP and XML.

    The DMS Software Reengineering Toolkit does have a Mathematica grammar that has been used for real tasks. This includes MMa programs as well as pure expression forms.

    That probably doesn't help you, since you want one in C#.

    If you have access to the Kernal, I'd stick to that.

提交回复
热议问题