Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Can recursive descent parser handle Python grammar?

Reply
Thread Tools

Can recursive descent parser handle Python grammar?

 
 
seberino@spawar.navy.mil
Guest
Posts: n/a
 
      09-28-2006
I'm a compiler newbie and was curious if Python's language/grammar
can be handled by a recursive descent parser.

Well?

Chris

 
Reply With Quote
 
 
 
 
Ben Sizer
Guest
Posts: n/a
 
      09-29-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
 
seberino@spawar.navy.mil
Guest
Posts: n/a
 
      09-29-2006

Ben Sizer wrote:
> (E-Mail Removed) 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

 
Reply With Quote
 
Antoon Pardon
Guest
Posts: n/a
 
      09-29-2006
On 2006-09-28, (E-Mail Removed) <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
Ben Sizer
Guest
Posts: n/a
 
      10-02-2006
(E-Mail Removed) wrote:
> Ben Sizer wrote:
> > (E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is better or more flexible, a recursive-descent parser or abottom-up parser? Robert C++ 1 04-14-2008 06:24 PM
Is pyparsing really a recursive descent parser? Just Another Victim of the Ambient Morality Python 39 11-09-2007 04:19 AM
[Snippet] a Recursive Descent Parser via TDD - recursiveDescentParser.h Phlip C++ 6 08-05-2004 03:12 AM
[Snippet] a Recursive Descent Parser via TDD - test.h Phlip C++ 0 08-02-2004 07:59 PM
[Snippet] a Recursive Descent Parser via TDD - recursiveDescentParser.cpp Phlip C++ 0 08-02-2004 07:48 PM



Advertisments