Parser for the Mathematica syntax?

后端 未结 4 571
孤城傲影
孤城傲影 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条回答
  •  滥情空心
    2021-02-02 02:07

    I don't think such a thing exists already (I'd love to know about it). But it may be useful that within Mathematica you can apply the function FullForm to any expression and get something very easy to parse, kind of like an s-expression in Lisp. For example,

    FullForm[a+b*c]
    

    yields

    Plus[a, Times[b,c]]
    

    That's the underlying representation of all Mathematica expressions and should be straightforward to parse.

提交回复
热议问题