develooper Front page | perl.perl5.porters | Postings from June 2008

request for comments: a state machine for parsing Perl

Thread Next
From:
David Nicol
Date:
June 10, 2008 09:07
Subject:
request for comments: a state machine for parsing Perl
Message ID:
934f64a20806100907v696f66ddj95a852913ac0cfe8@mail.gmail.com
http://cpan.org/authors/id/D/DA/DAVIDNICO/ParsingPerl/

Not concerned with parsing the expressions, simply concerned with separating out
expressions / pod / quotes, towards improving on Text::Balanced for
source filtering purposes.

Have I left out any edges, aside from handwaving most of the whitespace?

here are what the nodes mean:
Start  start of program
Hashbang  the #!... line, if any
Between we are between expressions, wherever a pod section may start
Expecting one or more heredocs has been specified
In_expression a pod section would be misparsed as an assignment, but
no heredocs are expected
Heredoc we are in heretext
Need_quote after a quoting operator such as m,q,qq,qr,qx,s
Quoted inside a quote of some kind
Modifiable after a m or s
Comment after a #
Pod within pod
Error syntax error of any kind
Endable End of program would be okay here
End end of program

Thread Next


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