develooper Front page | perl.perl6.language | Postings from June 2005

Parsing perl without Perl (sort of)

From:
J Matisse Enzer
Date:
June 10, 2005 08:54
Subject:
Parsing perl without Perl (sort of)
Message ID:
021483b56105e949d10049a00f55e38c@matisse.net
Adam Kennedy's new module PPI:

   http://www.perl.com/pub/a/2005/06/09/ppi.html
   http://search.cpan.org/perldoc?PPI

His module attempts to implement a parser that:
> ... creates a "round-trip" capability, parsing a file into an internal 
> model and back out again without moving a single white space character 
> out of place. Even if parts of a file are broken or badly formatted, 
> you can still change other parts of the file and save it correctly 
> without it changing anything you don't alter.
>
> Second, it makes the parser extremely safe and error-tolerant. Any 
> code open in an editor is there for a reason--generally because it 
> isn't finished yet, is broken, or needs changing. A document parser 
> can hit a problem, flag it, stumble for a character or so until it 
> finds something it recognizes, and then continue on.

I wonder if there are concepts in his implementation that have a 
bearing on Perl 6 design?

-------------------------------------------------------
Matisse Enzer <matisse@matisse.net>
http://www.matisse.net/  - http://www.eigenstate.net/
415-225-6703 (work/cellphone)
415-401-8325 (home)




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About