September 15th, 2003, 11:58 AM
Hi, anyone here had build a compiler before using C?the compiler that accept high level language and output a C code as target language.
September 15th, 2003, 12:57 PM
Technically that's a translator rather than a compiler. Many early C++ implementations worked this way I believe.
September 15th, 2003, 10:11 PM
Well, it's a type of translator. Can say a compilr too.Just most compiler generate assembly language as output. but my project is to generate C code.Just like VDM tools.anyone can help,please.
September 16th, 2003, 04:35 AM
September 16th, 2003, 05:03 AM
Well, i need to parse Z specification.the link u gave is to use lex and yacc?thanx for your help.Can i knwo if any website teach us how to build a compiler?
September 16th, 2003, 01:13 PM
An interesting idea, and possibly a bit too specialist for me or even this forum. I am not familiar with Z, but I have used VDM. Because Z is declarative, and C is procedural, it seems that it is not a conventional compiler/translator that you are suggesting (I may be wrong on this). Prolog would be the natural language for 'animating' Z program specifications since that is an executable declarative language. There is a paper on this subject:
Last edited by clifford; September 16th, 2003 at 01:16 PM.
September 16th, 2003, 11:35 PM
well, I'm just looking for some clues for starting my project.Cos I dunno how to start it. If anyone got example in building translator that generate a C code as output, mind to tell me?I just wan to use it as reference. A tutorial will be deeply appreciate. As far as I know build a compiler is time consuming but I dont have much time. I hope someone can help.Thanx Clifford.