- (`Left ** q),
- (q, [ test => phi;
- QNameSet.any => (`Right ** q) ]) :: trans,
- states
-
- | Descendant self ->
- (if self then (`Epsilon ** q) else (`Left ** q)),
- (q, [ test => phi;
- QNameSet.any => (`Left ** q) %% (`Right ** q) ]) :: trans,
- states
+ (F.first_child q,
+ (q, [ test => phi %% phi_attr;
+ QNameSet.any => F.next_sibling q ]) :: trans,
+ states)
+
+ | Descendant false ->
+ (F.first_child q,
+ (q, [ test => phi %% phi_attr;
+ QNameSet.any => F.first_child q ++ F.next_sibling q;
+ ]) :: trans,
+ states)
+ | Descendant true ->
+ let q' = State.make () in
+ (F.or_ (F.stay q) (F.first_child q'),
+ (q', [ test => phi %% phi_attr;
+ QNameSet.any => F.first_child q' ++ F.next_sibling q';
+ ])::
+ (q, [ test => phi %% phi_attr]):: trans,
+ states)