From d219a89d8d6ecc553851687967473665a78c77c8 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 13 Feb 2011 18:47:12 +0000 Subject: some more notes on an optimizer --- lib/Tree/Transform/XSLTish/Optimizer.pod | 58 +++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) (limited to 'lib/Tree/Transform/XSLTish/Optimizer.pod') diff --git a/lib/Tree/Transform/XSLTish/Optimizer.pod b/lib/Tree/Transform/XSLTish/Optimizer.pod index ce855d5..e721e72 100644 --- a/lib/Tree/Transform/XSLTish/Optimizer.pod +++ b/lib/Tree/Transform/XSLTish/Optimizer.pod @@ -1,4 +1,6 @@ -C is in fact C (so C does not count) +=head1 random notes + +C is in fact C (so C does not count) C can also be C (check that option) C<..> can also be C @@ -11,3 +13,57 @@ path contains C but no C, apply only at C upwar path contains C but no C<..>, start at C upwards (ok, C counts as 1 C) and go up to root what about C ?? + + +-------- + +an optimizer takes a match rule and adds three slots: + +=over 4 + +=item C + +a pattern to use instead of the C one + +=item C + +enum, specifying what the pattern (either C or C) +should return for this rule to be considered matching: + +=over 8 + +=item C + +the node we are applying the rule to + +=item C + +any node + +=back + +=item C + +the minimum depth (on the C axis) to test; 0 (or +C) means start at the current node, 1 means start at its +parent, and so on + +=item C + +the maximum depth (on the C axis) to test; +C means "unlimited", i.e. stop only at the document root + +=back + +So: + +C<< match => 'foo' >> or C<< match => '//foo' >> would produce C<< +opt_pattern => 'self::foo', min_depth => 0, max_depth => 0 >> + +C<< match => 'foo/bar' >> or C<< match => '//foo/bar' >> would produce +C<< opt_pattern => 'self::bar/parent::foo', min_depth => 0, max_depth +=> 0 >> + +--------- + +we need a proper structure matcher! -- cgit v1.2.3