如何在c / c ++中编写编程语言 [英] How do i make a programming-language in c/c++

查看:88
本文介绍了如何在c / c ++中编写编程语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经学会了C.我想设计一个编译器。至少只是放弃输出。我想知道至少如何放弃输出。我只熟悉C而且只会尝试使用它。我该怎么办。我能用什么呢。



我尝试过的事情:



搜索互联网并搜索

I've learnt C. I'd like to design a Compiler with that.At least just giving off output.I'd like to know at least how to give off output. I'm only familiar with C and will only try to use that. How exactly should I do.What what can I use.

What I have tried:

searching the internet and googling

推荐答案

如果你搜索谷歌并没有找到任何内容,那么你的google-fu需要认真练习...

一个非常快速的搜索 - 编写编译器c - Google搜索 [ ^ ] - 发现了2400万次点击。

从其中一些开始,看看你能学到什么。

但是...如果你的谷歌是那么差,然后实际编写任何真实世界编程语言的编译器将是一项艰巨的任务 - 它是很多w ork。



祝你好运 - 你将需要它! :笑:
If you searched google and found nothing, then your google-fu needs serious practice...
A very quick search - write compiler c - Google Search[^] - found 24 million hits.
Start with some of them, and see what you can learn.
But...if your google-fu is that poor, then actually writing a compiler for any "real-world" programming language is going to be a difficult task - it's a lot of work.

Good luck - you are going to need it! :laugh:


Fraser Hanson 的经典作品可能值得一看:\"lcc,ANSI C的重定向编译器 [ ^ ]。
The classical work of Fraser and Hanson might be worth a look: "lcc, A Retargetable Compiler for ANSI C"[^].


这个问题属于一个特殊类别,可以抽象为:

如果你需要问一下,你将无法完成。如果你能做到,你就不需要问了。



说不然,这是一个技术性很强的任务,你不会在一夜之间学习它。



如解决方案1所述,你需要对你的Google-fu进行一些严肃的练习,因为有数百万的答案,你不能没有任何用处。



a几个参考:

学习编译器技术:Compilers :原则,技术和工具 [ ^ ]

快速练习,看看Lex& YACC: lex& yacc,第2版 - O'Reilly Media [ ^ ]

或: C中的现代编译器实现 [ ^ ]



3个链接是书籍(为了让你了解任务的大小)。



其他链接

LEX& YACC页面 [ ^ ]

< a href =http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf> http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf [ ^ ]
This question fall in a special category which can abstract as:
"If you need to ask, you will be unable to complete. If you can do it, you don't need to ask."

Said otherwise, it is a highly technical task, and you don't learn it over night.

As said in solution 1, you need some serious practice on your Google-fu because with the millions answers, you can't endup with nothing useful.

a few references:
To learn compilers technics: Compilers: Principles, Techniques, and Tools[^]
for faster practice, have a look at Lex & YACC: lex & yacc, 2nd Edition - O'Reilly Media[^]
or: Modern Compiler Implementation in C[^]

The 3 link are books (to give you an idea of the size of the task).

other links
The LEX & YACC Page[^]
http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf[^]


这篇关于如何在c / c ++中编写编程语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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