Can recursive descent parser handle Python grammar?

S

seberino

I'm a compiler newbie and was curious if Python's language/grammar
can be handled by a recursive descent parser.

Well?

Chris
 
B

Ben Sizer

I'm a compiler newbie and was curious if Python's language/grammar
can be handled by a recursive descent parser.

I believe a recursive descent parser can handle any grammar; it just
depends on how pure you want it to be.
 
S

seberino

Ben said:
I believe a recursive descent parser can handle any grammar; it just
depends on how pure you want it to be.

Thanks! What do you mean by 'pure'?

Chris
 
A

Antoon Pardon

I'm a compiler newbie and was curious if Python's language/grammar
can be handled by a recursive descent parser.

IIUC the python grammer is LL(1) and the development team is commited
to keeping it LL(1).

LL(1) languages can be handled by a recursive descent parser.
 
B

Ben Sizer

Thanks! What do you mean by 'pure'?

By 'pure' I mean entirely recursive and not iterative. Implementation
becomes easier if you're not writing a purely recursive parsing
program, and it makes it more practical to implement an arbitrary
amount of 'read-ahead'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top