将第三方语言转换为C. [英] conversion of a 3rd party language to C.

查看:90
本文介绍了将第三方语言转换为C.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我必须将第三方脚本转换为ac语言.脚本语法几乎类似于C语言.我必须用我们的函数原型替换某些函数原型,并用我们的结构替换某些结构.
什么是简便的方法(可能是正确的方法)?在开始编码之前,我需要一些建议.

I got a requirement where i have to convert a 3rd party script to a c language.The script syntax is almost similar to C language.I have to replace some function prototypes with our function prototypes and some structures with our structures.
What is the easy way ( may be correct way ) to do this?I require some suggestions before starting coding.

推荐答案

没有足够的信息来提供任何技术帮助真的很有用.

除了此语言的详细信息外,此任务没有其他具体说明,因此任何常规帮助都几乎没有用.这是关于解析代码生成的,所以您需要对解析器进行一些学习(代码生成比较琐碎,但是需要一些良好的设计工作).

您将需要学习以下主题:
http://en.wikipedia.org/wiki/Parsing [ http://en.wikipedia.org/wiki/Parsing_expression_grammar [ http://en.wikipedia.org/wiki/Context-free_grammar [ http://en.wikipedia.org/wiki/Parse_tree [ http://en.wikipedia.org/wiki/Formal_grammar [ http ://en.wikipedia.org/wiki/Parser_generator [ ^ ])也是可行的问题.

—SA
There is not enough information to make any technical help really useful.

There is nothing specific about this task except the detail of this language, so any general help hardly can be useful. This is about parsing and code generation, so you need some education on parsers (code generation is more trivial but will need some good design effort).

You would need to learn such topics as:
http://en.wikipedia.org/wiki/Parsing[^],
http://en.wikipedia.org/wiki/Parsing_expression_grammar[^],
http://en.wikipedia.org/wiki/Context-free_grammar[^],
http://en.wikipedia.org/wiki/Parse_tree[^],
http://en.wikipedia.org/wiki/Formal_grammar[^] — and more.

So, the only real problem is: some education required. Having reasonably good general programming skills and the skills in reading mathematical or computer-theory literature, one could learn some minimally required techniques and algorithms withing a reasonable period of time. If the input language is not too complex, development of the parser from scratch or using some available parser generator (http://en.wikipedia.org/wiki/Parser_generator[^]) is also quite doable problem.

—SA


这篇关于将第三方语言转换为C.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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