Recursive descent algorithm able to parse Python?

hanumizzle hanumizzle at gmail.com
Fri Oct 6 23:34:52 EDT 2006


On 10/6/06, Diez B. Roggisch <deets at nospam.web.de> wrote:
> Lawrence D'Oliveiro schrieb:
> > In message <4o47o7Fcu386U1 at uni-berlin.de>, Diez B. Roggisch wrote:
> >
> >> I have to admit that I have difficulties to compare LR(k) to recursive
> >> descent, but the fact that the latter contains backtracking makes it at
> >> least more powerful than LL(k)
> >
> > LR(k) is more powerful than LL(k).
>
> I know _that_, the point was that recursive descent is more power full
> than LL(k)

Correct me if I'm wrong, but recursive descent parsers are top-down, yes?

Parse::RecDescent in Perl is a top-down parser. It can even do some
context-sensitive grammars and can almost certainly handle Python.

Is Python context-free? Not sure. Does left parenthesis opening either
a function call (x) or an empty tuple () count as context-sensitive,
for instance? Or can () be considered a terminal symbol unto itself?

I am new to most of this :)

-- Theerasak



More information about the Python-list mailing list