You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This series 156 commits changes ExtUtils::ParseXS so that, instead of
intermixing parsing and code-emitting for each XSUB, it now parses each
XSUB into an Abstract Syntax Tree, and then walks the tree to emit all
the C code for that XSUB.
This makes the code generally more understandable and maintainable.
For now it still just discards each tree after the XSUB is parsed; in
future work, the AST will be extended so that it holds the whole file
(including all the XSUBs) rather than just the current XSUB.
This branch contains six types of commit.
1) For terminal AST nodes for keywords such as FOO, the old
ExtUtils::ParseXS::handle_FOO()
method is removed and a new ExtUtils::ParseXS::Node::FOO class is added
with parse() and as_code() methods which copy over the parsing and
code-emitting parts of the handle_FOO() method. For a few keywords like
INPUT which have values per line, both a Node::FOO and Node::FOO_line
class are created, with several FOO_line nodes being children of the FOO
node.
Note that doing the modifications for a single keyword often consists in
fact of several commits in sequence.
2) For higher-level nodes, a Node::foo class is created with parse() and
as_code() methods as before, but the contents of these methods are
typically populated by moving the relevant bits of code over from the
big ExtUtils::ParseXS::process_file() method.
3) Most of the state fields of the ExtUtils::ParseXS class (especially
all the xsub_foo ones) are removed, and similar fields added to the
various Node subclasses instead.
4) Fixups to ensure that all parse-time code is only in parse() methods
or associated helper functions, and similarly for as_code().
5) Various bug fixes related to state that should be per-CASE rather
than per-XSUB. Some of these bugs were pre-existing, some were
introduced during this branch.
6) General tidying-up, fixing code comments, adding POD etc.
0 commit comments