数学方程和不等式的 EBNF
我想设计一种满足 EBNF 的数学语言,让我编写尽可能接近自然数学语言的方程组和不等式。我希望为这种小语言提供两个解析器,一个解析器准备用这种语言编写的等式/不等式以供发布,另一个解析器准备它进行计算,即将所有系数检索到内存中并将它们存储在我自己的数据结构中以供进一步使用计算。我正在考虑使用 Latex2e 语法,因此我不需要编写第一个用于发布的解析器。然而,我从这个论坛了解到 Latex2e 语法本身不包含解析器足够的信息。关于去哪里有什么建议吗?谢谢!
I would like to design a math language satisfying EBNF, to let me write equation systems and inequalities as close to natural math language as possible. I would like to have two parsers for this little language, one parser prepares the equalities/inequalities written in this language for publication, another parser prepares it for computing, i.e., retrieve all coefficients into memory and store them in my own data structure for further computing. I was thinking to use Latex2e syntax, so I don't need to write the first parser for publication. However I read from this forum that Latex2e syntax itself doesn't contain enough information for a parser. Any suggestions about where to go? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Fortress 语言旨在为用户提供接近传统数学符号的东西(并不是任何两篇数学论文使用完全相同的符号)。输入利用 Unicode 符号并遵循诸如空格作为默认乘法运算符之类的约定。
Fortress 站点 有参考实现,它使用 Rats PEG 实现来实现语法而不是 EBNF。
The Fortress language is designed to give the user something close to conventional maths notation ( not that any two maths papers use exactly the same notation ). The input exploits Unicode's symbols and follows conventions such as whitespace as the default multiplication operator.
The Fortress site has the reference implementation, it uses the Rats PEG implementation for its grammar rather than EBNF.