Is there a python parser generator that is similar to JavaCC from webgain?

Fernando Pereira pereira at cis.upenn.edu
Sat Feb 23 18:39:31 EST 2002


On 2/23/02 6:17 PM, in article m38z9jpz4a.fsf at mira.informatik.hu-berlin.de,
"Martin v. Loewis" <martin at v.loewis.de> wrote:

> "Shen Wang" <shenwang at ameritech.net> writes:
> 
>> As title
> 
> There are a number of Python parser generators. Since I don't know
> JavaCC (and don't want to spend time learning it), I cannot tell you
> which of those is similar to JavaCC.

JavaCC takes grammar specs (lexical patterns and rules) and produces a
parser (a Java class) using a LL(k)-type of rule compilation (that is,
deterministic recursive descent with lookahead). Rules can have embedded
Java code that not only computes rule output (eg. syntax tree) but also can
affect the parsing in some ways. JavaCC can be quite painful to use because
of the limitations of LL(k), but the resulting code is simple, and the
embedding of Java side-effects into parsing via rules is easy to understand
(as expected for a recursive descent parser).

-- F




More information about the Python-list mailing list