C,C ++和Java编译器代码源代码 [英] C, C++ and Java Compilers code source

查看:96
本文介绍了C,C ++和Java编译器代码源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好,我真的需要一些帮助..



我正在用VB.Net(或C#,我没有如果你知道的话,这是一个编程竞赛桌面评判,如pc²。



我想知道我是否能找到C,C ++和Java 编译器代码源使用Vb.Net(或C#,如果可能的话)编程。

我做了一些研究,但看起来我是一个糟糕的Google员工:D

谢谢!

Hello everybody, I really need some help here..

well I'm working on a project with VB.Net (or C#, I didn't decide yet), it's a programming contests desktop judge like "pc²" if you know it.

I'm wondering if I can find C, C++ and Java compilers code source programmed using Vb.Net (or C# if possible).
I did some research, but seems i'm a bad Googler :D
Thank you !

推荐答案

虽然可以这样做,但我不认为有人在VB.NET或C#中编写过C / C ++ / Java编译器。编写编译器是一项艰巨的任务,如果你想沿着这条路走,那么我建议学习 ANTLR [ ^ ]。



然而由于问题本身,我很确定这可能是一个有点过头的任务。如果你想研究编译器是如何工作的,那么有很多关于这个主题的书籍(但是公平的警告,大多数都是理论性的)。汇编是最简单的编译器,如果你可以写那个,然后继续下一个。







顺便说一句,Java不是一种可以说的编译语言,它是一种解释型语言。 Java编译器将源编译为字节码,然后由Java VM解释。要使Java在不同的操作系统上工作,您不要移植Java编译器,而是移植Java虚拟机。根据操作系统和体系结构,这可能相对简单或极其复杂。



这就是为什么Java是一种独立于操作系统的编程语言。你编译一次并在任何地方运行它。 JVM是难以解决的问题。



[/编辑]
While it is possible to do, I don't believe anybody has written a C/C++/Java compiler in VB.NET or C#. Writing a compiler is quite an undertaking, if you are wanting to go down that road then I would suggest learning ANTLR[^].

However due to the question itself, I'm pretty sure that this may be a task that is a bit over your head. If you want to study how compilers work there are many books on the subject (but fair warning, most are theoretical in nature). Assembly is the easiest compiler to start with, if you can write that one, then move on to the next.



BTW, Java is not a compiled language so-to-speak, its an interpreted one. The Java "compiler" compiles the source to bytecode, which is then interpreted by the Java VM. To make Java work on a different OS, you don't port the Java compiler, you port the Java virtual machine. Depending on the OS and architecture, this is either relatively simple or extremely complex.

This is why Java is an operating system independent programming language. You compile it once and run it anywhere. The JVM is what does the hard lifting.

[/Edit]


这篇关于C,C ++和Java编译器代码源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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