have you tried to build a compiler?

compiler - a photo of turbo C compiler
Philippines
August 29, 2008 3:36am CST
hey, have you tried to build a compiler?.. right now, we are in one of our Computer Science subject, we are developing a compiler. Examples of compiler are Turbo C++, Turbo C and Dev C++. We need to read the program, find the tokens and we need to detect if there are errors in the program. So, have you tried to build a compiler?. what was the hardest part of it?..
2 people like this
4 responses
@airamana (36)
• Philippines
29 Aug 08
helow there.... A COMPILER translates the entire program line by line at a certain time and line by line executes it... i think the key points that you should remember while making a compiler is that you should have a good lexical analyzer. And once you're done with that you can proceed with your semantical analysis... The hardest part in making the compiler is the scanning part..where you need to check the characters per line and determine whether it is an identifier, a keyword, etc.
@arcenal (171)
• Philippines
29 Aug 08
Hello. Yeah, I've tried building my own compiler. It's really fun and I find it so enjoyable. However, it requires a lot of analysis and a lot of critical thinking. Furthermore, you must also understand all the programming concepts in order for you to build your own compiler and this is so hard on my part because I barely understand all the concepts. On the other hand, if you were able to build your own compiler, you would happiness and self fulfillment. By the way, I'm still on the process of building my own compiler and I doubt if I can finish it on time. I have three or four weeks left on building it. I hope that it would be done on time. Anyways, my teacher is building his own compiler too and he named it 3R and I guess, it's almost dine. Every time I see him in class, I could really see the happiness on his face and this is all because of his 3R. 3R really made him happy. hehe. He is my inspiration in building my own compiler. He gives us encouragement every time we are in the process of building our compiler. I want to experience the happiness brought by your own built compiler. I already had a name for my compiler and I would call it DGA compiler. Thank you and God bless.
1 person likes this
@mr_mlk (364)
29 Aug 08
Yeah a few times in the past. If I was to do it again now I'd look at something like JavaCC[1] to take the bulk of the work out of it. However if this is your first you will need to do it all yourself. Good luck. 1] https://javacc.dev.java.net/
@blanne (173)
• Philippines
29 Aug 08
Hello there fuuyuki! I am also a Computer Science student and it so happens that in one of our Computer Science subject, we are also building a compiler! In building a compiler, I prefer using the C programming language since it is the only programming language that I am most familiar of. Anyway, I am also making my "own" programming language. My compiler can compile and detect errors programs written in my self-made programming language. Basically, my own programming language looks like a combination of C and the Assembly language. How about you? How do you go about with your compiler?
1 person likes this