[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

request for comments: a state machine for parsing Perl



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


Follow-Ups from:
Ben Morrow <ben@morrow.me.uk>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]