Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Any compiler (ADA, C, PASCAL) written in Java Posted by pccfAkE on 17 Jan 2002 at 12:42 PM
Hello,
I am looking for any compiler's source-code (ADA, C, PASCAL, etc.) that was written in Java.
Can you help me?
Thank you
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by Illco on 21 Jan 2002 at 7:12 AM
I don't think any commercially available compilers are written in Java. Since Java is quite new and most compiler paradigms quite old... Since Java is platform-independent and compilers are (very) platform-dependent...
But I once thought of using Java as a language for a compiler since it takes care of the most boring parts (I/O, the whole tokenizer part, Hash tables, etc.
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by icey502 on 29 Jan 2002 at 9:15 AM
: I don't think any commercially available compilers are written in Java. Since Java is quite new and most compiler paradigms quite old... Since Java is platform-independent and compilers are (very) platform-dependent...
: But I once thought of using Java as a language for a compiler since it takes care of the most boring parts (I/O, the whole tokenizer part, Hash tables, etc.
:
Looking into JavaCC might help. Check out these links:

http://www.webgain.com/products/java_cc/

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-cooltools.html

I used this a couple times to generate compilers. The source code is so-so but it seems to work pretty well.
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by icey502 on 29 Jan 2002 at 9:17 AM
: : I don't think any commercially available compilers are written in Java. Since Java is quite new and most compiler paradigms quite old... Since Java is platform-independent and compilers are (very) platform-dependent...
: : But I once thought of using Java as a language for a compiler since it takes care of the most boring parts (I/O, the whole tokenizer part, Hash tables, etc.
: :
: Looking into JavaCC might help. Check out these links:
:
: http://www.webgain.com/products/java_cc/
:
: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-cooltools.html
:
: I used this a couple times to generate compilers. The source code is so-so but it seems to work pretty well.
:

As well, just so everybody knows, "ADA" (Ada) as it pertains to the Ada programming language, is not an acronym

Good luck
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by Illco on 29 Jan 2002 at 10:16 AM
Didn't know about that; as I mentioned I once thought of it. It's a great idea to build a compiler using Java, but what would be the target CPU, OS, etc? E.g. if you write a Windows compiler, would Linux users get a message <only use in windows?>?
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by icey502 on 29 Jan 2002 at 11:32 AM
: Didn't know about that; as I mentioned I once thought of it. It's a great idea to build a compiler using Java, but what would be the target CPU, OS, etc? E.g. if you write a Windows compiler, would Linux users get a message <only use in windows?>?
:

You would probably design it in such a way that the actual generated instructions would be produced by plug in modules which could be dynamically changed. Then the user would just select the target platform to compile for. Something like
that Naturally that would be the most difficult part...
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by pccfAkE on 29 Jan 2002 at 1:37 PM
Thank you Illco and Icey502 for your replies. It's really hard to write a compiler in Java...:) At the moment I try to program a compiler for "Oberon" in Java. It's not easy for me...
If any of you have a sample source-code or other resources...can I have it please? Thank you very much...
Report
Re: Any compiler (ADA, C, PASCAL) written in Java Posted by Illco on 30 Jan 2002 at 2:47 AM
: Thank you Illco and Icey502 for your replies. It's really hard to write a compiler in Java...:) At the moment I try to program a compiler for "Oberon" in Java. It's not easy for me...
: If any of you have a sample source-code or other resources...can I have it please? Thank you very much...
:
Designing a compiler is not an easy task at all; using Java just makes it a little nicer since you have certain data-structures at your disposal.
I don't know if you have a book on compiler design, but if you did you'd probably notice that it's full of theoretical mathematical gibberish. Well, it's not gibberish, it's the theoretical foundation which you will probably need to understand. Most books explain how to write compiler too, by the way. If you want to know more about the different stages of a compiler, please let me know. I can't tell you much detail (unless I bring the book up here), since I failed the Compiler Design course...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.