Related articles |
---|
Java and recursive decent parsing.. limpus@immortalnet.com.au (Raymond Limpus) (2001-04-12) |
Re: Java and recursive decent parsing.. chief@bandits.org (John Fremlin) (2001-04-14) |
From: | John Fremlin <chief@bandits.org> |
Newsgroups: | comp.compilers |
Date: | 14 Apr 2001 17:34:41 -0400 |
Organization: | Compilers Central |
References: | 01-04-077 |
Keywords: | Java, LL(1) |
Posted-Date: | 14 Apr 2001 17:34:41 EDT |
"Raymond Limpus" <limpus@immortalnet.com.au> 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!
[...]
--
http://www.penguinpowered.com/~vii
Return to the
comp.compilers page.
Search the
comp.compilers archives again.