Writing a Compiler in Linux
Hi all,
I'm very much interested in writing a new compiler in Linux (Feisty Fawn Platform). I don't no how to start with. Can u please guide me? |
Sure: a compiler for what? what programming knowledge do you posess?
|
yeah, right...
if i hadn't seen questions like that before, i'd say you're a troll. well, i'm a nice guy, start reading here: guideme.itgo.com/atozofc/ch48.pdf (since you obviously don't know how to use a search engine, i have little doubt that you'll be back here in no time asking stuff like "what is a linker" or "how do i use the stack". be prepared to get some real rude answers then.) |
I don't think he's a troll, I just think he doesn't know what he's getting into, or rather trying to "write a compiler" for the wrong reasons.
|
Compiler for programming lanuage
A compiler for my own programming language, for hobby. I knew C, C++, Java
and .NET. Quote:
|
|
Do you already have an interpreter?
|
Ok. If you know C,C++...then you can use FLEX and BISON(also known and YACC(Yet another compiler compiler)) to write your own compiler !!
FLEX and BISON are usually included in all distros...do a google search on it...u'll get a lot of stuff Hope this helps. Ankit |
Go for it!!
One of the most unique features of Linux is the sheer number of development tools that are available, in source-code form. This includes not only powerful tools such as Bison and YACC, but also an endless number of language systems including gcc itself.
I will openly encourage you to pursue your dreams of developing a language compiler or interpreter, having achieved that milestone more than once myself. You will find that this path has been well-trod a great many times. You will find that every one of the tools that you use every day, in your daily interactions with the Linux system (including "the Linux system" itself...) are open for your inspection. It will .. blow .. your .. mind .. .. .. |
Have a look here:
http://www.ibm.com/developerworks/library/l-lexyac.html Lex and yacc will help you for syntaxic/lexical/semantic parsing. Then you will need to generate (and link) binary machine code, dependent on the target. I did a pascal compiler for MIPS and a compiler for a subset of C language that generated P-code (like java) running on a virtual machine written.. in C. It is completly useless but had a lot of fun creating my own "assembly" language. Also blew my mind.. |
For hobby or class project?
|
Interpreter
No.. May i know why?
Quote:
|
Thanks
Ya.. Thanks for ur info...
Quote:
|
Thanks
Ya thank you for ur info...
Quote:
|
Hobby
Just for hobby...
Quote:
|
All times are GMT -5. The time now is 05:33 AM. |