6 of 6 people found the following review helpful
Best Compiler Book Utilizing C# and Java,
This review is from: Compiling with C# and Java (Paperback)The author starts out explaining the concept of a virtual machine, and then he defines his own called PVM. PVM will later be used as the target of his first language called Parva, which is essentially a subset of C# and Java.
Then he explains grammers and how they are used to define the syntax of computer languages. He touches on BNF and EBNF, and then he presents a lot of helpful exercises. This is perhaps the hardest section of the book for newbies to understand, and it would help a lot if you've had some exposure to grammers and BNF before, or perhaps you are taking a college class where the instructor can help you with some of these concepts.
Next you get a explanation of Parva, and there is code to compile this language in C# and Java downloadable from the author's website. Even if you don't have much interest in this simple C-like language, please do read these chapters carefully. The author explains how compilers work using Parva as the model language. He also offers attributes to the grammer that help in semantic analysis and code generation.
The book finishes up by defining the C# Minor language, which in an OOP language that is a subset of C# (and not much different from Java either). There are different challenges in compiling an OOP language, so this is an interesting and highly useful look at these more advanced concepts used in today's compilers. The C# Minor language targets both the .NET CLR and the Java Virtual Machine.
Most of the code is written is a manner that is common to both C# and Java. His use of the Coco/R parser generator lets him focus on the more vital areas of defining the syntax and semantics, and code generation. This is a heavy book that will help you understand what happens under the hood, and it has value even if you don't want to design your own compiler!