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

request for comments: a state machine for parsing Perl

Thread Next
David Nicol
June 10, 2008 09:07
request for comments: a state machine for parsing Perl
Message ID:

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About