Re: Looking for Perl Grammar



On 2005-04-29, Khamis Abuelkomboz scribbled these curious markings:
> I'm writing a Perl parser and I'm looking for a pure perl grammar. the
> documentation from perl is not a pure grammar, it's more a
> documentation of the perl language.

[Please wrap your lines at 70-72 characters. Thank you.]

First, a bit of folklore: "Only perl can parse Perl". What this means is
that only perl (the program) is capable of properly and completely
parsing Perl (the language). So why not have the existing Perl parser
(accessible at least via the command perl and possibly via a shared
library) do it for you? If you're doing this from C, you should start
with perldoc perlembed (assuming your documentation is installed, of
course; some Unix vendors think that it's bright to not ship
documentation by default).

Second, failing that, you can find the file perly.y in the perl source
kit which contains the grammar for the language.

Best Regards,
Christopher Nehren
--
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong questions, you get answers like "42" and "God".
Unix is user friendly. However, it isn't idiot friendly.
.



Relevant Pages

  • ANNOUNCE - Muldis::DB v0.0.0 released, in p5+p6
    ... I am pleased to announce the release of Muldis::DB version 0.0.0 for Perl 5 on CPAN. ... If you want to read all the Muldis::DB documentation that exists now, I recommend doing so in this order: ... Muldis::DB implements a D language as defined by Hugh Darwen and Chris Date, and presents a superior interface for working with the relational model of data, contrasted with SQL. ...
    (perl.dbi.users)
  • Re: OT: Why is C so popular?
    ... >language for most things Linux. ... >say that Java is the perfect language. ... Lots and lots of documentation, code examples and libraries are in C. ... but it does make it easier to write poetry in perl. ...
    (Debian-User)
  • Re: Can a Perl Programmer Pick up PHP quickly?
    ... PHP is not easier compared to Perl. ... a language with fewer features is going to be easier to ... You can't call documentation guessed after the source not good ...
    (comp.lang.perl.misc)
  • Re: perl should be improved and perl6
    ... language, and he says it's not called PERL. ... Larry himeself described it the same way 'perldoc perl' ... Your premise is somewhat tendentious since I believe the documents as a whole describe the language Perl (rather than the phrase). ... The following phrases are all on the right of a hyphen in the first sentence of equivalently formatted documentation for various languages: ...
    (comp.lang.perl.misc)
  • Re: How to use select (select(2)) in Perl?
    ... }> global-assignment *across* a package does. ... Perhaps we could agree that the ONLY real change in the documentation ... } very thin wraper around that, that provides a Perlish interface. ... } be willing to bet that if perl hadn't had select in the first place, ...
    (comp.lang.perl.misc)