Does Perl use a special hand-made parser, or does it use Yacc or someother pre-packaged tool?

Discussion in 'Perl Misc' started by Robert, Apr 16, 2008.

  1. Robert

    Robert Guest

    Do you know?
     
    Robert, Apr 16, 2008
    #1
    1. Advertisements

  2. Re: Does Perl use a special hand-made parser, or does it use Yacc or some other pre-packaged tool?

    Robert <> writes:

    > Do you know?


    perlfaq7 may be of interest.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
     
    Joost Diepenmaat, Apr 16, 2008
    #2
    1. Advertisements

  3. Robert

    Hans Mulder Guest

    Re: Does Perl use a special hand-made parser, or does it use Yaccor some other pre-packaged tool?

    Robert wrote:
    > Do you know?


    The parser is a fairly standard LALR parser generated using
    bison from the perly.y file in the source distribution.

    The lexical analyser, OTOH, is a special hand-made lexer.
    All the smoke and mirrors used to parse Perl can be found
    in the lexer source code in the file toke.c.

    -- HansM
     
    Hans Mulder, Apr 16, 2008
    #3
  4. Robert

    Ben Bullock Guest

    Re: Does Perl use a special hand-made parser, or does it use Yaccor someother pre-packaged tool?

    On Wed, 16 Apr 2008 12:49:02 -0700, Robert wrote:

    > Do you know?


    If you compile perl from the source code, the "Configure" script asks you
    whether you want to use byacc or bison at one point (maybe it has
    detected these first).
     
    Ben Bullock, Apr 17, 2008
    #4
    1. Advertisements

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. Replies:
    3
    Views:
    536
    Scott Smith
    Dec 1, 2005
  2. Mike Wahler
    Replies:
    2
    Views:
    688
    John Harrison
    Jul 8, 2003
  3. Replies:
    0
    Views:
    367
  4. Wolfgang Draxinger

    Flex / Yacc sources for C parser

    Wolfgang Draxinger, Dec 25, 2007, in forum: C Programming
    Replies:
    2
    Views:
    924
    George Peter Staplin
    Dec 25, 2007
  5. Robert
    Replies:
    1
    Views:
    466
    Martin v. Löwis
    Apr 16, 2008
  6. climb65
    Replies:
    1
    Views:
    308
    Vinay Sajip
    Oct 27, 2010
  7. Robert
    Replies:
    2
    Views:
    307
    Ron Fox
    Apr 23, 2008
  8. macabstract
    Replies:
    7
    Views:
    595
    Richard Cornford
    May 25, 2006
Loading...