Can recursive descent parser handle Python grammar?

Discussion in 'Python' started by seberino@spawar.navy.mil, Sep 28, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Ben Sizer Guest

    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
     
    Ben Sizer, Sep 29, 2006
    #2
    1. Advertising

  3. Guest

    Ben Sizer wrote:
    > 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, 2006
    #3
  4. On 2006-09-28, <> 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
     
    Antoon Pardon, Sep 29, 2006
    #4
  5. Ben Sizer Guest

    wrote:
    > Ben Sizer wrote:
    > > 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
     
    Ben Sizer, Oct 2, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phlip
    Replies:
    0
    Views:
    479
    Phlip
    Aug 2, 2004
  2. Phlip
    Replies:
    6
    Views:
    454
    Phlip
    Aug 5, 2004
  3. Phlip
    Replies:
    0
    Views:
    466
    Phlip
    Aug 2, 2004
  4. Just Another Victim of the Ambient Morality

    Is pyparsing really a recursive descent parser?

    Just Another Victim of the Ambient Morality, Nov 2, 2007, in forum: Python
    Replies:
    39
    Views:
    1,457
    Kay Schluehr
    Nov 9, 2007
  5. Robert
    Replies:
    1
    Views:
    595
    Puppet_Sock
    Apr 14, 2008
Loading...

Share This Page