PDA

Click to See Complete Forum and Search --> : can i make a compiler w/ VC++?


Oafo
Mar 1st, 2001, 08:06 PM
I know it's possible to make a program that compiles things into .exe's but does anyone know how to do this? If so, can you send me some source please? Thanks.

HarryW
Mar 1st, 2001, 08:14 PM
I think it would be a lot of source code. You need to know the assembly language for the machine your compiler will run on, and you need to establish how a C (or C++) statement is represented in assembly instructions. You compile the C code down to assembly, then assemble the assembly code to binary machine code.

It's far more complicated than that when it comes to optimisations though. You also need error checking to make sure it's valid code.

Mar 1st, 2001, 08:32 PM
1. Yes a compiler can be made with any language and any compiler.

2. I found some very good text on how to make one in pascal, and it was actually kind of easy to follow, but i dont have it anymore sorry. If i can find it, ill give you the link.

KingDavid
Mar 2nd, 2001, 12:06 PM
http://www.compilers.net/Coco.htm