By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Can recursive descent parser handle Python grammar?

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

Well?

Chris

Sep 28 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
se******@spawar.navy.mil wrote:
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.

--
Ben Sizer

Sep 29 '06 #2

P: n/a

Ben Sizer wrote:
se******@spawar.navy.mil wrote:
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.

--
Ben Sizer
Thanks! What do you mean by 'pure'?

Chris

Sep 29 '06 #3

P: n/a
On 2006-09-28, se******@spawar.navy.mil <se******@spawar.navy.milwrote:
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.

--
Antoon Pardon
Sep 29 '06 #4

P: n/a
se******@spawar.navy.mil wrote:
Ben Sizer wrote:
se******@spawar.navy.mil wrote:
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.

--
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'.

--
Ben Sizer

Oct 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.