Does Perl use a special hand-made parser, or does it use Yacc or some

Does Perl use a special hand-made parser, or does it use Yacc or some

am 16.04.2008 21:49:02 von irishhacker

Do you know?

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

am 16.04.2008 22:00:23 von Joost Diepenmaat

Robert writes:

> Do you know?

perlfaq7 may be of interest.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

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

am 16.04.2008 22:02:36 von Frank Seitz

Robert wrote:
> Do you know?

$ perldoc -q yacc
| Can I get a BNF/yacc/RE for the Perl language?
|
| There is no BNF, but you can paw your way through the yacc grammar in
| perly.y in the source distribution if you're particularly brave. The
| grammar relies on very smart tokenizing code, so be prepared to venture
| into toke.c as well.
|
| In the words of Chaim Frenkel: "Perl's grammar can not be reduced to
| BNF. The work of parsing perl is distributed between yacc, the lexer,
| smoke and mirrors."

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel

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

am 17.04.2008 00:50:15 von Hans Mulder

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

Re: Does Perl use a special hand-made parser, or does it use Yaccor some

am 17.04.2008 02:12:26 von benkasminbullock

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