在哪里可以找到MATLAB的正式语法? [英] Where can I find a formal grammar for MATLAB?

查看:108
本文介绍了在哪里可以找到MATLAB的正式语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个词法生成器,将MATLAB语言的基本子集转换为C#,C ++等.为了帮助我做到这一点,我想找到一个包含MATLAB形式语法的文档.花了一些时间对此进行了调查,看来Mathworks没有提供它.

I would like to write a lexer generator to convert a basic subset of the MATLAB language to C#, C++, etc. To help me do this, I would like to find a document containing the formal grammar for MATLAB. Having spent a bit of time investigating this, it seems that Mathworks do not provide one.

有人知道我在哪里可以找到这样的文件吗?

Does anyone know where I could find such a document?

推荐答案

编写自己的形式语法的绝佳机会:)

Excellent opportunity to write your own formal grammar :)

如果您应该选择自己写语法,我可以推荐

If you should choose to write the grammer your self, I can recommend BNFC which can take a formal BNF grammar and construct data structures and lexers/parsers for a couple of target languages (C/C++, C#, Java, Haskell etc.). This would save you a lot of time and let you focus on formulating the grammar, and then get right to implementing the converter in your language of preference.

如果没有其他要求,则指向BNFC的链接包含一些帮助和有关如何制定BNF语法的指针.祝你好运!

If nothing else, the link to BNFC contains some help and pointers on how to formulate a BNF grammar. Best of luck!

这篇关于在哪里可以找到MATLAB的正式语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆