The example explained on that page by Douglas Crockford (Yahoo's Javascript guru) is a TDOP parser written in Javascript thats parses Javascript (it's a concept demo, not a practical use case) What's nice about his example is he covers lots of different features like scope, functions, and objects, which are sometimes glossed over in other texts about how compilers work. This is not a complete compiler because it only produces a syntax tree, but going from syntax tree to interpreter/compiler is the easier part.
That is my experience as well, but keep in mind that the design of the source language affects this. For instance, writing a parser for C++ would be a nightmare full of bookkeeping, but a basic translation to machine code would be relatively straight forward.
http://javascript.crockford.com/tdop/tdop.html
The example explained on that page by Douglas Crockford (Yahoo's Javascript guru) is a TDOP parser written in Javascript thats parses Javascript (it's a concept demo, not a practical use case) What's nice about his example is he covers lots of different features like scope, functions, and objects, which are sometimes glossed over in other texts about how compilers work. This is not a complete compiler because it only produces a syntax tree, but going from syntax tree to interpreter/compiler is the easier part.