views:

165

answers:

3

There are many lexical analyzer and parser generators out there - lex/flex and yacc/bison, jflex and javacup, gplex and gppg, etc. I'm wondering what tools are used by the official developers of languages - do Sun and Microsoft use any of these in developing Java and .NET, or do shops of that size use only custom internal tools?

+5  A: 

I once heard a legend that most c compiler is compiled by itself.

What they do is that they write the new version (example version 5), compile it using the old version (version 4), then using the newly compiled version (version 5 that was compiled using version 4), they compile itself again. (so that version 5 is now compiled by version 5).

iWantSimpleLife
That is exactly how life on Earth started.
Hamish Grubijan
Not legend, this is exactly as it goes for years; see this classic 1984 article about compiling compilers: http://www.c-program.com/kt/reflections-on-trusting.html
sarnold
I can't remember where i read it from. Ha ha. Thanks for the link.
iWantSimpleLife
Then who or what wrote the first version???? Hee hee.
iWantSimpleLife
@sarnold An excelent one! You get a little paranoid after reading it ...
belisarius
@iWantSimpleLife The chicken and egg problem http://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29
belisarius
A: 

JavaCC has an up-to-date Java grammar. Whether the Java compiler is actually written via JavaCC is another question.

EJP
+2  A: 

I've been inside a few commercial compilers, and I don't know of any that are built on lex or yacc generators. Lex and yacc are handy to get a syntax up and parsing fairly quickly, but this is usually not the highest priority of a commercial product. I'm not saying commercial products can't be built on yacc - I'm sure some have been - but the commercial compilers I've been part of have all been hand crafted code favoring raw speed over just about everything else.

And yes, compiling the compiler in itself is the norm, and a "fun" Escher-esque adventure in makefile logic. ;>

dthorpe