Thread: How do i write a compiler

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    How do i write a compiler

    Could anyone tell me how to write a compiler. If possible could anyone give me a link to writing a compiler preferably in c/c++. I decided i wanted to write a compiler just for the heck of it thanks if u can help!

  2. #2
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    its not just im gonnna make a compiler. most people have a phd in computers. searhc google if you really wan t make one. i saw a ten poage tutorial there once. i donwlaoded it but ive lost it
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Making a compiler isn't truly that hard. But I also don't know what sort of compiler you are making. Compiling assembly code into an exe is really straight forward. C/C++, Pascal, Fortran (and all the others) is a little more challenging because the compiler is expected to generate the assembly code. JAVA, J#, and C# and all those languages shouldn't be too hard to compile.

  4. #4
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    i found my tutorial onmy computer for writng a compiler, i cant attach it to th baord cause fo its size, e-mail me or aim me and ill send it to u
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  5. #5
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    You can find some tools to write a compiler or to construct your own language here:
    www.thefreecountry.com/developercity

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Making a compiler isn't truly that hard.
    Trivial, huh?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which Compiler?
    By Bladactania in forum C Programming
    Replies: 10
    Last Post: 02-11-2009, 01:32 AM
  2. [resolved] internal compiler error...
    By bling in forum C++ Programming
    Replies: 2
    Last Post: 12-10-2008, 12:57 PM
  3. read write lock in C#
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-16-2008, 08:49 AM
  4. Have you ever written a compiler?
    By ammar in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 12-27-2004, 07:10 AM
  5. compiler gone haywire?!
    By patito12 in forum C Programming
    Replies: 5
    Last Post: 11-13-2004, 06:18 AM