471,873 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

Can recursive descent parser handle Python grammar?

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
4 1864
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

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

Similar topics

4 posts views Thread by Magnus Lie Hetland | last post: by
6 posts views Thread by Jon Shemitz | last post: by
4 posts views Thread by siddharthkhare | last post: by
9 posts views Thread by seberino | last post: by
18 posts views Thread by Just Another Victim of the Ambient Morality | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.