是否有C/C++库来转换MathML<->中缀?

Is there a C/C++ Library to convert MathML <-> Infix?

本文关键字:lt gt 中缀 MathML 转换 C++ 是否      更新时间:2023-10-16

我正在寻找一个C/c++库,可以将MathML转换为中缀和中缀到MathML,例如给定:

<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <apply>
    <times/>
    <cn type="integer"> 2 </cn>
    <ci> x </ci>
  </apply>
</math>

库将把mathml转换为2*x。或者给定x+sin (t)我得到下面的mathml

<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <apply>
    <plus/>
    <ci> x </ci>
    <apply>
      <sin/>
      <ci> t </ci>
    </apply>
  </apply>
</math>

我知道如何编写这样一个库,但如果可能的话,我宁愿不要重新发明轮子。不能在Java中,因为我必须能够将库链接到非托管代码。

我自己从未使用过它,但看起来libSBML可能符合您的目的:

http://www.google.co.uk/search?q=libsbml +转换+ mathml +中缀

http://sbml.org/Software/libSBML/docs/cpp-api/libsbml-features.html

本页:

http://sbml.org/Software/libSBML/docs/cpp-api/

它说:

"libSBML公式解析器经过精心设计,因此可以在对数学表达式结构的破坏最小的情况下实现从MathML到中缀字符串表示法的转换。"

还有一个你想要做的例子