如何在C或C ++中创建编译器将字符串从一种语言转换为另一种语言(意味着使用任何其他语言) [英] How Can I Create Compiler In C Or C++ To Convert String From One Language To Another (Means Eng To Any Other Language )

查看:83
本文介绍了如何在C或C ++中创建编译器将字符串从一种语言转换为另一种语言(意味着使用任何其他语言)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c或c ++中创建编译器以将字符串从一种语言转换为另一种语言(意味着使用任何其他语言)?

how can i create compiler in c or c++ to convert string from one language to another (means eng to any other language )?

推荐答案

非常困难。语言翻译不适合计算机语言编译器模型,它要复杂得多。您需要为要支持的每种语言使用完整的单词字典,并为每种语言添加某种语法分析器。举个例子,创建几个字典,每个字典有100个单词。然后用一种语言在你的程序中键入一个句子,看看会出现什么。
With great difficulty. Language translation does not fit into the computer language compiler model, it is much more complex. You would need a full word dictionary for each language you want to support, plus some sort of syntax analyser for each. As an example create a couple of dictionaries with 100 words in each. then type a sentence into your program in one language and see what comes out.


这篇关于如何在C或C ++中创建编译器将字符串从一种语言转换为另一种语言(意味着使用任何其他语言)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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