On 9/9/10 6:09 PM, Alexandre Bergel wrote:
Let us know how it goes Alberto
A good test for your work may be to parse the whole JDK. I did a similar experiment a few
years ago. I used Smacc. I had to manually modify some files because the java parser in
the Java compiler is written by hand. And it permits things that are not expressed in the
grammar. For example:
class Foo {} ;
is accepted by the Java compiler, but it is hardly accessed by most grammars.
Yes, the Java Language Specifications are very very very badly written.
The book is full of errors and does not consider some cases, as
you also reported.
For this reason, I based my porting on the grammar written for
ANTLR: it passes all the regression tests that the hand-written
compiler passes.