|Java and recursive decent parsing.. email@example.com (Raymond Limpus) (2001-04-12)|
|Re: Java and recursive decent parsing.. firstname.lastname@example.org (John Fremlin) (2001-04-14)|
|From:||John Fremlin <email@example.com>|
|Date:||14 Apr 2001 17:34:41 -0400|
|Posted-Date:||14 Apr 2001 17:34:41 EDT|
"Raymond Limpus" <firstname.lastname@example.org> writes:
> Is it possible to parse Java source using a recursive decent parser?
> I know the grammar isn't LL(1) but there are only a couple of parts
> that aren't (stemming form C/C++ background) and surely you could
> create some 'hacks' in the code to deal with these. The grammars I
> have seen have been LALR(1) but by looking at it it does seem you
> could parse it using recursive decent with a couple of special
> cases. Is this the case?
Yes. The ANTLR LL(k) parser generator (http://www.antlr.org) comes
with an example Java grammar. The KJC compiler uses an ANTLR grammar
to parse Java.
Obviously JavaCC (which is LL(k)) comes with an example java grammar!
Return to the
Search the comp.compilers archives again.