Merge lp:~zorba-coders/zorba/structuralrelationships2 into lp:zorba
- structuralrelationships2
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~zorba-coders/zorba/structuralrelationships2 |
Merge into: | lp:zorba |
Diff against target: |
7696 lines (+7054/-35) 51 files modified
ChangeLog (+2/-0) modules/com/zorba-xquery/www/modules/CMakeLists.txt (+2/-0) modules/com/zorba-xquery/www/modules/node-position.xq (+524/-0) src/context/static_context.cpp (+4/-0) src/context/static_context.h (+1/-0) src/functions/library.cpp (+2/-0) src/functions/pregenerated/func_node_position.cpp (+584/-0) src/functions/pregenerated/func_node_position.h (+361/-0) src/functions/pregenerated/function_enum.h (+24/-0) src/runtime/nodes/node_position_impl.cpp (+756/-0) src/runtime/nodes/pregenerated/node_position.cpp (+710/-0) src/runtime/nodes/pregenerated/node_position.h (+858/-0) src/runtime/spec/mappings.xml (+5/-1) src/runtime/spec/nodes/node_position.xml (+439/-0) src/runtime/visitors/pregenerated/planiter_visitor.h (+120/-0) src/runtime/visitors/pregenerated/printer_visitor.cpp (+337/-0) src/runtime/visitors/pregenerated/printer_visitor.h (+72/-0) src/store/api/item.h (+84/-0) src/store/api/store.h (+9/-0) src/store/naive/atomic_items.cpp (+719/-0) src/store/naive/atomic_items.h (+185/-0) src/store/naive/item.cpp (+127/-0) src/store/naive/loader_fast.cpp (+3/-5) src/store/naive/node_items.cpp (+73/-4) src/store/naive/node_items.h (+6/-1) src/store/naive/ordpath.cpp (+94/-0) src/store/naive/ordpath.h (+11/-4) src/store/naive/pul_primitives.cpp (+21/-19) src/store/naive/simple_item_factory.cpp (+31/-1) src/store/naive/simple_item_factory.h (+10/-0) src/store/naive/simple_store.cpp (+42/-0) src/store/naive/simple_store.h (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_1.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_1_parsed.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_2.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_2_parsed.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_3.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_3_parsed.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_4.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_4_parsed.xml.res (+2/-0) test/rbkt/ExpQueryResults/zorba/nodes/position_err.xml.res (+6/-0) test/rbkt/Queries/zorba/nodes/position.xml (+15/-0) test/rbkt/Queries/zorba/nodes/position_1.xq (+97/-0) test/rbkt/Queries/zorba/nodes/position_1_parsed.xq (+98/-0) test/rbkt/Queries/zorba/nodes/position_2.xq (+157/-0) test/rbkt/Queries/zorba/nodes/position_2_parsed.xq (+156/-0) test/rbkt/Queries/zorba/nodes/position_3.xq (+32/-0) test/rbkt/Queries/zorba/nodes/position_3_parsed.xq (+34/-0) test/rbkt/Queries/zorba/nodes/position_4.xq (+84/-0) test/rbkt/Queries/zorba/nodes/position_4_parsed.xq (+81/-0) test/rbkt/Queries/zorba/nodes/position_err.xq (+60/-0) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/structuralrelationships2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Markos Zaharioudakis | Approve | ||
Review via email: mp+78395@code.launchpad.net |
This proposal has been superseded by a proposal from 2011-11-02.
Commit message
New module node-structural
This module allows to retrieve an xs:anyURI representation of a
node position. This module also defines function that determine:
(1) the relationship between two nodes (e.g. if one is the ancestor
of another) and (2) properties of a node (e.g. its level in the tree)
given the corresponding nodes positions.
Description of the change
New module node-structural
This module allows to retrieve an xs:anyURI representation of a
node position. This module also defines function that determine:
(1) the relationship between two nodes (e.g. if one is the ancestor
of another) and (2) properties of a node (e.g. its level in the tree)
given the corresponding nodes positions.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job structuralrelat
All tests succeeded!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting does not meet specified criteria. Required: Approve > 0, Disapprove < 1. Got: 1 Pending.
Matthias Brantner (matthias-brantner) wrote : | # |
Not mentioned in ChangeLog
function name too long? node-structural
difference between following-
zerr:: => zerr:
creating a structural URI may raise an error. However, non of the functions of the module catches the error and adds a query location to it.
Federico Cavalieri (fcavalieri) wrote : | # |
> Not mentioned in ChangeLog
Fixed
> function name too long? node-structural
Any suggestions?
node-information
node-position
node-uri
structural-
>
> difference between following-
> always in document order.
>
If we consider a node n in a document d:
following-of: the nodes which start tag occurs after the end tag of n and are in d. Ie. the following axis in Xpath
"From the spec ... the following axis contains all nodes that are descendants of the root of the tree in which the context node is found, are not descendants of the context node, and occur after the context node in document order"
following-in document-order-of: the nodes which start tag occurs after the start tag of n and are in d, but also nodes in other documents. Ie the << operator in Xpath
"From the spec ... The relative order of nodes in distinct trees is stable but implementation-
> zerr:: => zerr:
Fixed
>
> creating a structural URI may raise an error. However, non of the functions of
> the module catches the error and adds a query location to it.
Fixed and added new test
Matthias Brantner (matthias-brantner) wrote : | # |
> > function name too long? node-structural
>
> Any suggestions?
>
> node-information
> node-position
> node-uri
> structural-
I like node-information as name for both - the module and the function.
That's at least consistent with the node-reference module and function.
Federico Cavalieri (fcavalieri) wrote : | # |
> > > function name too long? node-structural
> >
> > Any suggestions?
> >
> > node-information
> > node-position
> > node-uri
> > structural-
> I like node-information as name for both - the module and the function.
> That's at least consistent with the node-reference module and function.
Fixed
Zorba Build Bot (zorba-buildbot) wrote : | # |
Attempt to merge into lp:zorba failed due to conflicts:
text conflict in ChangeLog
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Markos Zaharioudakis (markos-za) wrote : | # |
> > > > function name too long? node-structural
> > >
> > > Any suggestions?
> > >
> > > node-information
> > > node-position
> > > node-uri
> > > structural-
> > I like node-information as name for both - the module and the function.
> > That's at least consistent with the node-reference module and function.
>
> Fixed
I dislike the name "node-information" because it conveys no information about what the module is doing. I think "node-position", though not perfect, is the most accurate one. The comments in the .xq file speak of "node positions" as well.
Matthias Brantner (matthias-brantner) wrote : | # |
> > > > > function name too long? node-structural
> > > >
> > > > Any suggestions?
> > > >
> > > > node-information
> > > > node-position
> > > > node-uri
> > > > structural-
> > > I like node-information as name for both - the module and the function.
> > > That's at least consistent with the node-reference module and function.
> >
> > Fixed
>
> I dislike the name "node-information" because it conveys no information about
> what the module is doing. I think "node-position", though not perfect, is the
> most accurate one. The comments in the .xq file speak of "node positions" as
> well.
I'm fine with node-position.
Federico Cavalieri (fcavalieri) wrote : | # |
Renamed the module and function to node-position.
How should I replace "structural information" in the functions comments?
"node position uri"?
Markos Zaharioudakis (markos-za) wrote : | # |
> Renamed the module and function to node-position.
> How should I replace "structural information" in the functions comments?
> "node position uri"?
I rewrote somewhat the introductory comment in node-position.xq. Here is the new version:
(:~
: This module provides a function (np:node-position) that, given a node,
: returns positional information about the node in the form of an xs:anyURI
: item. The module also defines functions that use such positional information
: to determine: (1) positional relationships between two nodes (e.g. if one
: is the ancestor of another) and (2) positional properties of a single node
: (e.g. its level in the tree).
:
: Within this module, the term "node position" will be used to refer to an
: xs:anyURI item that is returned by the np:node-position function.
:
: @author Federico Cavalieri
:)
If everybody agrees with my rewrite, then the answer to your question is "node position".
Markos Zaharioudakis (markos-za) wrote : | # |
Federico, I don't think it is necessary to put the position uris into the uri pool because they are not likely to be shared by multiple data items so you won't really be saving much space (you may be actually end-up wasting space because the uri pool storage has some overhead by itself). Do you agree?
Markos Zaharioudakis (markos-za) wrote : | # |
Should StructuralAnyUr
Federico Cavalieri (fcavalieri) wrote : | # |
> Should StructuralAnyUr
> an attribute?
Yes, you are right! Descendant doesn't include attributes.
May I add a in-subtree-of function with the same semantics as the current descendant?
Thanks
Federico
Federico Cavalieri (fcavalieri) wrote : | # |
> Federico, I don't think it is necessary to put the position uris into the uri
> pool because they are not likely to be shared by multiple data items so you
> won't really be saving much space (you may be actually end-up wasting space
> because the uri pool storage has some overhead by itself). Do you agree?
I agree.
Fixing it.
Thanks
Federico
Markos Zaharioudakis (markos-za) wrote : | # |
> > Should StructuralAnyUr
> not
> > an attribute?
>
> Yes, you are right! Descendant doesn't include attributes.
>
> May I add a in-subtree-of function with the same semantics as the current
> descendant?
>
> Thanks
> Federico
It's ok with me, if it is something that you need in your module.
Federico Cavalieri (fcavalieri) wrote : | # |
Hi Markos,
i noticed that the parse uri function now uses strtoul without checking errno with the following effects:
A missing component is considered 0:
np:in-same-
Out of ulong value-space == ULONG_MAX
np:in-same-
Is this ok?
Thanks
Federico
Markos Zaharioudakis (markos-za) wrote : | # |
> Hi Markos,
> i noticed that the parse uri function now uses strtoul without checking errno
> with the following effects:
>
> A missing component is considered 0:
> np:in-same-
> ->true
>
>
> Out of ulong value-space == ULONG_MAX
> np:in-same-
> 333333333333333
> :anyURI(
> 222222222222222
>
> Is this ok?
>
> Thanks
> Federico
No, it not ok of course. It's a bug (and a similar bug existed before the switch to strtoul as well). I think I have fixed it now (and added the above 2 tests in position_err.xq). Take a look.
Federico Cavalieri (fcavalieri) wrote : | # |
> > Hi Markos,
> > i noticed that the parse uri function now uses strtoul without checking
> errno
> > with the following effects:
> >
> > A missing component is considered 0:
> > np:in-same-
> > ->true
> >
> >
> > Out of ulong value-space == ULONG_MAX
> > np:in-same-tree-
> of(xs:anyURI(
> >
> 333333333333333
> >
> :anyURI(
> > 222222222222222
> >
> > Is this ok?
> >
> > Thanks
> > Federico
>
> No, it not ok of course. It's a bug (and a similar bug existed before the
> switch to strtoul as well). I think I have fixed it now (and added the above 2
> tests in position_err.xq). Take a look.
Ok, thanks.
I think there is a bug in level because the ordpath of a document node as root contains a different
number of components than those of another kind of node as root. see ctor of ordpath.
Why
Federico Cavalieri (fcavalieri) wrote : | # |
Connection dropped...
Do you know why document nodes have a component less than any other kind of node when they are the root of their tree?
Another question, tree ids are expected to be unique among all tree currently in the store, or not?
Thanks,
Federico
Markos Zaharioudakis (markos-za) wrote : | # |
> Connection dropped...
>
> Do you know why document nodes have a component less than any other kind of
> node when they are the root of their tree?
>
I finally found out what you meant (the code is in the OrdPathNode ctor, not the OrdPath ctor).
I think the reason why element node as root has an extra component in its ordpath is to support fn:put on element nodes. The w3c tests require that whatever is fn:put-ed, is retrievable by fn:doc(), which means that I have to put a doc node as parent to the element node. But I think this can be fixed, because the element node is going to be copied anyway.
> Another question, tree ids are expected to be unique among all tree currently
> in the store, or not?
Yes, this is the assumption, although it is not really enforced in the simplestore. Why do you ask?
>
> Thanks,
> Federico
Markos Zaharioudakis (markos-za) wrote : | # |
Federico, I think the documentation in node-position.xq needs some more work. I can do this, but first we must agree on what is exactly the functionality and the assumptions about node positions that you rely on. For example, in the documentation of the np:node-position() function, you write:
"The returned URI is stable, i.e. it does not change when other nodes are inserted, deleted or modified"
Do you rely on this? If not, then we shouldn't write it down.
Also, look at the following rewrite of the ancestor-of function. Do you agree with it?
(:~
: Determines whether the node position that is given as second argument is
: an ancestor of the node position is given as first argument.
:
: If the two positions were obtained within the same snapshot S, then the
: result of the function applies to the corresponding nodes as well, that
: is, within snapshot S, the second node is an ancestor of the first.
: Otherwise, the result of the function does not imply anything about the
: positional relationship of the two nodes.
:
: @param $pos1 the potential descendant node position
: @param $pos2 the potential ancestor node position
:
: @return true if the node position $pos2 is an ancestor of the node position
: $pos1; false otherwise.
:
: @error zerr:ZAPI0028 if one of the given URI is not a valid node
: position computed by the <tt>np:
:)
declare function np:ancestor-of(
$pos1 as xs:anyURI,
$pos2 as xs:anyURI) as xs:boolean external;
Federico Cavalieri (fcavalieri) wrote : | # |
> > Connection dropped...
> >
> > Do you know why document nodes have a component less than any other kind of
> > node when they are the root of their tree?
> >
>
> I finally found out what you meant (the code is in the OrdPathNode ctor, not
> the OrdPath ctor).
> I think the reason why element node as root has an extra component in its
> ordpath is to support fn:put on element nodes. The w3c tests require that
> whatever is fn:put-ed, is retrievable by fn:doc(), which means that I have to
> put a doc node as parent to the element node. But I think this can be fixed,
> because the element node is going to be copied anyway.
Sorry for the wrong name. I wrote while I was travelling and I made a mistake in
remembering the class name. Hope you didn't lose time figuring that out.
And thanks for making the change.
>
> > Another question, tree ids are expected to be unique among all tree
> currently
> > in the store, or not?
>
> Yes, this is the assumption, although it is not really enforced in the
> simplestore. Why do you ask?
>
At the time I wrote that I was experiencing some bugs in my main branch after trying to merge this one into.
Specifically i was failing to check if two nodes were in the same tree.
Apparently node in different trees had the same tree id.
Since then I investigated the issue and found out that treeids are unique only within their collection or within the collection-less nodes. The store seems to be designed with this in mind and either checks if the tree itself is the same or check the collectionid first.
This behaviour is because XmlTree:
theId = collection-
and not:
theId = GET_STORE(
and each collection in turn uses an internally incremented integer starting from 0.
This make sense for me, since it limit the risk of going out of range with the integers, but also means
that almost every single function I wrote should also check the collection id to determine if two nodes are in the same tree. I am doing this modification right now.
Federico
> >
> > Thanks,
> > Federico
Cheers
Federico
Federico Cavalieri (fcavalieri) wrote : | # |
> Federico, I think the documentation in node-position.xq needs some more work.
> I can do this, but first we must agree on what is exactly the functionality
> and the assumptions about node positions that you rely on. For example, in the
> documentation of the np:node-position() function, you write:
>
> "The returned URI is stable, i.e. it does not change when other nodes are
> inserted, deleted or modified"
>
> Do you rely on this? If not, then we shouldn't write it down.
Yes, at the moment I am relying on it. It could be possible however, with some
limitations, to lift off this requirements. I have not a clear idea at the moment
of the limitations involved or the amount of work required to do so. If you think
is bad to promise that uri are stable I can look into it.
>
> Also, look at the following rewrite of the ancestor-of function. Do you agree
> with it?
>
> (:~
> : Determines whether the node position that is given as second argument is
> : an ancestor of the node position is given as first argument.
> :
> : If the two positions were obtained within the same snapshot S, then the
> : result of the function applies to the corresponding nodes as well, that
> : is, within snapshot S, the second node is an ancestor of the first.
> : Otherwise, the result of the function does not imply anything about the
> : positional relationship of the two nodes.
> :
> : @param $pos1 the potential descendant node position
> : @param $pos2 the potential ancestor node position
> :
> : @return true if the node position $pos2 is an ancestor of the node position
> : $pos1; false otherwise.
> :
> : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> : position computed by the <tt>np:
> :)
> declare function np:ancestor-of(
> $pos1 as xs:anyURI,
> $pos2 as xs:anyURI) as xs:boolean external;
Yes, I agree with it. When I wrote this I was a little scared to say that a
structural relationship was ancestor of another, but now that they are called
node positions it should be ok. I am doing it.
Federico
Markos Zaharioudakis (markos-za) wrote : | # |
> > Federico, I think the documentation in node-position.xq needs some more
> work.
> > I can do this, but first we must agree on what is exactly the functionality
> > and the assumptions about node positions that you rely on. For example, in
> the
> > documentation of the np:node-position() function, you write:
> >
> > "The returned URI is stable, i.e. it does not change when other nodes are
> > inserted, deleted or modified"
> >
> > Do you rely on this? If not, then we shouldn't write it down.
>
> Yes, at the moment I am relying on it. It could be possible however, with some
> limitations, to lift off this requirements. I have not a clear idea at the
> moment
> of the limitations involved or the amount of work required to do so. If you
> think
> is bad to promise that uri are stable I can look into it.
>
It's ok if you rely on this, but I am not sure I understand what it means exactly. Obviously, it is not entirely correct in the current implementation: Consider 2 nodes P and C, where C is a child of P; if P is deleted, the result of node-position(C) before P's deletion is different than after P's deletion (because P and its subtree become part of a new tree). In other words, the node position of C changes when P is deleted. Maybe we should say that the node position of a node is stable as long as the node remains in its current collection and tree?
Second, when you say that you rely on it, does it mean that you may need to compare 2 node positions that were obtained in different snapshots? And if so, do you expect that the result of such a comparison says anything about the positional relationship of the two corresponding nodes at any point in time? (in other words, is what I wrote for the is-ancestor function really correct?)
> >
> > Also, look at the following rewrite of the ancestor-of function. Do you
> agree
> > with it?
> >
> > (:~
> > : Determines whether the node position that is given as second argument is
> > : an ancestor of the node position is given as first argument.
> > :
> > : If the two positions were obtained within the same snapshot S, then the
> > : result of the function applies to the corresponding nodes as well, that
> > : is, within snapshot S, the second node is an ancestor of the first.
> > : Otherwise, the result of the function does not imply anything about the
> > : positional relationship of the two nodes.
> > :
> > : @param $pos1 the potential descendant node position
> > : @param $pos2 the potential ancestor node position
> > :
> > : @return true if the node position $pos2 is an ancestor of the node
> position
> > : $pos1; false otherwise.
> > :
> > : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> > : position computed by the <tt>np:
> > :)
> > declare function np:ancestor-of(
> > $pos1 as xs:anyURI,
> > $pos2 as xs:anyURI) as xs:boolean external;
>
> Yes, I agree with it. When I wrote this I was a little scared to say that a
> structural relationship was ancestor of another, but now that they are called
> node positions it should be ok. I am doing it.
>
> Federico
Federico Cavalieri (fcavalieri) wrote : | # |
> >"The returned URI is stable, i.e. it does not change when other nodes are
> > inserted, deleted or modified"
> Obviously, it is not entirely correct in the current implementation:
> Consider 2 nodes P and C, where C is a child of P; if P is deleted, the result
> of node-position(C) before P's deletion is different than after P's deletion
> (because P and its subtree become part of a new tree). In other words, the
> node position of C changes when P is deleted. Maybe we should say that the
> node position of a node is stable as long as the node remains in its current
> collection and tree?
Yes, you are right. However even with the limitation you propose another problem
would arise in the current implementation. (ie. TEXT_ORDPATH off)
Consider 3 nodes C1 C2 and C3 children of a node P. Assume that C2 is a text node.
This means that its ordpath is computed on the fly. If C1 is labeled 1.1 and C3 1.3,
the label of C2 would be 1.2.1. Now if you remove C3 and compute again the label of
C2 it would be 1.3. That is not stable even if it remains in the same collection and
tree.
I am removing the whole phrase.
> Second, when you say that you rely on it, does it mean that you may need to
> compare 2 node positions that were obtained in different snapshots? And if so,
> do you expect that the result of such a comparison says anything about the
> positional relationship of the two corresponding nodes at any point in time?
> (in other words, is what I wrote for the is-ancestor function really correct?)
I am (was?*) relying on the fact that the label of two nodes belonging to the
same tree do not change over time. I am (was?*) interseted in some of the relations
(ie. ancestor-
computation.
* Just noticed that TEXT_ORDPATH off means that in the interested cases I can no longer
store some the ordpaths in the PUL, so the problem should not exist anymore.
>
>
>
> > >
> > > Also, look at the following rewrite of the ancestor-of function. Do you
> > agree
> > > with it?
> > >
> > > (:~
> > > : Determines whether the node position that is given as second argument
> is
> > > : an ancestor of the node position is given as first argument.
> > > :
> > > : If the two positions were obtained within the same snapshot S, then the
> > > : result of the function applies to the corresponding nodes as well, that
> > > : is, within snapshot S, the second node is an ancestor of the first.
> > > : Otherwise, the result of the function does not imply anything about the
> > > : positional relationship of the two nodes.
> > > :
> > > : @param $pos1 the potential descendant node position
> > > : @param $pos2 the potential ancestor node position
> > > :
> > > : @return true if the node position $pos2 is an ancestor of the node
> > position
> > > : $pos1; false otherwise.
> > > :
> > > : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> > > : position computed by the <tt>np:
> > > :)
> > > declare function np:ancestor-of(
> > > $pos1 as xs:anyURI,
> > > $pos2 as xs:anyURI) as xs:boolean external;
> >
> > Yes, I agree with it. When I...
Federico Cavalieri (fcavalieri) wrote : | # |
> Second, when you say that you rely on it, does it mean that you may need to
> compare 2 node positions that were obtained in different snapshots? And if so,
> do you expect that the result of such a comparison says anything about the
> positional relationship of the two corresponding nodes at any point in time?
> (in other words, is what I wrote for the is-ancestor function really correct?)
What you write for the ancestor function (which i copied also in the other functions)
is correct although, given the current implementation, extra information would be present.
For the sake of curiosity i tried to write the most precise definition possible,
but I don't think that putting this into the methods comment would be an improvement:
The result of the function applies to the corresponding nodes as well,
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.
Follow/preceed in document order would be:
If the two positions correspond to sibling text nodes and both
positions were obtained in the same snapshot, then the function also applies
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.
If the two positions correspond to sibling text nodes and the two
positions were obtained in different snapshots, then it is impossible to determine
if the node corresponding to the first position is a predecessor of the node
corresponding to the second position.
In all other cases, the result of the function applies to the corresponding
nodes as well, in each snapshot S in which they belong to the same tree and
collection in which they belonged when the node position was computed.
Cheers,
Federico
Markos Zaharioudakis (markos-za) : | # |
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Attempt to merge into lp:zorba failed due to conflicts:
text conflict in ChangeLog
text conflict in src/store/
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Unmerged revisions
Preview Diff
1 | === modified file 'ChangeLog' |
2 | --- ChangeLog 2011-11-02 15:48:06 +0000 |
3 | +++ ChangeLog 2011-11-02 17:26:24 +0000 |
4 | @@ -57,6 +57,8 @@ |
5 | * Fixed bug #872796 (validate-in-place can interfere with other update primitives) |
6 | * Fixed bug #872799 (validate-in-place can set incorrect types) |
7 | * Fixed bug #855715 (Invalid escaped characters in regex not caught) |
8 | + * New node-position module. This module allows to obtain a representation of a node position, which |
9 | + can be used to assess structural relationships with other nodes. |
10 | * Fixed bug #872502 (validation of the JSON module xqdoc fails) |
11 | |
12 | version 2.0.1 |
13 | |
14 | === modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt' |
15 | --- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2011-09-30 08:08:13 +0000 |
16 | +++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2011-11-02 17:26:24 +0000 |
17 | @@ -46,6 +46,8 @@ |
18 | URI "http://www.zorba-xquery.com/modules/math") |
19 | DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0 |
20 | URI "http://www.zorba-xquery.com/modules/node-reference") |
21 | +DECLARE_ZORBA_MODULE(FILE node-position.xq VERSION 2.0 |
22 | + URI "http://www.zorba-xquery.com/modules/node-position") |
23 | DECLARE_ZORBA_MODULE(FILE node.xq VERSION 2.0 |
24 | URI "http://www.zorba-xquery.com/modules/node") |
25 | DECLARE_ZORBA_MODULE(FILE project_xqdoc.xq VERSION 2.0 |
26 | |
27 | === added file 'modules/com/zorba-xquery/www/modules/node-position.xq' |
28 | --- modules/com/zorba-xquery/www/modules/node-position.xq 1970-01-01 00:00:00 +0000 |
29 | +++ modules/com/zorba-xquery/www/modules/node-position.xq 2011-11-02 17:26:24 +0000 |
30 | @@ -0,0 +1,524 @@ |
31 | +xquery version "1.0"; |
32 | +(: |
33 | + : Copyright 2006-2011 The FLWOR Foundation. |
34 | + : |
35 | + : Licensed under the Apache License, Version 2.0 (the "License"); |
36 | + : you may not use this file except in compliance with the License. |
37 | + : You may obtain a copy of the License at |
38 | + : |
39 | + : http://www.apache.org/licenses/LICENSE-2.0 |
40 | + : |
41 | + : Unless required by applicable law or agreed to in writing, software |
42 | + : distributed under the License is distributed on an "AS IS" BASIS, |
43 | + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
44 | + : See the License for the specific language governing permissions and |
45 | + : limitations under the License. |
46 | + :) |
47 | + |
48 | +(:~ |
49 | + : This module provides a function (np:node-position) that, given a node, |
50 | + : returns positional information about the node in the form of an xs:anyURI |
51 | + : item. The module also defines functions that use such positional information |
52 | + : to determine: (1) positional relationships between two nodes (e.g. if one |
53 | + : is the ancestor of another) and (2) positional properties of a single node |
54 | + : (e.g. its level in the tree). |
55 | + : |
56 | + : Within this module, the term "node position" will be used to refer to an |
57 | + : xs:anyURI item that is returned by the np:node-position function. |
58 | + : |
59 | + : @author Federico Cavalieri, Markos Zaharioudakis |
60 | + : |
61 | + : @project XDM/node |
62 | + :) |
63 | +module namespace np = "http://www.zorba-xquery.com/modules/node-position"; |
64 | + |
65 | +declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
66 | +declare option ver:module-version "2.0"; |
67 | + |
68 | +(:~ |
69 | + : Return a URI item containing positional information for a given node. |
70 | + : |
71 | + : <p>Within a snapshot, each has a different positional URI. However, |
72 | + : different nodes in different snapshots might have the same URI.</p> |
73 | + : |
74 | + : @param $arg the node for which the positional information URI |
75 | + : should be computed |
76 | + : |
77 | + : @return the opaque positional information URI of the node. |
78 | + :) |
79 | +declare function np:node-position( |
80 | + $arg as node() |
81 | +) as xs:anyURI external; |
82 | + |
83 | +(:~ |
84 | + : Determines whether the node position given as second argument is |
85 | + : an ancestor of the node position given as first argument. |
86 | + : |
87 | + : If the two positions were obtained within the same snapshot S, then the |
88 | + : result of the function applies to the corresponding nodes as well, that |
89 | + : is, within snapshot S, the second node is an ancestor of the first. |
90 | + : Otherwise, the result of the function does not imply anything about the |
91 | + : positional relationship of the two nodes. |
92 | + : |
93 | + : @param $n-pos1 the potential descendant node position |
94 | + : @param $n-pos2 the potential ancestor node position |
95 | + : |
96 | + : @return true if the node position $n-pos2 is an ancestor of the node position |
97 | + : $n-pos1; false otherwise. |
98 | + : |
99 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
100 | + : position computed by the <tt>np:node-position</tt> function. |
101 | + :) |
102 | +declare function np:ancestor-of( |
103 | + $pos1 as xs:anyURI, |
104 | + $pos2 as xs:anyURI) as xs:boolean external; |
105 | + |
106 | +(:~ |
107 | + : Determines whether the node position given as second argument is |
108 | + : a descendant of the node position given as first argument. |
109 | + : |
110 | + : If the two positions were obtained within the same snapshot S, then the |
111 | + : result of the function applies to the corresponding nodes as well, that |
112 | + : is, within snapshot S, the second node is a descendant of the first. |
113 | + : Otherwise, the result of the function does not imply anything about the |
114 | + : positional relationship of the two nodes. |
115 | + : |
116 | + : @param $n-pos1 the potential ancestor node position |
117 | + : @param $n-pos2 the potential descendant node position |
118 | + : |
119 | + : @return true if the node position $n-pos2 is a descendant of the node |
120 | + : position $n-pos1; false otherwise. |
121 | + : |
122 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
123 | + : position computed by the <tt>np:node-position</tt> function. |
124 | + :) |
125 | +declare function np:descendant-of( |
126 | + $n-pos1 as xs:anyURI, |
127 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
128 | + |
129 | +(:~ |
130 | + : Determines whether the node position given as second argument belongs |
131 | + : to the subtree rooted at the node position given as first argument. |
132 | + : |
133 | + : If the two positions were obtained within the same snapshot S, then the |
134 | + : result of the function applies to the corresponding nodes as well, that |
135 | + : is, within snapshot S, the second node belongs to the subtree rooted at the |
136 | + : first. Otherwise, the result of the function does not imply anything about |
137 | + : the positional relationship of the two nodes. |
138 | + : |
139 | + : This function differs from np:descendant-of in the way it treats attribute |
140 | + : nodes. np:descendant-of follows the XQuery/XPath specification for the |
141 | + : descendant axis, and as a result, it does not consider attributes as |
142 | + : descendants of any nodes; it will always return false if $n-pos2 was |
143 | + : obtained from an attribute node.In contrast, np:in-subtree-of will return |
144 | + : true if $n-pos2 was obtained from an attribute node that appeared in the |
145 | + : subtree of the node that $n-pos1 was obtained from. |
146 | + : |
147 | + : @param $n-pos1 the potential subtree root node position |
148 | + : @param $n-pos2 the potential node in the subtree node position |
149 | + : |
150 | + : @return true if the node position $n-pos2 belongs to the subtree rooted at |
151 | + : the node position $n-pos1; false otherwise. |
152 | + : |
153 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
154 | + : position computed by the <tt>np:node-position</tt> function. |
155 | + :) |
156 | +declare function np:in-subtree-of( |
157 | + $n-pos1 as xs:anyURI, |
158 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
159 | + |
160 | +(:~ |
161 | + : Determines whether the node position given as second argument is |
162 | + : the parent of the node position given as first argument. |
163 | + : |
164 | + : If the two positions were obtained within the same snapshot S, then the |
165 | + : result of the function applies to the corresponding nodes as well, that |
166 | + : is, within snapshot S, the second node is the parent of the first. |
167 | + : Otherwise, the result of the function does not imply anything about the |
168 | + : positional relationship of the two nodes. |
169 | + : |
170 | + : @param $n-pos1 the potential child node position |
171 | + : @param $n-pos2 the potential parent node position |
172 | + : |
173 | + : @return true if the node position $n-pos2 is the parent of the node position |
174 | + : $n-pos1; false otherwise. |
175 | + : |
176 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
177 | + : position computed by the <tt>np:node-position</tt> function. |
178 | + :) |
179 | +declare function np:parent-of( |
180 | + $n-pos1 as xs:anyURI, |
181 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
182 | + |
183 | +(:~ |
184 | + : Determines whether the node position given as second argument is |
185 | + : a child of the node position given as first argument. |
186 | + : |
187 | + : If the two positions were obtained within the same snapshot S, then the |
188 | + : result of the function applies to the corresponding nodes as well, that |
189 | + : is, within snapshot S, the second node is a child of the first. |
190 | + : Otherwise, the result of the function does not imply anything about the |
191 | + : positional relationship of the two nodes. |
192 | + : |
193 | + : @param $n-pos1 the potential parent node position |
194 | + : @param $n-pos2 the potential child node position |
195 | + : |
196 | + : @return true if the node position $n-pos2 is a child of the node position |
197 | + : $n-pos1; false otherwise. |
198 | + : |
199 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
200 | + : position computed by the <tt>np:node-position</tt> function. |
201 | + :) |
202 | +declare function np:child-of( |
203 | + $n-pos1 as xs:anyURI, |
204 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
205 | + |
206 | +(:~ |
207 | + : Determines whether the node position given as second argument is |
208 | + : an attribute of the node position given as first argument. |
209 | + : |
210 | + : If the two positions were obtained within the same snapshot S, then the |
211 | + : result of the function applies to the corresponding nodes as well, that |
212 | + : is, within snapshot S, the second node is an attribute of the first. |
213 | + : Otherwise, the result of the function does not imply anything about the |
214 | + : positional relationship of the two nodes. |
215 | + : |
216 | + : @param $n-pos1 the potential parent node position |
217 | + : @param $n-pos2 the potential attribute node position |
218 | + : |
219 | + : @return true if the node position $n-pos2 is an attribute of the node |
220 | + : position $n-pos1; false otherwise. |
221 | + : |
222 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
223 | + : position computed by the <tt>np:node-position</tt> function. |
224 | + :) |
225 | +declare function np:attribute-of( |
226 | + $n-pos1 as xs:anyURI, |
227 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
228 | + |
229 | +(:~ |
230 | + : Determines whether the node position given as second argument is |
231 | + : a following-sibling of the node position given as first argument. |
232 | + : |
233 | + : If the two positions were obtained within the same snapshot S, then the |
234 | + : result of the function applies to the corresponding nodes as well, that |
235 | + : is, within snapshot S, the second node is a following-sibling of the first. |
236 | + : Otherwise, the result of the function does not imply anything about the |
237 | + : positional relationship of the two nodes. |
238 | + : |
239 | + : @param $n-pos1 the potential preceding-sibling node position |
240 | + : @param $n-pos2 the potential following-sibling node position |
241 | + : |
242 | + : @return true if the node position $n-pos2 is a following-sibling of the node |
243 | + : position $n-pos1; false otherwise. |
244 | + : |
245 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
246 | + : position computed by the <tt>np:node-position</tt> function. |
247 | + :) |
248 | +declare function np:following-sibling-of( |
249 | + $n-pos1 as xs:anyURI, |
250 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
251 | + |
252 | +(:~ |
253 | + : Determines whether the node position given as second argument is |
254 | + : a preceding-sibling of the node position given as first argument. |
255 | + : |
256 | + : If the two positions were obtained within the same snapshot S, then the |
257 | + : result of the function applies to the corresponding nodes as well, that |
258 | + : is, within snapshot S, the second node is a preceding-sibling of the first. |
259 | + : Otherwise, the result of the function does not imply anything about the |
260 | + : positional relationship of the two nodes. |
261 | + : |
262 | + : @param $n-pos1 the potential following-sibling node position |
263 | + : @param $n-pos2 the potential preceding-sibling node position |
264 | + : |
265 | + : @return true if the node position $n-pos2 is a preceding-sibling of the node |
266 | + : position $n-pos1; false otherwise. |
267 | + : |
268 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
269 | + : position computed by the <tt>np:node-position</tt> function. |
270 | + :) |
271 | +declare function np:preceding-sibling-of( |
272 | + $n-pos1 as xs:anyURI, |
273 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
274 | + |
275 | +(:~ |
276 | + : Determines whether two node positions are siblings. |
277 | + : |
278 | + : If the two positions were obtained within the same snapshot S, then the |
279 | + : result of the function applies to the corresponding nodes as well, that |
280 | + : is, within snapshot S, the second node is a sibling of the first. |
281 | + : Otherwise, the result of the function does not imply anything about the |
282 | + : positional relationship of the two nodes. |
283 | + : |
284 | + : @param $n-pos1 a node position |
285 | + : @param $n-pos2 a node position |
286 | + : |
287 | + : @return true if the two node positions $n-pos1 and $n-pos2 are siblings; |
288 | + : false otherwise. |
289 | + : |
290 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
291 | + : position computed by the <tt>np:node-position</tt> function. |
292 | + :) |
293 | +declare function np:sibling-of( |
294 | + $n-pos1 as xs:anyURI, |
295 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
296 | + |
297 | +(:~ |
298 | + : Determines whether the node position given as second argument is |
299 | + : following the node position given as first argument. |
300 | + : |
301 | + : If the two positions were obtained within the same snapshot S, then the |
302 | + : result of the function applies to the corresponding nodes as well, that |
303 | + : is, within snapshot S, the second node is following the first. |
304 | + : Otherwise, the result of the function does not imply anything about the |
305 | + : positional relationship of the two nodes. |
306 | + : |
307 | + : @param $n-pos1 the potential preceding node position |
308 | + : @param $n-pos2 the potential following node position |
309 | + : |
310 | + : @return true if node positions $n-pos1 and $n-pos2 belong to the same XML |
311 | + : tree and $n-pos2 is following the node position $n-pos1; false |
312 | + : otherwise. |
313 | + : |
314 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node position |
315 | + : computed by the <tt>np:node-position</tt> function. |
316 | + :) |
317 | +declare function np:following-of( |
318 | + $n-pos1 as xs:anyURI, |
319 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
320 | + |
321 | +(:~ |
322 | + : Determines whether the node position given as second argument is |
323 | + : following in document order the node position given as first argument. |
324 | + : |
325 | + : If the two positions were obtained within the same snapshot S, then the |
326 | + : result of the function applies to the corresponding nodes as well, that |
327 | + : is, within snapshot S, the second node is following in document order the |
328 | + : first. Otherwise, the result of the function does not imply anything about |
329 | + : the positional relationship of the two nodes. |
330 | + : |
331 | + : @param $n-pos1 the potential preceding node position |
332 | + : @param $n-pos2 the potential following node position |
333 | + : |
334 | + : @return true if the node position $n-pos2 is following in document order the |
335 | + : node position $n-pos1; false otherwise. |
336 | + : |
337 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
338 | + : position computed by the <tt>np:node-position</tt> function. |
339 | + :) |
340 | +declare function np:following-in-document-order-of( |
341 | + $n-pos1 as xs:anyURI, |
342 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
343 | + |
344 | +(:~ |
345 | + : Determines whether the node position given as second argument is |
346 | + : preceding the node position given as first argument. |
347 | + : |
348 | + : If the two positions were obtained within the same snapshot S, then the |
349 | + : result of the function applies to the corresponding nodes as well, that |
350 | + : is, within snapshot S, the second node is preceding the first. |
351 | + : Otherwise, the result of the function does not imply anything about the |
352 | + : positional relationship of the two nodes. |
353 | + : |
354 | + : @param $n-pos1 the potential following node position |
355 | + : @param $n-pos2 the potential preceding node position |
356 | + : |
357 | + : @return true if node positions $n-pos1 and $n-pos2 belong to the same XML |
358 | + : tree and $n-pos2 is preceding the node position $n-pos1; false |
359 | + : otherwise. |
360 | + : |
361 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
362 | + : position computed by the <tt>np:node-position</tt> function. |
363 | + :) |
364 | +declare function np:preceding-of( |
365 | + $n-pos1 as xs:anyURI, |
366 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
367 | + |
368 | +(:~ |
369 | + : Determines whether the node position given as second argument is |
370 | + : preceding in document order the node position given as first argument. |
371 | + : |
372 | + : If the two positions were obtained within the same snapshot S, then the |
373 | + : result of the function applies to the corresponding nodes as well, that |
374 | + : is, within snapshot S, the second node is preceding in document order the |
375 | + : first. Otherwise, the result of the function does not imply anything about |
376 | + : the positional relationship of the two nodes. |
377 | + : |
378 | + : @param $n-pos1 the potential following node position |
379 | + : @param $n-pos2 the potential preceding node position |
380 | + : |
381 | + : @return true if the node position $n-pos2 is preceding in document order the |
382 | + : node position $n-pos1; false otherwise. |
383 | + : |
384 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
385 | + : position computed by the <tt>np:node-position</tt> function. |
386 | + :) |
387 | +declare function np:preceding-in-document-order-of( |
388 | + $n-pos1 as xs:anyURI, |
389 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
390 | + |
391 | +(:~ |
392 | + : Computes the level of a node position in its tree. |
393 | + : |
394 | + : Note: The root node of a tree is at level one. |
395 | + : |
396 | + : The result of the function applies to the corresponding node as well, |
397 | + : that is, within the snapshot in which the position was computed, the node |
398 | + : level is the returned one. |
399 | + : The result of the function does not imply anything about the |
400 | + : node level in other snapshots. |
401 | + : |
402 | + : @param $n-pos the node position of the node whose level should be |
403 | + : determined. |
404 | + : |
405 | + : @return the level in the tree of the node position $n-pos as xs:integer. |
406 | + : |
407 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
408 | + : position computed by the <tt>np:node-position</tt> function. |
409 | + :) |
410 | +declare function np:level( |
411 | + $n-pos as xs:anyURI) as xs:integer external; |
412 | + |
413 | +(:~ |
414 | + : Determines whether a node position corresponds to an attribute node. |
415 | + : |
416 | + : @param $n-pos the potential attribute node position |
417 | + : |
418 | + : @return true if the node position $n-pos corresponds to an attribute; |
419 | + : false otherwise. |
420 | + : |
421 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
422 | + : position computed by the <tt>np:node-position</tt> function. |
423 | + :) |
424 | +declare function np:is-attribute( |
425 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
426 | + |
427 | +(:~ |
428 | + : Determines whether a node position corresponds to a comment node. |
429 | + : |
430 | + : @param $n-pos the potential comment node position |
431 | + : |
432 | + : @return true if the node position $n-pos corresponds to an comment; |
433 | + : false otherwise. |
434 | + : |
435 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
436 | + : position computed by the <tt>np:node-position</tt> function. |
437 | + :) |
438 | +declare function np:is-comment( |
439 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
440 | + |
441 | +(:~ |
442 | + : Determines whether a node position corresponds to a document node. |
443 | + : |
444 | + : @param $n-pos the potential document node position |
445 | + : |
446 | + : @return true if the node position $n-pos corresponds to a document; |
447 | + : false otherwise. |
448 | + : |
449 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
450 | + : position computed by the <tt>np:node-position</tt> function. |
451 | + :) |
452 | +declare function np:is-document( |
453 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
454 | + |
455 | +(:~ |
456 | + : Determines whether a node position corresponds to an element node. |
457 | + : |
458 | + : @param $n-pos the potential element node position |
459 | + : |
460 | + : @return true if the node position $n-pos corresponds to an element; |
461 | + : false otherwise. |
462 | + : |
463 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
464 | + : position computed by the <tt>np:node-position</tt> function. |
465 | + :) |
466 | +declare function np:is-element( |
467 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
468 | + |
469 | +(:~ |
470 | + : Determines whether a node position corresponds to an processing-instruction |
471 | + : node. |
472 | + : |
473 | + : @param $n-pos the potential processing-instruction node position |
474 | + : |
475 | + : @return true if the node position $n-pos corresponds to a processing |
476 | + : instruction; false otherwise. |
477 | + : |
478 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
479 | + : position computed by the <tt>np:node-position</tt> function. |
480 | + :) |
481 | +declare function np:is-processing-instruction( |
482 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
483 | + |
484 | +(:~ |
485 | + : Determines whether a node position corresponds to a text node. |
486 | + : |
487 | + : @param $n-pos the potential text node position |
488 | + : |
489 | + : @return true if the node position $n-pos corresponds to a text; |
490 | + : false otherwise. |
491 | + : |
492 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
493 | + : position computed by the <tt>np:node-position</tt> function. |
494 | + :) |
495 | +declare function np:is-text( |
496 | + $n-pos1 as xs:anyURI) as xs:boolean external; |
497 | + |
498 | +(:~ |
499 | + : Determines whether two node positions belong to the same tree. |
500 | + : |
501 | + : If the two positions were obtained within the same snapshot S, then the |
502 | + : result of the function applies to the corresponding nodes as well, that |
503 | + : is, within snapshot S, the two nodes belong to the same tree. |
504 | + : Otherwise, the result of the function does not imply anything about |
505 | + : the positional relationship of the two nodes. |
506 | + : |
507 | + : @param $n-pos1 a node position |
508 | + : @param $n-pos2 a node position |
509 | + : |
510 | + : @return true if the two nodes whose node positions are $n-pos1 |
511 | + : and $n-pos2 belong to the same tree. |
512 | + : |
513 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
514 | + : position computed by the <tt>np:node-position</tt> function. |
515 | + :) |
516 | +declare function np:in-same-tree-of( |
517 | + $n-pos1 as xs:anyURI, |
518 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
519 | + |
520 | +(:~ |
521 | + : Determines whether a node position belongs to a collection. |
522 | + : |
523 | + : @param $n-pos the node position |
524 | + : |
525 | + : @return true if the node position $n-pos |
526 | + : belongs to a collection; false otherwise. |
527 | + : |
528 | + : @error zerr:ZAPI0028 if the given URI is not a valid node |
529 | + : position computed by the <tt>np:node-position</tt> function. |
530 | + :) |
531 | +declare function np:in-collection( |
532 | + $n-pos as xs:anyURI) as xs:boolean external; |
533 | + |
534 | +(:~ |
535 | + : Determines whether two node positions belong to the same collection. |
536 | + : |
537 | + : If the two positions were obtained within the same snapshot S, then the |
538 | + : result of the function applies to the corresponding nodes as well, that |
539 | + : is, within snapshot S, the two nodes belong to the same collection. |
540 | + : Otherwise, the result of the function does not imply anything about |
541 | + : the positional relationship of the two nodes. |
542 | + : |
543 | + : @param $n-pos1 a node position |
544 | + : @param $n-pos2 a node position |
545 | + : |
546 | + : @return true if the two nodes whose node positions are $n-pos1 |
547 | + : and $n-pos2 belong to the same collection. |
548 | + : |
549 | + : @error zerr:ZAPI0028 if one of the given URI is not a valid node |
550 | + : position computed by the <tt>np:node-position</tt> function. |
551 | + :) |
552 | +declare function np:in-same-collection-of( |
553 | + $n-pos1 as xs:anyURI, |
554 | + $n-pos2 as xs:anyURI) as xs:boolean external; |
555 | |
556 | === modified file 'src/context/static_context.cpp' |
557 | --- src/context/static_context.cpp 2011-11-01 13:47:10 +0000 |
558 | +++ src/context/static_context.cpp 2011-11-02 17:26:24 +0000 |
559 | @@ -280,6 +280,9 @@ |
560 | static_context::ZORBA_NODEREF_FN_NS = NS_PRE + "modules/node-reference"; |
561 | |
562 | const zstring |
563 | +static_context::ZORBA_NODEPOS_FN_NS = NS_PRE + "modules/node-position"; |
564 | + |
565 | +const zstring |
566 | static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS |
567 | = NS_PRE + "modules/store/dynamic/collections/ddl"; |
568 | |
569 | @@ -373,6 +376,7 @@ |
570 | return (ns == ZORBA_MATH_FN_NS || |
571 | ns == ZORBA_BASE64_FN_NS || |
572 | ns == ZORBA_NODEREF_FN_NS || |
573 | + ns == ZORBA_NODEPOS_FN_NS || |
574 | ns == ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS || |
575 | ns == ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS || |
576 | ns == ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS || |
577 | |
578 | === modified file 'src/context/static_context.h' |
579 | --- src/context/static_context.h 2011-11-01 13:47:10 +0000 |
580 | +++ src/context/static_context.h 2011-11-02 17:26:24 +0000 |
581 | @@ -450,6 +450,7 @@ |
582 | static const zstring ZORBA_MATH_FN_NS; |
583 | static const zstring ZORBA_BASE64_FN_NS; |
584 | static const zstring ZORBA_NODEREF_FN_NS; |
585 | + static const zstring ZORBA_NODEPOS_FN_NS; |
586 | static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS; |
587 | static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS; |
588 | static const zstring ZORBA_STORE_STATIC_COLLECTIONS_DDL_FN_NS; |
589 | |
590 | === modified file 'src/functions/library.cpp' |
591 | --- src/functions/library.cpp 2011-09-27 16:01:34 +0000 |
592 | +++ src/functions/library.cpp 2011-11-02 17:26:24 +0000 |
593 | @@ -44,6 +44,7 @@ |
594 | #include "functions/func_ic_ddl.h" |
595 | #include "functions/func_maths.h" |
596 | #include "functions/func_nodes.h" |
597 | +#include "functions/func_node_position.h" |
598 | #include "functions/func_node_sort_distinct.h" |
599 | #include "functions/func_numerics.h" |
600 | #include "functions/func_numerics_impl.h" |
601 | @@ -108,6 +109,7 @@ |
602 | populate_context_ic_ddl(sctx); |
603 | populate_context_maths(sctx); |
604 | populate_context_nodes(sctx); |
605 | + populate_context_node_position(sctx); |
606 | populate_context_numerics(sctx); |
607 | populate_context_other_diagnostics(sctx); |
608 | populate_context_parsing_and_serializing(sctx); |
609 | |
610 | === added file 'src/functions/pregenerated/func_node_position.cpp' |
611 | --- src/functions/pregenerated/func_node_position.cpp 1970-01-01 00:00:00 +0000 |
612 | +++ src/functions/pregenerated/func_node_position.cpp 2011-11-02 17:26:24 +0000 |
613 | @@ -0,0 +1,584 @@ |
614 | +/* |
615 | + * Copyright 2006-2008 The FLWOR Foundation. |
616 | + * |
617 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
618 | + * you may not use this file except in compliance with the License. |
619 | + * You may obtain a copy of the License at |
620 | + * |
621 | + * http://www.apache.org/licenses/LICENSE-2.0 |
622 | + * |
623 | + * Unless required by applicable law or agreed to in writing, software |
624 | + * distributed under the License is distributed on an "AS IS" BASIS, |
625 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
626 | + * See the License for the specific language governing permissions and |
627 | + * limitations under the License. |
628 | + */ |
629 | + |
630 | +// ****************************************** |
631 | +// * * |
632 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
633 | +// * SEE .xml FILE WITH SAME NAME * |
634 | +// * * |
635 | +// ****************************************** |
636 | + |
637 | + |
638 | +#include "stdafx.h" |
639 | +#include "runtime/nodes/node_position.h" |
640 | +#include "functions/func_node_position.h" |
641 | + |
642 | + |
643 | +namespace zorba{ |
644 | + |
645 | + |
646 | + |
647 | +PlanIter_t fn_zorba_pos_node_position::codegen( |
648 | + CompilerCB*, |
649 | + static_context* sctx, |
650 | + const QueryLoc& loc, |
651 | + std::vector<PlanIter_t>& argv, |
652 | + AnnotationHolder& ann) const |
653 | +{ |
654 | + return new NodePositionIterator(sctx, loc, argv); |
655 | +} |
656 | + |
657 | +PlanIter_t fn_zorba_pos_ancestor_of::codegen( |
658 | + CompilerCB*, |
659 | + static_context* sctx, |
660 | + const QueryLoc& loc, |
661 | + std::vector<PlanIter_t>& argv, |
662 | + AnnotationHolder& ann) const |
663 | +{ |
664 | + return new IsAncestorPositionIterator(sctx, loc, argv); |
665 | +} |
666 | + |
667 | +PlanIter_t fn_zorba_pos_following_sibling_of::codegen( |
668 | + CompilerCB*, |
669 | + static_context* sctx, |
670 | + const QueryLoc& loc, |
671 | + std::vector<PlanIter_t>& argv, |
672 | + AnnotationHolder& ann) const |
673 | +{ |
674 | + return new IsFollowingSiblingPositionIterator(sctx, loc, argv); |
675 | +} |
676 | + |
677 | +PlanIter_t fn_zorba_pos_following_of::codegen( |
678 | + CompilerCB*, |
679 | + static_context* sctx, |
680 | + const QueryLoc& loc, |
681 | + std::vector<PlanIter_t>& argv, |
682 | + AnnotationHolder& ann) const |
683 | +{ |
684 | + return new IsFollowingPositionIterator(sctx, loc, argv); |
685 | +} |
686 | + |
687 | +PlanIter_t fn_zorba_pos_in_subtree_of::codegen( |
688 | + CompilerCB*, |
689 | + static_context* sctx, |
690 | + const QueryLoc& loc, |
691 | + std::vector<PlanIter_t>& argv, |
692 | + AnnotationHolder& ann) const |
693 | +{ |
694 | + return new IsInSubtreeOfPositionIterator(sctx, loc, argv); |
695 | +} |
696 | + |
697 | +PlanIter_t fn_zorba_pos_descendant_of::codegen( |
698 | + CompilerCB*, |
699 | + static_context* sctx, |
700 | + const QueryLoc& loc, |
701 | + std::vector<PlanIter_t>& argv, |
702 | + AnnotationHolder& ann) const |
703 | +{ |
704 | + return new IsDescendantPositionIterator(sctx, loc, argv); |
705 | +} |
706 | + |
707 | +PlanIter_t fn_zorba_pos_preceding_sibling_of::codegen( |
708 | + CompilerCB*, |
709 | + static_context* sctx, |
710 | + const QueryLoc& loc, |
711 | + std::vector<PlanIter_t>& argv, |
712 | + AnnotationHolder& ann) const |
713 | +{ |
714 | + return new IsPrecedingSiblingPositionIterator(sctx, loc, argv); |
715 | +} |
716 | + |
717 | +PlanIter_t fn_zorba_pos_preceding_of::codegen( |
718 | + CompilerCB*, |
719 | + static_context* sctx, |
720 | + const QueryLoc& loc, |
721 | + std::vector<PlanIter_t>& argv, |
722 | + AnnotationHolder& ann) const |
723 | +{ |
724 | + return new IsPrecedingPositionIterator(sctx, loc, argv); |
725 | +} |
726 | + |
727 | +PlanIter_t fn_zorba_pos_child_of::codegen( |
728 | + CompilerCB*, |
729 | + static_context* sctx, |
730 | + const QueryLoc& loc, |
731 | + std::vector<PlanIter_t>& argv, |
732 | + AnnotationHolder& ann) const |
733 | +{ |
734 | + return new IsChildPositionIterator(sctx, loc, argv); |
735 | +} |
736 | + |
737 | +PlanIter_t fn_zorba_pos_attribute_of::codegen( |
738 | + CompilerCB*, |
739 | + static_context* sctx, |
740 | + const QueryLoc& loc, |
741 | + std::vector<PlanIter_t>& argv, |
742 | + AnnotationHolder& ann) const |
743 | +{ |
744 | + return new IsAttributeOfPositionIterator(sctx, loc, argv); |
745 | +} |
746 | + |
747 | +PlanIter_t fn_zorba_pos_parent_of::codegen( |
748 | + CompilerCB*, |
749 | + static_context* sctx, |
750 | + const QueryLoc& loc, |
751 | + std::vector<PlanIter_t>& argv, |
752 | + AnnotationHolder& ann) const |
753 | +{ |
754 | + return new IsParentPositionIterator(sctx, loc, argv); |
755 | +} |
756 | + |
757 | +PlanIter_t fn_zorba_pos_preceding_in_document_order_of::codegen( |
758 | + CompilerCB*, |
759 | + static_context* sctx, |
760 | + const QueryLoc& loc, |
761 | + std::vector<PlanIter_t>& argv, |
762 | + AnnotationHolder& ann) const |
763 | +{ |
764 | + return new IsPrecedingInDocumentOrderPositionIterator(sctx, loc, argv); |
765 | +} |
766 | + |
767 | +PlanIter_t fn_zorba_pos_following_in_document_order_of::codegen( |
768 | + CompilerCB*, |
769 | + static_context* sctx, |
770 | + const QueryLoc& loc, |
771 | + std::vector<PlanIter_t>& argv, |
772 | + AnnotationHolder& ann) const |
773 | +{ |
774 | + return new IsFollowingInDocumentOrderPositionIterator(sctx, loc, argv); |
775 | +} |
776 | + |
777 | +PlanIter_t fn_zorba_pos_level::codegen( |
778 | + CompilerCB*, |
779 | + static_context* sctx, |
780 | + const QueryLoc& loc, |
781 | + std::vector<PlanIter_t>& argv, |
782 | + AnnotationHolder& ann) const |
783 | +{ |
784 | + return new LevelPositionIterator(sctx, loc, argv); |
785 | +} |
786 | + |
787 | +PlanIter_t fn_zorba_pos_is_attribute::codegen( |
788 | + CompilerCB*, |
789 | + static_context* sctx, |
790 | + const QueryLoc& loc, |
791 | + std::vector<PlanIter_t>& argv, |
792 | + AnnotationHolder& ann) const |
793 | +{ |
794 | + return new IsAttributePositionIterator(sctx, loc, argv); |
795 | +} |
796 | + |
797 | +PlanIter_t fn_zorba_pos_is_comment::codegen( |
798 | + CompilerCB*, |
799 | + static_context* sctx, |
800 | + const QueryLoc& loc, |
801 | + std::vector<PlanIter_t>& argv, |
802 | + AnnotationHolder& ann) const |
803 | +{ |
804 | + return new IsCommentPositionIterator(sctx, loc, argv); |
805 | +} |
806 | + |
807 | +PlanIter_t fn_zorba_pos_is_document::codegen( |
808 | + CompilerCB*, |
809 | + static_context* sctx, |
810 | + const QueryLoc& loc, |
811 | + std::vector<PlanIter_t>& argv, |
812 | + AnnotationHolder& ann) const |
813 | +{ |
814 | + return new IsDocumentPositionIterator(sctx, loc, argv); |
815 | +} |
816 | + |
817 | +PlanIter_t fn_zorba_pos_is_element::codegen( |
818 | + CompilerCB*, |
819 | + static_context* sctx, |
820 | + const QueryLoc& loc, |
821 | + std::vector<PlanIter_t>& argv, |
822 | + AnnotationHolder& ann) const |
823 | +{ |
824 | + return new IsElementPositionIterator(sctx, loc, argv); |
825 | +} |
826 | + |
827 | +PlanIter_t fn_zorba_pos_is_processing_instruction::codegen( |
828 | + CompilerCB*, |
829 | + static_context* sctx, |
830 | + const QueryLoc& loc, |
831 | + std::vector<PlanIter_t>& argv, |
832 | + AnnotationHolder& ann) const |
833 | +{ |
834 | + return new IsProcessingInstructionPositionIterator(sctx, loc, argv); |
835 | +} |
836 | + |
837 | +PlanIter_t fn_zorba_pos_is_text::codegen( |
838 | + CompilerCB*, |
839 | + static_context* sctx, |
840 | + const QueryLoc& loc, |
841 | + std::vector<PlanIter_t>& argv, |
842 | + AnnotationHolder& ann) const |
843 | +{ |
844 | + return new IsTextPositionIterator(sctx, loc, argv); |
845 | +} |
846 | + |
847 | +PlanIter_t fn_zorba_pos_sibling_of::codegen( |
848 | + CompilerCB*, |
849 | + static_context* sctx, |
850 | + const QueryLoc& loc, |
851 | + std::vector<PlanIter_t>& argv, |
852 | + AnnotationHolder& ann) const |
853 | +{ |
854 | + return new IsSiblingPositionIterator(sctx, loc, argv); |
855 | +} |
856 | + |
857 | +PlanIter_t fn_zorba_pos_in_same_tree_of::codegen( |
858 | + CompilerCB*, |
859 | + static_context* sctx, |
860 | + const QueryLoc& loc, |
861 | + std::vector<PlanIter_t>& argv, |
862 | + AnnotationHolder& ann) const |
863 | +{ |
864 | + return new InSameTreePositionIterator(sctx, loc, argv); |
865 | +} |
866 | + |
867 | +PlanIter_t fn_zorba_pos_in_collection::codegen( |
868 | + CompilerCB*, |
869 | + static_context* sctx, |
870 | + const QueryLoc& loc, |
871 | + std::vector<PlanIter_t>& argv, |
872 | + AnnotationHolder& ann) const |
873 | +{ |
874 | + return new InCollectionPositionIterator(sctx, loc, argv); |
875 | +} |
876 | + |
877 | +PlanIter_t fn_zorba_pos_in_same_collection_of::codegen( |
878 | + CompilerCB*, |
879 | + static_context* sctx, |
880 | + const QueryLoc& loc, |
881 | + std::vector<PlanIter_t>& argv, |
882 | + AnnotationHolder& ann) const |
883 | +{ |
884 | + return new InSameCollectionPositionIterator(sctx, loc, argv); |
885 | +} |
886 | + |
887 | +void populate_context_node_position(static_context* sctx) |
888 | +{ |
889 | + { |
890 | + |
891 | + |
892 | + DECL_WITH_KIND(sctx, fn_zorba_pos_node_position, |
893 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","node-position"), |
894 | + GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, |
895 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE), |
896 | + FunctionConsts::FN_ZORBA_POS_NODE_POSITION_1); |
897 | + |
898 | + } |
899 | + |
900 | + |
901 | + { |
902 | + |
903 | + |
904 | + DECL_WITH_KIND(sctx, fn_zorba_pos_ancestor_of, |
905 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","ancestor-of"), |
906 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
907 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
908 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
909 | + FunctionConsts::FN_ZORBA_POS_ANCESTOR_OF_2); |
910 | + |
911 | + } |
912 | + |
913 | + |
914 | + { |
915 | + |
916 | + |
917 | + DECL_WITH_KIND(sctx, fn_zorba_pos_following_sibling_of, |
918 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","following-sibling-of"), |
919 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
920 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
921 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
922 | + FunctionConsts::FN_ZORBA_POS_FOLLOWING_SIBLING_OF_2); |
923 | + |
924 | + } |
925 | + |
926 | + |
927 | + { |
928 | + |
929 | + |
930 | + DECL_WITH_KIND(sctx, fn_zorba_pos_following_of, |
931 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","following-of"), |
932 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
933 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
934 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
935 | + FunctionConsts::FN_ZORBA_POS_FOLLOWING_OF_2); |
936 | + |
937 | + } |
938 | + |
939 | + |
940 | + { |
941 | + |
942 | + |
943 | + DECL_WITH_KIND(sctx, fn_zorba_pos_in_subtree_of, |
944 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","in-subtree-of"), |
945 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
946 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
947 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
948 | + FunctionConsts::FN_ZORBA_POS_IN_SUBTREE_OF_2); |
949 | + |
950 | + } |
951 | + |
952 | + |
953 | + { |
954 | + |
955 | + |
956 | + DECL_WITH_KIND(sctx, fn_zorba_pos_descendant_of, |
957 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","descendant-of"), |
958 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
959 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
960 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
961 | + FunctionConsts::FN_ZORBA_POS_DESCENDANT_OF_2); |
962 | + |
963 | + } |
964 | + |
965 | + |
966 | + { |
967 | + |
968 | + |
969 | + DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_sibling_of, |
970 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-sibling-of"), |
971 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
972 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
973 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
974 | + FunctionConsts::FN_ZORBA_POS_PRECEDING_SIBLING_OF_2); |
975 | + |
976 | + } |
977 | + |
978 | + |
979 | + { |
980 | + |
981 | + |
982 | + DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_of, |
983 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-of"), |
984 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
985 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
986 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
987 | + FunctionConsts::FN_ZORBA_POS_PRECEDING_OF_2); |
988 | + |
989 | + } |
990 | + |
991 | + |
992 | + { |
993 | + |
994 | + |
995 | + DECL_WITH_KIND(sctx, fn_zorba_pos_child_of, |
996 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","child-of"), |
997 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
998 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
999 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1000 | + FunctionConsts::FN_ZORBA_POS_CHILD_OF_2); |
1001 | + |
1002 | + } |
1003 | + |
1004 | + |
1005 | + { |
1006 | + |
1007 | + |
1008 | + DECL_WITH_KIND(sctx, fn_zorba_pos_attribute_of, |
1009 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","attribute-of"), |
1010 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1011 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1012 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1013 | + FunctionConsts::FN_ZORBA_POS_ATTRIBUTE_OF_2); |
1014 | + |
1015 | + } |
1016 | + |
1017 | + |
1018 | + { |
1019 | + |
1020 | + |
1021 | + DECL_WITH_KIND(sctx, fn_zorba_pos_parent_of, |
1022 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","parent-of"), |
1023 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1024 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1025 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1026 | + FunctionConsts::FN_ZORBA_POS_PARENT_OF_2); |
1027 | + |
1028 | + } |
1029 | + |
1030 | + |
1031 | + { |
1032 | + |
1033 | + |
1034 | + DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_in_document_order_of, |
1035 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-in-document-order-of"), |
1036 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1037 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1038 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1039 | + FunctionConsts::FN_ZORBA_POS_PRECEDING_IN_DOCUMENT_ORDER_OF_2); |
1040 | + |
1041 | + } |
1042 | + |
1043 | + |
1044 | + { |
1045 | + |
1046 | + |
1047 | + DECL_WITH_KIND(sctx, fn_zorba_pos_following_in_document_order_of, |
1048 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","following-in-document-order-of"), |
1049 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1050 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1051 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1052 | + FunctionConsts::FN_ZORBA_POS_FOLLOWING_IN_DOCUMENT_ORDER_OF_2); |
1053 | + |
1054 | + } |
1055 | + |
1056 | + |
1057 | + { |
1058 | + |
1059 | + |
1060 | + DECL_WITH_KIND(sctx, fn_zorba_pos_level, |
1061 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","level"), |
1062 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1063 | + GENV_TYPESYSTEM.INTEGER_TYPE_ONE), |
1064 | + FunctionConsts::FN_ZORBA_POS_LEVEL_1); |
1065 | + |
1066 | + } |
1067 | + |
1068 | + |
1069 | + { |
1070 | + |
1071 | + |
1072 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_attribute, |
1073 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-attribute"), |
1074 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1075 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1076 | + FunctionConsts::FN_ZORBA_POS_IS_ATTRIBUTE_1); |
1077 | + |
1078 | + } |
1079 | + |
1080 | + |
1081 | + { |
1082 | + |
1083 | + |
1084 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_comment, |
1085 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-comment"), |
1086 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1087 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1088 | + FunctionConsts::FN_ZORBA_POS_IS_COMMENT_1); |
1089 | + |
1090 | + } |
1091 | + |
1092 | + |
1093 | + { |
1094 | + |
1095 | + |
1096 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_document, |
1097 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-document"), |
1098 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1099 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1100 | + FunctionConsts::FN_ZORBA_POS_IS_DOCUMENT_1); |
1101 | + |
1102 | + } |
1103 | + |
1104 | + |
1105 | + { |
1106 | + |
1107 | + |
1108 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_element, |
1109 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-element"), |
1110 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1111 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1112 | + FunctionConsts::FN_ZORBA_POS_IS_ELEMENT_1); |
1113 | + |
1114 | + } |
1115 | + |
1116 | + |
1117 | + { |
1118 | + |
1119 | + |
1120 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_processing_instruction, |
1121 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-processing-instruction"), |
1122 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1123 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1124 | + FunctionConsts::FN_ZORBA_POS_IS_PROCESSING_INSTRUCTION_1); |
1125 | + |
1126 | + } |
1127 | + |
1128 | + |
1129 | + { |
1130 | + |
1131 | + |
1132 | + DECL_WITH_KIND(sctx, fn_zorba_pos_is_text, |
1133 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","is-text"), |
1134 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1135 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1136 | + FunctionConsts::FN_ZORBA_POS_IS_TEXT_1); |
1137 | + |
1138 | + } |
1139 | + |
1140 | + |
1141 | + { |
1142 | + |
1143 | + |
1144 | + DECL_WITH_KIND(sctx, fn_zorba_pos_sibling_of, |
1145 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","sibling-of"), |
1146 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1147 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1148 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1149 | + FunctionConsts::FN_ZORBA_POS_SIBLING_OF_2); |
1150 | + |
1151 | + } |
1152 | + |
1153 | + |
1154 | + { |
1155 | + |
1156 | + |
1157 | + DECL_WITH_KIND(sctx, fn_zorba_pos_in_same_tree_of, |
1158 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","in-same-tree-of"), |
1159 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1160 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1161 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1162 | + FunctionConsts::FN_ZORBA_POS_IN_SAME_TREE_OF_2); |
1163 | + |
1164 | + } |
1165 | + |
1166 | + |
1167 | + { |
1168 | + |
1169 | + |
1170 | + DECL_WITH_KIND(sctx, fn_zorba_pos_in_collection, |
1171 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","in-collection"), |
1172 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1173 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1174 | + FunctionConsts::FN_ZORBA_POS_IN_COLLECTION_1); |
1175 | + |
1176 | + } |
1177 | + |
1178 | + |
1179 | + { |
1180 | + |
1181 | + |
1182 | + DECL_WITH_KIND(sctx, fn_zorba_pos_in_same_collection_of, |
1183 | + (createQName("http://www.zorba-xquery.com/modules/node-position","","in-same-collection-of"), |
1184 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1185 | + GENV_TYPESYSTEM.ANY_URI_TYPE_ONE, |
1186 | + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
1187 | + FunctionConsts::FN_ZORBA_POS_IN_SAME_COLLECTION_OF_2); |
1188 | + |
1189 | + } |
1190 | + |
1191 | +} |
1192 | + |
1193 | + |
1194 | +} |
1195 | + |
1196 | + |
1197 | + |
1198 | |
1199 | === added file 'src/functions/pregenerated/func_node_position.h' |
1200 | --- src/functions/pregenerated/func_node_position.h 1970-01-01 00:00:00 +0000 |
1201 | +++ src/functions/pregenerated/func_node_position.h 2011-11-02 17:26:24 +0000 |
1202 | @@ -0,0 +1,361 @@ |
1203 | +/* |
1204 | + * Copyright 2006-2008 The FLWOR Foundation. |
1205 | + * |
1206 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
1207 | + * you may not use this file except in compliance with the License. |
1208 | + * You may obtain a copy of the License at |
1209 | + * |
1210 | + * http://www.apache.org/licenses/LICENSE-2.0 |
1211 | + * |
1212 | + * Unless required by applicable law or agreed to in writing, software |
1213 | + * distributed under the License is distributed on an "AS IS" BASIS, |
1214 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1215 | + * See the License for the specific language governing permissions and |
1216 | + * limitations under the License. |
1217 | + */ |
1218 | + |
1219 | +// ****************************************** |
1220 | +// * * |
1221 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
1222 | +// * SEE .xml FILE WITH SAME NAME * |
1223 | +// * * |
1224 | +// ****************************************** |
1225 | + |
1226 | + |
1227 | +#ifndef ZORBA_FUNCTIONS_NODE_POSITION_H |
1228 | +#define ZORBA_FUNCTIONS_NODE_POSITION_H |
1229 | + |
1230 | + |
1231 | +#include "common/shared_types.h" |
1232 | +#include "functions/function_impl.h" |
1233 | + |
1234 | + |
1235 | +namespace zorba { |
1236 | + |
1237 | + |
1238 | +void populate_context_node_position(static_context* sctx); |
1239 | + |
1240 | + |
1241 | + |
1242 | + |
1243 | +//fn-zorba-pos:node-position |
1244 | +class fn_zorba_pos_node_position : public function |
1245 | +{ |
1246 | +public: |
1247 | + fn_zorba_pos_node_position(const signature& sig, FunctionConsts::FunctionKind kind) |
1248 | + : function(sig, kind) { |
1249 | + |
1250 | +} |
1251 | + |
1252 | + CODEGEN_DECL(); |
1253 | +}; |
1254 | + |
1255 | + |
1256 | +//fn-zorba-pos:ancestor-of |
1257 | +class fn_zorba_pos_ancestor_of : public function |
1258 | +{ |
1259 | +public: |
1260 | + fn_zorba_pos_ancestor_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1261 | + : function(sig, kind) { |
1262 | + |
1263 | +} |
1264 | + |
1265 | + CODEGEN_DECL(); |
1266 | +}; |
1267 | + |
1268 | + |
1269 | +//fn-zorba-pos:following-sibling-of |
1270 | +class fn_zorba_pos_following_sibling_of : public function |
1271 | +{ |
1272 | +public: |
1273 | + fn_zorba_pos_following_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1274 | + : function(sig, kind) { |
1275 | + |
1276 | +} |
1277 | + |
1278 | + CODEGEN_DECL(); |
1279 | +}; |
1280 | + |
1281 | + |
1282 | +//fn-zorba-pos:following-of |
1283 | +class fn_zorba_pos_following_of : public function |
1284 | +{ |
1285 | +public: |
1286 | + fn_zorba_pos_following_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1287 | + : function(sig, kind) { |
1288 | + |
1289 | +} |
1290 | + |
1291 | + CODEGEN_DECL(); |
1292 | +}; |
1293 | + |
1294 | + |
1295 | +//fn-zorba-pos:in-subtree-of |
1296 | +class fn_zorba_pos_in_subtree_of : public function |
1297 | +{ |
1298 | +public: |
1299 | + fn_zorba_pos_in_subtree_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1300 | + : function(sig, kind) { |
1301 | + |
1302 | +} |
1303 | + |
1304 | + CODEGEN_DECL(); |
1305 | +}; |
1306 | + |
1307 | + |
1308 | +//fn-zorba-pos:descendant-of |
1309 | +class fn_zorba_pos_descendant_of : public function |
1310 | +{ |
1311 | +public: |
1312 | + fn_zorba_pos_descendant_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1313 | + : function(sig, kind) { |
1314 | + |
1315 | +} |
1316 | + |
1317 | + CODEGEN_DECL(); |
1318 | +}; |
1319 | + |
1320 | + |
1321 | +//fn-zorba-pos:preceding-sibling-of |
1322 | +class fn_zorba_pos_preceding_sibling_of : public function |
1323 | +{ |
1324 | +public: |
1325 | + fn_zorba_pos_preceding_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1326 | + : function(sig, kind) { |
1327 | + |
1328 | +} |
1329 | + |
1330 | + CODEGEN_DECL(); |
1331 | +}; |
1332 | + |
1333 | + |
1334 | +//fn-zorba-pos:preceding-of |
1335 | +class fn_zorba_pos_preceding_of : public function |
1336 | +{ |
1337 | +public: |
1338 | + fn_zorba_pos_preceding_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1339 | + : function(sig, kind) { |
1340 | + |
1341 | +} |
1342 | + |
1343 | + CODEGEN_DECL(); |
1344 | +}; |
1345 | + |
1346 | + |
1347 | +//fn-zorba-pos:child-of |
1348 | +class fn_zorba_pos_child_of : public function |
1349 | +{ |
1350 | +public: |
1351 | + fn_zorba_pos_child_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1352 | + : function(sig, kind) { |
1353 | + |
1354 | +} |
1355 | + |
1356 | + CODEGEN_DECL(); |
1357 | +}; |
1358 | + |
1359 | + |
1360 | +//fn-zorba-pos:attribute-of |
1361 | +class fn_zorba_pos_attribute_of : public function |
1362 | +{ |
1363 | +public: |
1364 | + fn_zorba_pos_attribute_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1365 | + : function(sig, kind) { |
1366 | + |
1367 | +} |
1368 | + |
1369 | + CODEGEN_DECL(); |
1370 | +}; |
1371 | + |
1372 | + |
1373 | +//fn-zorba-pos:parent-of |
1374 | +class fn_zorba_pos_parent_of : public function |
1375 | +{ |
1376 | +public: |
1377 | + fn_zorba_pos_parent_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1378 | + : function(sig, kind) { |
1379 | + |
1380 | +} |
1381 | + |
1382 | + CODEGEN_DECL(); |
1383 | +}; |
1384 | + |
1385 | + |
1386 | +//fn-zorba-pos:preceding-in-document-order-of |
1387 | +class fn_zorba_pos_preceding_in_document_order_of : public function |
1388 | +{ |
1389 | +public: |
1390 | + fn_zorba_pos_preceding_in_document_order_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1391 | + : function(sig, kind) { |
1392 | + |
1393 | +} |
1394 | + |
1395 | + CODEGEN_DECL(); |
1396 | +}; |
1397 | + |
1398 | + |
1399 | +//fn-zorba-pos:following-in-document-order-of |
1400 | +class fn_zorba_pos_following_in_document_order_of : public function |
1401 | +{ |
1402 | +public: |
1403 | + fn_zorba_pos_following_in_document_order_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1404 | + : function(sig, kind) { |
1405 | + |
1406 | +} |
1407 | + |
1408 | + CODEGEN_DECL(); |
1409 | +}; |
1410 | + |
1411 | + |
1412 | +//fn-zorba-pos:level |
1413 | +class fn_zorba_pos_level : public function |
1414 | +{ |
1415 | +public: |
1416 | + fn_zorba_pos_level(const signature& sig, FunctionConsts::FunctionKind kind) |
1417 | + : function(sig, kind) { |
1418 | + |
1419 | +} |
1420 | + |
1421 | + CODEGEN_DECL(); |
1422 | +}; |
1423 | + |
1424 | + |
1425 | +//fn-zorba-pos:is-attribute |
1426 | +class fn_zorba_pos_is_attribute : public function |
1427 | +{ |
1428 | +public: |
1429 | + fn_zorba_pos_is_attribute(const signature& sig, FunctionConsts::FunctionKind kind) |
1430 | + : function(sig, kind) { |
1431 | + |
1432 | +} |
1433 | + |
1434 | + CODEGEN_DECL(); |
1435 | +}; |
1436 | + |
1437 | + |
1438 | +//fn-zorba-pos:is-comment |
1439 | +class fn_zorba_pos_is_comment : public function |
1440 | +{ |
1441 | +public: |
1442 | + fn_zorba_pos_is_comment(const signature& sig, FunctionConsts::FunctionKind kind) |
1443 | + : function(sig, kind) { |
1444 | + |
1445 | +} |
1446 | + |
1447 | + CODEGEN_DECL(); |
1448 | +}; |
1449 | + |
1450 | + |
1451 | +//fn-zorba-pos:is-document |
1452 | +class fn_zorba_pos_is_document : public function |
1453 | +{ |
1454 | +public: |
1455 | + fn_zorba_pos_is_document(const signature& sig, FunctionConsts::FunctionKind kind) |
1456 | + : function(sig, kind) { |
1457 | + |
1458 | +} |
1459 | + |
1460 | + CODEGEN_DECL(); |
1461 | +}; |
1462 | + |
1463 | + |
1464 | +//fn-zorba-pos:is-element |
1465 | +class fn_zorba_pos_is_element : public function |
1466 | +{ |
1467 | +public: |
1468 | + fn_zorba_pos_is_element(const signature& sig, FunctionConsts::FunctionKind kind) |
1469 | + : function(sig, kind) { |
1470 | + |
1471 | +} |
1472 | + |
1473 | + CODEGEN_DECL(); |
1474 | +}; |
1475 | + |
1476 | + |
1477 | +//fn-zorba-pos:is-processing-instruction |
1478 | +class fn_zorba_pos_is_processing_instruction : public function |
1479 | +{ |
1480 | +public: |
1481 | + fn_zorba_pos_is_processing_instruction(const signature& sig, FunctionConsts::FunctionKind kind) |
1482 | + : function(sig, kind) { |
1483 | + |
1484 | +} |
1485 | + |
1486 | + CODEGEN_DECL(); |
1487 | +}; |
1488 | + |
1489 | + |
1490 | +//fn-zorba-pos:is-text |
1491 | +class fn_zorba_pos_is_text : public function |
1492 | +{ |
1493 | +public: |
1494 | + fn_zorba_pos_is_text(const signature& sig, FunctionConsts::FunctionKind kind) |
1495 | + : function(sig, kind) { |
1496 | + |
1497 | +} |
1498 | + |
1499 | + CODEGEN_DECL(); |
1500 | +}; |
1501 | + |
1502 | + |
1503 | +//fn-zorba-pos:sibling-of |
1504 | +class fn_zorba_pos_sibling_of : public function |
1505 | +{ |
1506 | +public: |
1507 | + fn_zorba_pos_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1508 | + : function(sig, kind) { |
1509 | + |
1510 | +} |
1511 | + |
1512 | + CODEGEN_DECL(); |
1513 | +}; |
1514 | + |
1515 | + |
1516 | +//fn-zorba-pos:in-same-tree-of |
1517 | +class fn_zorba_pos_in_same_tree_of : public function |
1518 | +{ |
1519 | +public: |
1520 | + fn_zorba_pos_in_same_tree_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1521 | + : function(sig, kind) { |
1522 | + |
1523 | +} |
1524 | + |
1525 | + CODEGEN_DECL(); |
1526 | +}; |
1527 | + |
1528 | + |
1529 | +//fn-zorba-pos:in-collection |
1530 | +class fn_zorba_pos_in_collection : public function |
1531 | +{ |
1532 | +public: |
1533 | + fn_zorba_pos_in_collection(const signature& sig, FunctionConsts::FunctionKind kind) |
1534 | + : function(sig, kind) { |
1535 | + |
1536 | +} |
1537 | + |
1538 | + CODEGEN_DECL(); |
1539 | +}; |
1540 | + |
1541 | + |
1542 | +//fn-zorba-pos:in-same-collection-of |
1543 | +class fn_zorba_pos_in_same_collection_of : public function |
1544 | +{ |
1545 | +public: |
1546 | + fn_zorba_pos_in_same_collection_of(const signature& sig, FunctionConsts::FunctionKind kind) |
1547 | + : function(sig, kind) { |
1548 | + |
1549 | +} |
1550 | + |
1551 | + CODEGEN_DECL(); |
1552 | +}; |
1553 | + |
1554 | + |
1555 | +} //namespace zorba |
1556 | + |
1557 | + |
1558 | +#endif |
1559 | +/* |
1560 | + * Local variables: |
1561 | + * mode: c++ |
1562 | + * End: |
1563 | + */ |
1564 | |
1565 | === modified file 'src/functions/pregenerated/function_enum.h' |
1566 | --- src/functions/pregenerated/function_enum.h 2011-10-19 15:28:51 +0000 |
1567 | +++ src/functions/pregenerated/function_enum.h 2011-11-02 17:26:24 +0000 |
1568 | @@ -193,6 +193,30 @@ |
1569 | FN_ZORBA_MATH_IS_NAN_1, |
1570 | FN_ZORBA_MATH_MODF_1, |
1571 | FN_ZORBA_MATH_FREXP_1, |
1572 | + FN_ZORBA_POS_NODE_POSITION_1, |
1573 | + FN_ZORBA_POS_ANCESTOR_OF_2, |
1574 | + FN_ZORBA_POS_FOLLOWING_SIBLING_OF_2, |
1575 | + FN_ZORBA_POS_FOLLOWING_OF_2, |
1576 | + FN_ZORBA_POS_IN_SUBTREE_OF_2, |
1577 | + FN_ZORBA_POS_DESCENDANT_OF_2, |
1578 | + FN_ZORBA_POS_PRECEDING_SIBLING_OF_2, |
1579 | + FN_ZORBA_POS_PRECEDING_OF_2, |
1580 | + FN_ZORBA_POS_CHILD_OF_2, |
1581 | + FN_ZORBA_POS_ATTRIBUTE_OF_2, |
1582 | + FN_ZORBA_POS_PARENT_OF_2, |
1583 | + FN_ZORBA_POS_PRECEDING_IN_DOCUMENT_ORDER_OF_2, |
1584 | + FN_ZORBA_POS_FOLLOWING_IN_DOCUMENT_ORDER_OF_2, |
1585 | + FN_ZORBA_POS_LEVEL_1, |
1586 | + FN_ZORBA_POS_IS_ATTRIBUTE_1, |
1587 | + FN_ZORBA_POS_IS_COMMENT_1, |
1588 | + FN_ZORBA_POS_IS_DOCUMENT_1, |
1589 | + FN_ZORBA_POS_IS_ELEMENT_1, |
1590 | + FN_ZORBA_POS_IS_PROCESSING_INSTRUCTION_1, |
1591 | + FN_ZORBA_POS_IS_TEXT_1, |
1592 | + FN_ZORBA_POS_SIBLING_OF_2, |
1593 | + FN_ZORBA_POS_IN_SAME_TREE_OF_2, |
1594 | + FN_ZORBA_POS_IN_COLLECTION_1, |
1595 | + FN_ZORBA_POS_IN_SAME_COLLECTION_OF_2, |
1596 | FN_ZORBA_REF_NODE_REFERENCE_1, |
1597 | FN_ZORBA_REF_NODE_BY_REFERENCE_1, |
1598 | FN_LOCAL_NAME_0, |
1599 | |
1600 | === added file 'src/runtime/nodes/node_position_impl.cpp' |
1601 | --- src/runtime/nodes/node_position_impl.cpp 1970-01-01 00:00:00 +0000 |
1602 | +++ src/runtime/nodes/node_position_impl.cpp 2011-11-02 17:26:24 +0000 |
1603 | @@ -0,0 +1,756 @@ |
1604 | +/* |
1605 | + * Copyright 2006-2008 The FLWOR Foundation. |
1606 | + * |
1607 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
1608 | + * you may not use this file except in compliance with the License. |
1609 | + * You may obtain a copy of the License at |
1610 | + * |
1611 | + * http://www.apache.org/licenses/LICENSE-2.0 |
1612 | + * |
1613 | + * Unless required by applicable law or agreed to in writing, software |
1614 | + * distributed under the License is distributed on an "AS IS" BASIS, |
1615 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1616 | + * See the License for the specific language governing permissions and |
1617 | + * limitations under the License. |
1618 | + */ |
1619 | +#include "stdafx.h" |
1620 | + |
1621 | +#include "runtime/nodes/node_position.h" |
1622 | +#include "zorbamisc/ns_consts.h" |
1623 | + |
1624 | +#include "system/globalenv.h" |
1625 | + |
1626 | +#include "store/api/item.h" |
1627 | +#include "store/api/iterator.h" |
1628 | +#include "store/api/item_factory.h" |
1629 | +#include "store/api/store.h" |
1630 | +#include "store/naive/atomic_items.h" |
1631 | +#include "store/naive/ordpath.h" |
1632 | + |
1633 | +#include "util/string_util.h" |
1634 | +#include "util/uri_util.h" |
1635 | +#include "zorbautils/string_util.h" |
1636 | + |
1637 | +using namespace std; |
1638 | + |
1639 | +namespace zorba { |
1640 | + |
1641 | +/******************************************************************************* |
1642 | + |
1643 | +********************************************************************************/ |
1644 | +bool NodePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1645 | +{ |
1646 | + bool valid; |
1647 | + store::Item_t inNode; |
1648 | + |
1649 | + PlanIteratorState* state; |
1650 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1651 | + |
1652 | + valid = consumeNext(inNode, theChildren[0], planState); |
1653 | + assert(valid); |
1654 | + |
1655 | + STACK_PUSH(GENV_STORE.getStructuralInformation(result, inNode), state); |
1656 | + STACK_END(state); |
1657 | +} |
1658 | + |
1659 | + |
1660 | +/******************************************************************************* |
1661 | + |
1662 | +********************************************************************************/ |
1663 | +bool |
1664 | +IsAncestorPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1665 | +{ |
1666 | + store::Item_t lUriA; |
1667 | + store::Item_t lUriB; |
1668 | + |
1669 | + PlanIteratorState* state; |
1670 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1671 | + |
1672 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1673 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1674 | + |
1675 | + try |
1676 | + { |
1677 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isAncestor(lUriB)); |
1678 | + } |
1679 | + catch (ZorbaException& e) |
1680 | + { |
1681 | + set_source(e, loc); |
1682 | + throw; |
1683 | + } |
1684 | + |
1685 | + STACK_PUSH(true,state); |
1686 | + |
1687 | + STACK_END (state); |
1688 | +} |
1689 | + |
1690 | + |
1691 | +/******************************************************************************* |
1692 | + |
1693 | +********************************************************************************/ |
1694 | +bool |
1695 | +IsFollowingSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1696 | +{ |
1697 | + store::Item_t lUriA; |
1698 | + store::Item_t lUriB; |
1699 | + |
1700 | + PlanIteratorState* state; |
1701 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1702 | + |
1703 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1704 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1705 | + |
1706 | + try |
1707 | + { |
1708 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowingSibling(lUriB)); |
1709 | + } |
1710 | + catch (ZorbaException& e) |
1711 | + { |
1712 | + set_source(e, loc); |
1713 | + throw; |
1714 | + } |
1715 | + |
1716 | + STACK_PUSH(true,state); |
1717 | + |
1718 | + STACK_END (state); |
1719 | +} |
1720 | + |
1721 | + |
1722 | +/******************************************************************************* |
1723 | + |
1724 | +********************************************************************************/ |
1725 | +bool |
1726 | +IsFollowingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1727 | +{ |
1728 | + store::Item_t lUriA; |
1729 | + store::Item_t lUriB; |
1730 | + |
1731 | + PlanIteratorState* state; |
1732 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1733 | + |
1734 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1735 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1736 | + |
1737 | + try |
1738 | + { |
1739 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowing(lUriB)); |
1740 | + } |
1741 | + catch (ZorbaException& e) |
1742 | + { |
1743 | + set_source(e, loc); |
1744 | + throw; |
1745 | + } |
1746 | + |
1747 | + STACK_PUSH(true,state); |
1748 | + |
1749 | + STACK_END (state); |
1750 | +} |
1751 | + |
1752 | + |
1753 | +/******************************************************************************* |
1754 | + |
1755 | +********************************************************************************/ |
1756 | +bool |
1757 | +IsInSubtreeOfPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1758 | +{ |
1759 | + store::Item_t lUriA; |
1760 | + store::Item_t lUriB; |
1761 | + |
1762 | + PlanIteratorState *state; |
1763 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1764 | + |
1765 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1766 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1767 | + |
1768 | + try |
1769 | + { |
1770 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isInSubtreeOf(lUriB)); |
1771 | + } |
1772 | + catch (ZorbaException& e) |
1773 | + { |
1774 | + set_source(e, loc); |
1775 | + throw; |
1776 | + } |
1777 | + |
1778 | + STACK_PUSH(true,state); |
1779 | + |
1780 | + STACK_END (state); |
1781 | +} |
1782 | + |
1783 | + |
1784 | +/******************************************************************************* |
1785 | + |
1786 | +********************************************************************************/ |
1787 | +bool |
1788 | +IsDescendantPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1789 | +{ |
1790 | + store::Item_t lUriA; |
1791 | + store::Item_t lUriB; |
1792 | + |
1793 | + PlanIteratorState *state; |
1794 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1795 | + |
1796 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1797 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1798 | + |
1799 | + try |
1800 | + { |
1801 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isDescendant(lUriB)); |
1802 | + } |
1803 | + catch (ZorbaException& e) |
1804 | + { |
1805 | + set_source(e, loc); |
1806 | + throw; |
1807 | + } |
1808 | + |
1809 | + STACK_PUSH(true,state); |
1810 | + |
1811 | + STACK_END (state); |
1812 | +} |
1813 | + |
1814 | + |
1815 | +/******************************************************************************* |
1816 | + |
1817 | +********************************************************************************/ |
1818 | +bool |
1819 | +IsPrecedingSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1820 | +{ |
1821 | + store::Item_t lUriA; |
1822 | + store::Item_t lUriB; |
1823 | + |
1824 | + PlanIteratorState *state; |
1825 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1826 | + |
1827 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1828 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1829 | + |
1830 | + try |
1831 | + { |
1832 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isPrecedingSibling(lUriB)); |
1833 | + |
1834 | + } |
1835 | + catch (ZorbaException& e) |
1836 | + { |
1837 | + set_source(e, loc); |
1838 | + throw; |
1839 | + } |
1840 | + |
1841 | + STACK_PUSH(true,state); |
1842 | + |
1843 | + STACK_END (state); |
1844 | +} |
1845 | + |
1846 | + |
1847 | +/******************************************************************************* |
1848 | + |
1849 | +********************************************************************************/ |
1850 | +bool |
1851 | +IsPrecedingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1852 | +{ |
1853 | + store::Item_t lUriA; |
1854 | + store::Item_t lUriB; |
1855 | + |
1856 | + PlanIteratorState *state; |
1857 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1858 | + |
1859 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1860 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1861 | + |
1862 | + try |
1863 | + { |
1864 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isPreceding(lUriB)); |
1865 | + } |
1866 | + catch (ZorbaException& e) |
1867 | + { |
1868 | + set_source(e, loc); |
1869 | + throw; |
1870 | + } |
1871 | + |
1872 | + STACK_PUSH(true,state); |
1873 | + |
1874 | + STACK_END (state); |
1875 | +} |
1876 | + |
1877 | + |
1878 | +/******************************************************************************* |
1879 | + |
1880 | +********************************************************************************/ |
1881 | +bool |
1882 | +IsChildPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1883 | +{ |
1884 | + store::Item_t lUriA; |
1885 | + store::Item_t lUriB; |
1886 | + |
1887 | + PlanIteratorState *state; |
1888 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1889 | + |
1890 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1891 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1892 | + |
1893 | + try |
1894 | + { |
1895 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isChild(lUriB)); |
1896 | + } |
1897 | + catch (ZorbaException& e) |
1898 | + { |
1899 | + set_source(e, loc); |
1900 | + throw; |
1901 | + } |
1902 | + |
1903 | + STACK_PUSH(true,state); |
1904 | + |
1905 | + STACK_END (state); |
1906 | +} |
1907 | + |
1908 | + |
1909 | +/******************************************************************************* |
1910 | + |
1911 | +********************************************************************************/ |
1912 | +bool |
1913 | +IsAttributeOfPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1914 | +{ |
1915 | + store::Item_t lUriA; |
1916 | + store::Item_t lUriB; |
1917 | + |
1918 | + PlanIteratorState *state; |
1919 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1920 | + |
1921 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1922 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1923 | + |
1924 | + try |
1925 | + { |
1926 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isAttribute(lUriB)); |
1927 | + } |
1928 | + catch (ZorbaException& e) |
1929 | + { |
1930 | + set_source(e, loc); |
1931 | + throw; |
1932 | + } |
1933 | + |
1934 | + STACK_PUSH(true,state); |
1935 | + |
1936 | + STACK_END (state); |
1937 | +} |
1938 | + |
1939 | + |
1940 | +/******************************************************************************* |
1941 | + |
1942 | +********************************************************************************/ |
1943 | +bool |
1944 | +IsParentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1945 | +{ |
1946 | + store::Item_t lUriA; |
1947 | + store::Item_t lUriB; |
1948 | + |
1949 | + PlanIteratorState *state; |
1950 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1951 | + |
1952 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1953 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1954 | + |
1955 | + try |
1956 | + { |
1957 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isParent(lUriB)); |
1958 | + } |
1959 | + catch (ZorbaException& e) |
1960 | + { |
1961 | + set_source(e, loc); |
1962 | + throw; |
1963 | + } |
1964 | + |
1965 | + STACK_PUSH(true,state); |
1966 | + |
1967 | + STACK_END (state); |
1968 | +} |
1969 | + |
1970 | + |
1971 | +/******************************************************************************* |
1972 | + |
1973 | +********************************************************************************/ |
1974 | +bool |
1975 | +IsPrecedingInDocumentOrderPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
1976 | +{ |
1977 | + store::Item_t lUriA; |
1978 | + store::Item_t lUriB; |
1979 | + |
1980 | + PlanIteratorState *state; |
1981 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
1982 | + |
1983 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
1984 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
1985 | + |
1986 | + try |
1987 | + { |
1988 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isPrecedingInDocumentOrder(lUriB)); |
1989 | + } |
1990 | + catch (ZorbaException& e) |
1991 | + { |
1992 | + set_source(e, loc); |
1993 | + throw; |
1994 | + } |
1995 | + |
1996 | + STACK_PUSH(true,state); |
1997 | + |
1998 | + STACK_END (state); |
1999 | +} |
2000 | + |
2001 | + |
2002 | +/******************************************************************************* |
2003 | + |
2004 | +********************************************************************************/ |
2005 | +bool |
2006 | +IsFollowingInDocumentOrderPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2007 | +{ |
2008 | + store::Item_t lUriA; |
2009 | + store::Item_t lUriB; |
2010 | + |
2011 | + PlanIteratorState *state; |
2012 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2013 | + |
2014 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
2015 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
2016 | + |
2017 | + try |
2018 | + { |
2019 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowingInDocumentOrder(lUriB)); |
2020 | + } |
2021 | + catch (ZorbaException& e) |
2022 | + { |
2023 | + set_source(e, loc); |
2024 | + throw; |
2025 | + } |
2026 | + |
2027 | + STACK_PUSH(true,state); |
2028 | + |
2029 | + STACK_END (state); |
2030 | +} |
2031 | + |
2032 | + |
2033 | +/******************************************************************************* |
2034 | + |
2035 | +********************************************************************************/ |
2036 | +bool |
2037 | +LevelPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2038 | +{ |
2039 | + store::Item_t lUri; |
2040 | + |
2041 | + PlanIteratorState *state; |
2042 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2043 | + |
2044 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2045 | + |
2046 | + try |
2047 | + { |
2048 | + result = lUri->getLevel(); |
2049 | + } |
2050 | + catch (ZorbaException& e) |
2051 | + { |
2052 | + set_source(e, loc); |
2053 | + throw; |
2054 | + } |
2055 | + |
2056 | + STACK_PUSH(true, state); |
2057 | + |
2058 | + STACK_END (state); |
2059 | +} |
2060 | + |
2061 | + |
2062 | +/******************************************************************************* |
2063 | + |
2064 | +********************************************************************************/ |
2065 | +bool |
2066 | +IsAttributePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2067 | +{ |
2068 | + store::Item_t lUri; |
2069 | + |
2070 | + PlanIteratorState *state; |
2071 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2072 | + |
2073 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2074 | + |
2075 | + try |
2076 | + { |
2077 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isAttribute()); |
2078 | + } |
2079 | + catch (ZorbaException& e) |
2080 | + { |
2081 | + set_source(e, loc); |
2082 | + throw; |
2083 | + } |
2084 | + |
2085 | + STACK_PUSH(true,state); |
2086 | + |
2087 | + STACK_END (state); |
2088 | +} |
2089 | + |
2090 | + |
2091 | +/******************************************************************************* |
2092 | + |
2093 | +********************************************************************************/ |
2094 | +bool |
2095 | +IsCommentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2096 | +{ |
2097 | + store::Item_t lUri; |
2098 | + |
2099 | + PlanIteratorState *state; |
2100 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2101 | + |
2102 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2103 | + |
2104 | + try |
2105 | + { |
2106 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isComment()); |
2107 | + } |
2108 | + catch (ZorbaException& e) |
2109 | + { |
2110 | + set_source(e, loc); |
2111 | + throw; |
2112 | + } |
2113 | + |
2114 | + STACK_PUSH(true,state); |
2115 | + |
2116 | + STACK_END (state); |
2117 | +} |
2118 | + |
2119 | + |
2120 | +/******************************************************************************* |
2121 | + |
2122 | +********************************************************************************/ |
2123 | +bool |
2124 | +IsDocumentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2125 | +{ |
2126 | + store::Item_t lUri; |
2127 | + |
2128 | + PlanIteratorState *state; |
2129 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2130 | + |
2131 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2132 | + |
2133 | + try |
2134 | + { |
2135 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isDocument()); |
2136 | + } |
2137 | + catch (ZorbaException& e) |
2138 | + { |
2139 | + set_source(e, loc); |
2140 | + throw; |
2141 | + } |
2142 | + |
2143 | + STACK_PUSH(true,state); |
2144 | + |
2145 | + STACK_END (state); |
2146 | +} |
2147 | + |
2148 | + |
2149 | +/******************************************************************************* |
2150 | + |
2151 | +********************************************************************************/ |
2152 | +bool |
2153 | +IsElementPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2154 | +{ |
2155 | + store::Item_t lUri; |
2156 | + |
2157 | + PlanIteratorState *state; |
2158 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2159 | + |
2160 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2161 | + |
2162 | + try |
2163 | + { |
2164 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isElement()); |
2165 | + } |
2166 | + catch (ZorbaException& e) |
2167 | + { |
2168 | + set_source(e, loc); |
2169 | + throw; |
2170 | + } |
2171 | + |
2172 | + STACK_PUSH(true,state); |
2173 | + |
2174 | + STACK_END (state); |
2175 | +} |
2176 | + |
2177 | + |
2178 | +/******************************************************************************* |
2179 | + |
2180 | +********************************************************************************/ |
2181 | +bool |
2182 | +IsProcessingInstructionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2183 | +{ |
2184 | + store::Item_t lUri; |
2185 | + |
2186 | + PlanIteratorState *state; |
2187 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2188 | + |
2189 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2190 | + |
2191 | + try |
2192 | + { |
2193 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isProcessingInstruction()); |
2194 | + } |
2195 | + catch (ZorbaException& e) |
2196 | + { |
2197 | + set_source(e, loc); |
2198 | + throw; |
2199 | + } |
2200 | + |
2201 | + STACK_PUSH(true,state); |
2202 | + |
2203 | + STACK_END (state); |
2204 | +} |
2205 | + |
2206 | + |
2207 | +/******************************************************************************* |
2208 | + |
2209 | +********************************************************************************/ |
2210 | +bool |
2211 | +IsTextPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2212 | +{ |
2213 | + store::Item_t lUri; |
2214 | + |
2215 | + PlanIteratorState *state; |
2216 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2217 | + |
2218 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2219 | + |
2220 | + try |
2221 | + { |
2222 | + GENV_ITEMFACTORY->createBoolean(result, lUri->isText()); |
2223 | + } |
2224 | + catch (ZorbaException& e) |
2225 | + { |
2226 | + set_source(e, loc); |
2227 | + throw; |
2228 | + } |
2229 | + |
2230 | + STACK_PUSH(true,state); |
2231 | + |
2232 | + STACK_END (state); |
2233 | +} |
2234 | + |
2235 | + |
2236 | +/******************************************************************************* |
2237 | + |
2238 | +********************************************************************************/ |
2239 | +bool |
2240 | +IsSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2241 | +{ |
2242 | + store::Item_t lUriA; |
2243 | + store::Item_t lUriB; |
2244 | + |
2245 | + PlanIteratorState *state; |
2246 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2247 | + |
2248 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
2249 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
2250 | + |
2251 | + try |
2252 | + { |
2253 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->isSibling(lUriB)); |
2254 | + } |
2255 | + catch (ZorbaException& e) |
2256 | + { |
2257 | + set_source(e, loc); |
2258 | + throw; |
2259 | + } |
2260 | + |
2261 | + STACK_PUSH(true,state); |
2262 | + |
2263 | + STACK_END (state); |
2264 | +} |
2265 | + |
2266 | + |
2267 | +/******************************************************************************* |
2268 | + |
2269 | +********************************************************************************/ |
2270 | +bool |
2271 | +InSameTreePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2272 | +{ |
2273 | + store::Item_t lUriA; |
2274 | + store::Item_t lUriB; |
2275 | + |
2276 | + PlanIteratorState *state; |
2277 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2278 | + |
2279 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
2280 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
2281 | + |
2282 | + try |
2283 | + { |
2284 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->inSameTree(lUriB)); |
2285 | + } |
2286 | + catch (ZorbaException& e) |
2287 | + { |
2288 | + set_source(e, loc); |
2289 | + throw; |
2290 | + } |
2291 | + |
2292 | + STACK_PUSH(true,state); |
2293 | + |
2294 | + STACK_END (state); |
2295 | +} |
2296 | + |
2297 | + |
2298 | +/******************************************************************************* |
2299 | + |
2300 | +********************************************************************************/ |
2301 | +bool |
2302 | +InCollectionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2303 | +{ |
2304 | + store::Item_t lUri; |
2305 | + |
2306 | + PlanIteratorState *state; |
2307 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2308 | + |
2309 | + consumeNext(lUri, theChildren[0].getp(), planState); |
2310 | + |
2311 | + try |
2312 | + { |
2313 | + GENV_ITEMFACTORY->createBoolean(result, lUri->inCollection()); |
2314 | + } |
2315 | + catch (ZorbaException& e) |
2316 | + { |
2317 | + set_source(e, loc); |
2318 | + throw; |
2319 | + } |
2320 | + |
2321 | + STACK_PUSH(true,state); |
2322 | + |
2323 | + STACK_END (state); |
2324 | +} |
2325 | + |
2326 | + |
2327 | +/******************************************************************************* |
2328 | + |
2329 | +********************************************************************************/ |
2330 | +bool |
2331 | +InSameCollectionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const |
2332 | +{ |
2333 | + store::Item_t lUriA; |
2334 | + store::Item_t lUriB; |
2335 | + |
2336 | + PlanIteratorState *state; |
2337 | + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); |
2338 | + |
2339 | + consumeNext(lUriA, theChildren[0].getp(), planState); |
2340 | + consumeNext(lUriB, theChildren[1].getp(), planState); |
2341 | + |
2342 | + try |
2343 | + { |
2344 | + GENV_ITEMFACTORY->createBoolean(result, lUriA->inSameCollection(lUriB)); |
2345 | + } |
2346 | + catch (ZorbaException& e) |
2347 | + { |
2348 | + set_source(e, loc); |
2349 | + throw; |
2350 | + } |
2351 | + |
2352 | + STACK_PUSH(true,state); |
2353 | + |
2354 | + STACK_END (state); |
2355 | +} |
2356 | + |
2357 | +} // namespace zorba |
2358 | +/* vim:set et sw=2 ts=2: */ |
2359 | + |
2360 | |
2361 | === added file 'src/runtime/nodes/pregenerated/node_position.cpp' |
2362 | --- src/runtime/nodes/pregenerated/node_position.cpp 1970-01-01 00:00:00 +0000 |
2363 | +++ src/runtime/nodes/pregenerated/node_position.cpp 2011-11-02 17:26:24 +0000 |
2364 | @@ -0,0 +1,710 @@ |
2365 | +/* |
2366 | + * Copyright 2006-2008 The FLWOR Foundation. |
2367 | + * |
2368 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
2369 | + * you may not use this file except in compliance with the License. |
2370 | + * You may obtain a copy of the License at |
2371 | + * |
2372 | + * http://www.apache.org/licenses/LICENSE-2.0 |
2373 | + * |
2374 | + * Unless required by applicable law or agreed to in writing, software |
2375 | + * distributed under the License is distributed on an "AS IS" BASIS, |
2376 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2377 | + * See the License for the specific language governing permissions and |
2378 | + * limitations under the License. |
2379 | + */ |
2380 | + |
2381 | +// ****************************************** |
2382 | +// * * |
2383 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
2384 | +// * SEE .xml FILE WITH SAME NAME * |
2385 | +// * * |
2386 | +// ****************************************** |
2387 | + |
2388 | +#include "stdafx.h" |
2389 | +#include "zorbatypes/rchandle.h" |
2390 | +#include "zorbatypes/zstring.h" |
2391 | +#include "runtime/visitors/planiter_visitor.h" |
2392 | +#include "runtime/nodes/node_position.h" |
2393 | +#include "system/globalenv.h" |
2394 | + |
2395 | + |
2396 | + |
2397 | +namespace zorba { |
2398 | + |
2399 | +// <NodePositionIterator> |
2400 | +const char* NodePositionIterator::class_name_str = "NodePositionIterator"; |
2401 | +NodePositionIterator::class_factory<NodePositionIterator> |
2402 | +NodePositionIterator::g_class_factory; |
2403 | + |
2404 | +const serialization::ClassVersion |
2405 | +NodePositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2406 | + |
2407 | +const int NodePositionIterator::class_versions_count = |
2408 | +sizeof(NodePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2409 | + |
2410 | +void NodePositionIterator::accept(PlanIterVisitor& v) const { |
2411 | + v.beginVisit(*this); |
2412 | + |
2413 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2414 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2415 | + for ( ; lIter != lEnd; ++lIter ){ |
2416 | + (*lIter)->accept(v); |
2417 | + } |
2418 | + |
2419 | + v.endVisit(*this); |
2420 | +} |
2421 | + |
2422 | +NodePositionIterator::~NodePositionIterator() {} |
2423 | + |
2424 | +// </NodePositionIterator> |
2425 | + |
2426 | + |
2427 | +// <IsAncestorPositionIterator> |
2428 | +const char* IsAncestorPositionIterator::class_name_str = "IsAncestorPositionIterator"; |
2429 | +IsAncestorPositionIterator::class_factory<IsAncestorPositionIterator> |
2430 | +IsAncestorPositionIterator::g_class_factory; |
2431 | + |
2432 | +const serialization::ClassVersion |
2433 | +IsAncestorPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2434 | + |
2435 | +const int IsAncestorPositionIterator::class_versions_count = |
2436 | +sizeof(IsAncestorPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2437 | + |
2438 | +void IsAncestorPositionIterator::accept(PlanIterVisitor& v) const { |
2439 | + v.beginVisit(*this); |
2440 | + |
2441 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2442 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2443 | + for ( ; lIter != lEnd; ++lIter ){ |
2444 | + (*lIter)->accept(v); |
2445 | + } |
2446 | + |
2447 | + v.endVisit(*this); |
2448 | +} |
2449 | + |
2450 | +IsAncestorPositionIterator::~IsAncestorPositionIterator() {} |
2451 | + |
2452 | +// </IsAncestorPositionIterator> |
2453 | + |
2454 | + |
2455 | +// <IsFollowingSiblingPositionIterator> |
2456 | +const char* IsFollowingSiblingPositionIterator::class_name_str = "IsFollowingSiblingPositionIterator"; |
2457 | +IsFollowingSiblingPositionIterator::class_factory<IsFollowingSiblingPositionIterator> |
2458 | +IsFollowingSiblingPositionIterator::g_class_factory; |
2459 | + |
2460 | +const serialization::ClassVersion |
2461 | +IsFollowingSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2462 | + |
2463 | +const int IsFollowingSiblingPositionIterator::class_versions_count = |
2464 | +sizeof(IsFollowingSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2465 | + |
2466 | +void IsFollowingSiblingPositionIterator::accept(PlanIterVisitor& v) const { |
2467 | + v.beginVisit(*this); |
2468 | + |
2469 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2470 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2471 | + for ( ; lIter != lEnd; ++lIter ){ |
2472 | + (*lIter)->accept(v); |
2473 | + } |
2474 | + |
2475 | + v.endVisit(*this); |
2476 | +} |
2477 | + |
2478 | +IsFollowingSiblingPositionIterator::~IsFollowingSiblingPositionIterator() {} |
2479 | + |
2480 | +// </IsFollowingSiblingPositionIterator> |
2481 | + |
2482 | + |
2483 | +// <IsFollowingPositionIterator> |
2484 | +const char* IsFollowingPositionIterator::class_name_str = "IsFollowingPositionIterator"; |
2485 | +IsFollowingPositionIterator::class_factory<IsFollowingPositionIterator> |
2486 | +IsFollowingPositionIterator::g_class_factory; |
2487 | + |
2488 | +const serialization::ClassVersion |
2489 | +IsFollowingPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2490 | + |
2491 | +const int IsFollowingPositionIterator::class_versions_count = |
2492 | +sizeof(IsFollowingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2493 | + |
2494 | +void IsFollowingPositionIterator::accept(PlanIterVisitor& v) const { |
2495 | + v.beginVisit(*this); |
2496 | + |
2497 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2498 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2499 | + for ( ; lIter != lEnd; ++lIter ){ |
2500 | + (*lIter)->accept(v); |
2501 | + } |
2502 | + |
2503 | + v.endVisit(*this); |
2504 | +} |
2505 | + |
2506 | +IsFollowingPositionIterator::~IsFollowingPositionIterator() {} |
2507 | + |
2508 | +// </IsFollowingPositionIterator> |
2509 | + |
2510 | + |
2511 | +// <IsInSubtreeOfPositionIterator> |
2512 | +const char* IsInSubtreeOfPositionIterator::class_name_str = "IsInSubtreeOfPositionIterator"; |
2513 | +IsInSubtreeOfPositionIterator::class_factory<IsInSubtreeOfPositionIterator> |
2514 | +IsInSubtreeOfPositionIterator::g_class_factory; |
2515 | + |
2516 | +const serialization::ClassVersion |
2517 | +IsInSubtreeOfPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2518 | + |
2519 | +const int IsInSubtreeOfPositionIterator::class_versions_count = |
2520 | +sizeof(IsInSubtreeOfPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2521 | + |
2522 | +void IsInSubtreeOfPositionIterator::accept(PlanIterVisitor& v) const { |
2523 | + v.beginVisit(*this); |
2524 | + |
2525 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2526 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2527 | + for ( ; lIter != lEnd; ++lIter ){ |
2528 | + (*lIter)->accept(v); |
2529 | + } |
2530 | + |
2531 | + v.endVisit(*this); |
2532 | +} |
2533 | + |
2534 | +IsInSubtreeOfPositionIterator::~IsInSubtreeOfPositionIterator() {} |
2535 | + |
2536 | +// </IsInSubtreeOfPositionIterator> |
2537 | + |
2538 | + |
2539 | +// <IsDescendantPositionIterator> |
2540 | +const char* IsDescendantPositionIterator::class_name_str = "IsDescendantPositionIterator"; |
2541 | +IsDescendantPositionIterator::class_factory<IsDescendantPositionIterator> |
2542 | +IsDescendantPositionIterator::g_class_factory; |
2543 | + |
2544 | +const serialization::ClassVersion |
2545 | +IsDescendantPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2546 | + |
2547 | +const int IsDescendantPositionIterator::class_versions_count = |
2548 | +sizeof(IsDescendantPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2549 | + |
2550 | +void IsDescendantPositionIterator::accept(PlanIterVisitor& v) const { |
2551 | + v.beginVisit(*this); |
2552 | + |
2553 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2554 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2555 | + for ( ; lIter != lEnd; ++lIter ){ |
2556 | + (*lIter)->accept(v); |
2557 | + } |
2558 | + |
2559 | + v.endVisit(*this); |
2560 | +} |
2561 | + |
2562 | +IsDescendantPositionIterator::~IsDescendantPositionIterator() {} |
2563 | + |
2564 | +// </IsDescendantPositionIterator> |
2565 | + |
2566 | + |
2567 | +// <IsPrecedingSiblingPositionIterator> |
2568 | +const char* IsPrecedingSiblingPositionIterator::class_name_str = "IsPrecedingSiblingPositionIterator"; |
2569 | +IsPrecedingSiblingPositionIterator::class_factory<IsPrecedingSiblingPositionIterator> |
2570 | +IsPrecedingSiblingPositionIterator::g_class_factory; |
2571 | + |
2572 | +const serialization::ClassVersion |
2573 | +IsPrecedingSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2574 | + |
2575 | +const int IsPrecedingSiblingPositionIterator::class_versions_count = |
2576 | +sizeof(IsPrecedingSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2577 | + |
2578 | +void IsPrecedingSiblingPositionIterator::accept(PlanIterVisitor& v) const { |
2579 | + v.beginVisit(*this); |
2580 | + |
2581 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2582 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2583 | + for ( ; lIter != lEnd; ++lIter ){ |
2584 | + (*lIter)->accept(v); |
2585 | + } |
2586 | + |
2587 | + v.endVisit(*this); |
2588 | +} |
2589 | + |
2590 | +IsPrecedingSiblingPositionIterator::~IsPrecedingSiblingPositionIterator() {} |
2591 | + |
2592 | +// </IsPrecedingSiblingPositionIterator> |
2593 | + |
2594 | + |
2595 | +// <IsPrecedingPositionIterator> |
2596 | +const char* IsPrecedingPositionIterator::class_name_str = "IsPrecedingPositionIterator"; |
2597 | +IsPrecedingPositionIterator::class_factory<IsPrecedingPositionIterator> |
2598 | +IsPrecedingPositionIterator::g_class_factory; |
2599 | + |
2600 | +const serialization::ClassVersion |
2601 | +IsPrecedingPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2602 | + |
2603 | +const int IsPrecedingPositionIterator::class_versions_count = |
2604 | +sizeof(IsPrecedingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2605 | + |
2606 | +void IsPrecedingPositionIterator::accept(PlanIterVisitor& v) const { |
2607 | + v.beginVisit(*this); |
2608 | + |
2609 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2610 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2611 | + for ( ; lIter != lEnd; ++lIter ){ |
2612 | + (*lIter)->accept(v); |
2613 | + } |
2614 | + |
2615 | + v.endVisit(*this); |
2616 | +} |
2617 | + |
2618 | +IsPrecedingPositionIterator::~IsPrecedingPositionIterator() {} |
2619 | + |
2620 | +// </IsPrecedingPositionIterator> |
2621 | + |
2622 | + |
2623 | +// <IsChildPositionIterator> |
2624 | +const char* IsChildPositionIterator::class_name_str = "IsChildPositionIterator"; |
2625 | +IsChildPositionIterator::class_factory<IsChildPositionIterator> |
2626 | +IsChildPositionIterator::g_class_factory; |
2627 | + |
2628 | +const serialization::ClassVersion |
2629 | +IsChildPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2630 | + |
2631 | +const int IsChildPositionIterator::class_versions_count = |
2632 | +sizeof(IsChildPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2633 | + |
2634 | +void IsChildPositionIterator::accept(PlanIterVisitor& v) const { |
2635 | + v.beginVisit(*this); |
2636 | + |
2637 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2638 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2639 | + for ( ; lIter != lEnd; ++lIter ){ |
2640 | + (*lIter)->accept(v); |
2641 | + } |
2642 | + |
2643 | + v.endVisit(*this); |
2644 | +} |
2645 | + |
2646 | +IsChildPositionIterator::~IsChildPositionIterator() {} |
2647 | + |
2648 | +// </IsChildPositionIterator> |
2649 | + |
2650 | + |
2651 | +// <IsAttributeOfPositionIterator> |
2652 | +const char* IsAttributeOfPositionIterator::class_name_str = "IsAttributeOfPositionIterator"; |
2653 | +IsAttributeOfPositionIterator::class_factory<IsAttributeOfPositionIterator> |
2654 | +IsAttributeOfPositionIterator::g_class_factory; |
2655 | + |
2656 | +const serialization::ClassVersion |
2657 | +IsAttributeOfPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2658 | + |
2659 | +const int IsAttributeOfPositionIterator::class_versions_count = |
2660 | +sizeof(IsAttributeOfPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2661 | + |
2662 | +void IsAttributeOfPositionIterator::accept(PlanIterVisitor& v) const { |
2663 | + v.beginVisit(*this); |
2664 | + |
2665 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2666 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2667 | + for ( ; lIter != lEnd; ++lIter ){ |
2668 | + (*lIter)->accept(v); |
2669 | + } |
2670 | + |
2671 | + v.endVisit(*this); |
2672 | +} |
2673 | + |
2674 | +IsAttributeOfPositionIterator::~IsAttributeOfPositionIterator() {} |
2675 | + |
2676 | +// </IsAttributeOfPositionIterator> |
2677 | + |
2678 | + |
2679 | +// <IsParentPositionIterator> |
2680 | +const char* IsParentPositionIterator::class_name_str = "IsParentPositionIterator"; |
2681 | +IsParentPositionIterator::class_factory<IsParentPositionIterator> |
2682 | +IsParentPositionIterator::g_class_factory; |
2683 | + |
2684 | +const serialization::ClassVersion |
2685 | +IsParentPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2686 | + |
2687 | +const int IsParentPositionIterator::class_versions_count = |
2688 | +sizeof(IsParentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2689 | + |
2690 | +void IsParentPositionIterator::accept(PlanIterVisitor& v) const { |
2691 | + v.beginVisit(*this); |
2692 | + |
2693 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2694 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2695 | + for ( ; lIter != lEnd; ++lIter ){ |
2696 | + (*lIter)->accept(v); |
2697 | + } |
2698 | + |
2699 | + v.endVisit(*this); |
2700 | +} |
2701 | + |
2702 | +IsParentPositionIterator::~IsParentPositionIterator() {} |
2703 | + |
2704 | +// </IsParentPositionIterator> |
2705 | + |
2706 | + |
2707 | +// <IsPrecedingInDocumentOrderPositionIterator> |
2708 | +const char* IsPrecedingInDocumentOrderPositionIterator::class_name_str = "IsPrecedingInDocumentOrderPositionIterator"; |
2709 | +IsPrecedingInDocumentOrderPositionIterator::class_factory<IsPrecedingInDocumentOrderPositionIterator> |
2710 | +IsPrecedingInDocumentOrderPositionIterator::g_class_factory; |
2711 | + |
2712 | +const serialization::ClassVersion |
2713 | +IsPrecedingInDocumentOrderPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2714 | + |
2715 | +const int IsPrecedingInDocumentOrderPositionIterator::class_versions_count = |
2716 | +sizeof(IsPrecedingInDocumentOrderPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2717 | + |
2718 | +void IsPrecedingInDocumentOrderPositionIterator::accept(PlanIterVisitor& v) const { |
2719 | + v.beginVisit(*this); |
2720 | + |
2721 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2722 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2723 | + for ( ; lIter != lEnd; ++lIter ){ |
2724 | + (*lIter)->accept(v); |
2725 | + } |
2726 | + |
2727 | + v.endVisit(*this); |
2728 | +} |
2729 | + |
2730 | +IsPrecedingInDocumentOrderPositionIterator::~IsPrecedingInDocumentOrderPositionIterator() {} |
2731 | + |
2732 | +// </IsPrecedingInDocumentOrderPositionIterator> |
2733 | + |
2734 | + |
2735 | +// <IsFollowingInDocumentOrderPositionIterator> |
2736 | +const char* IsFollowingInDocumentOrderPositionIterator::class_name_str = "IsFollowingInDocumentOrderPositionIterator"; |
2737 | +IsFollowingInDocumentOrderPositionIterator::class_factory<IsFollowingInDocumentOrderPositionIterator> |
2738 | +IsFollowingInDocumentOrderPositionIterator::g_class_factory; |
2739 | + |
2740 | +const serialization::ClassVersion |
2741 | +IsFollowingInDocumentOrderPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2742 | + |
2743 | +const int IsFollowingInDocumentOrderPositionIterator::class_versions_count = |
2744 | +sizeof(IsFollowingInDocumentOrderPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2745 | + |
2746 | +void IsFollowingInDocumentOrderPositionIterator::accept(PlanIterVisitor& v) const { |
2747 | + v.beginVisit(*this); |
2748 | + |
2749 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2750 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2751 | + for ( ; lIter != lEnd; ++lIter ){ |
2752 | + (*lIter)->accept(v); |
2753 | + } |
2754 | + |
2755 | + v.endVisit(*this); |
2756 | +} |
2757 | + |
2758 | +IsFollowingInDocumentOrderPositionIterator::~IsFollowingInDocumentOrderPositionIterator() {} |
2759 | + |
2760 | +// </IsFollowingInDocumentOrderPositionIterator> |
2761 | + |
2762 | + |
2763 | +// <LevelPositionIterator> |
2764 | +const char* LevelPositionIterator::class_name_str = "LevelPositionIterator"; |
2765 | +LevelPositionIterator::class_factory<LevelPositionIterator> |
2766 | +LevelPositionIterator::g_class_factory; |
2767 | + |
2768 | +const serialization::ClassVersion |
2769 | +LevelPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2770 | + |
2771 | +const int LevelPositionIterator::class_versions_count = |
2772 | +sizeof(LevelPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2773 | + |
2774 | +void LevelPositionIterator::accept(PlanIterVisitor& v) const { |
2775 | + v.beginVisit(*this); |
2776 | + |
2777 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2778 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2779 | + for ( ; lIter != lEnd; ++lIter ){ |
2780 | + (*lIter)->accept(v); |
2781 | + } |
2782 | + |
2783 | + v.endVisit(*this); |
2784 | +} |
2785 | + |
2786 | +LevelPositionIterator::~LevelPositionIterator() {} |
2787 | + |
2788 | +// </LevelPositionIterator> |
2789 | + |
2790 | + |
2791 | +// <IsAttributePositionIterator> |
2792 | +const char* IsAttributePositionIterator::class_name_str = "IsAttributePositionIterator"; |
2793 | +IsAttributePositionIterator::class_factory<IsAttributePositionIterator> |
2794 | +IsAttributePositionIterator::g_class_factory; |
2795 | + |
2796 | +const serialization::ClassVersion |
2797 | +IsAttributePositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2798 | + |
2799 | +const int IsAttributePositionIterator::class_versions_count = |
2800 | +sizeof(IsAttributePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2801 | + |
2802 | +void IsAttributePositionIterator::accept(PlanIterVisitor& v) const { |
2803 | + v.beginVisit(*this); |
2804 | + |
2805 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2806 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2807 | + for ( ; lIter != lEnd; ++lIter ){ |
2808 | + (*lIter)->accept(v); |
2809 | + } |
2810 | + |
2811 | + v.endVisit(*this); |
2812 | +} |
2813 | + |
2814 | +IsAttributePositionIterator::~IsAttributePositionIterator() {} |
2815 | + |
2816 | +// </IsAttributePositionIterator> |
2817 | + |
2818 | + |
2819 | +// <IsCommentPositionIterator> |
2820 | +const char* IsCommentPositionIterator::class_name_str = "IsCommentPositionIterator"; |
2821 | +IsCommentPositionIterator::class_factory<IsCommentPositionIterator> |
2822 | +IsCommentPositionIterator::g_class_factory; |
2823 | + |
2824 | +const serialization::ClassVersion |
2825 | +IsCommentPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2826 | + |
2827 | +const int IsCommentPositionIterator::class_versions_count = |
2828 | +sizeof(IsCommentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2829 | + |
2830 | +void IsCommentPositionIterator::accept(PlanIterVisitor& v) const { |
2831 | + v.beginVisit(*this); |
2832 | + |
2833 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2834 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2835 | + for ( ; lIter != lEnd; ++lIter ){ |
2836 | + (*lIter)->accept(v); |
2837 | + } |
2838 | + |
2839 | + v.endVisit(*this); |
2840 | +} |
2841 | + |
2842 | +IsCommentPositionIterator::~IsCommentPositionIterator() {} |
2843 | + |
2844 | +// </IsCommentPositionIterator> |
2845 | + |
2846 | + |
2847 | +// <IsDocumentPositionIterator> |
2848 | +const char* IsDocumentPositionIterator::class_name_str = "IsDocumentPositionIterator"; |
2849 | +IsDocumentPositionIterator::class_factory<IsDocumentPositionIterator> |
2850 | +IsDocumentPositionIterator::g_class_factory; |
2851 | + |
2852 | +const serialization::ClassVersion |
2853 | +IsDocumentPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2854 | + |
2855 | +const int IsDocumentPositionIterator::class_versions_count = |
2856 | +sizeof(IsDocumentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2857 | + |
2858 | +void IsDocumentPositionIterator::accept(PlanIterVisitor& v) const { |
2859 | + v.beginVisit(*this); |
2860 | + |
2861 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2862 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2863 | + for ( ; lIter != lEnd; ++lIter ){ |
2864 | + (*lIter)->accept(v); |
2865 | + } |
2866 | + |
2867 | + v.endVisit(*this); |
2868 | +} |
2869 | + |
2870 | +IsDocumentPositionIterator::~IsDocumentPositionIterator() {} |
2871 | + |
2872 | +// </IsDocumentPositionIterator> |
2873 | + |
2874 | + |
2875 | +// <IsElementPositionIterator> |
2876 | +const char* IsElementPositionIterator::class_name_str = "IsElementPositionIterator"; |
2877 | +IsElementPositionIterator::class_factory<IsElementPositionIterator> |
2878 | +IsElementPositionIterator::g_class_factory; |
2879 | + |
2880 | +const serialization::ClassVersion |
2881 | +IsElementPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2882 | + |
2883 | +const int IsElementPositionIterator::class_versions_count = |
2884 | +sizeof(IsElementPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2885 | + |
2886 | +void IsElementPositionIterator::accept(PlanIterVisitor& v) const { |
2887 | + v.beginVisit(*this); |
2888 | + |
2889 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2890 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2891 | + for ( ; lIter != lEnd; ++lIter ){ |
2892 | + (*lIter)->accept(v); |
2893 | + } |
2894 | + |
2895 | + v.endVisit(*this); |
2896 | +} |
2897 | + |
2898 | +IsElementPositionIterator::~IsElementPositionIterator() {} |
2899 | + |
2900 | +// </IsElementPositionIterator> |
2901 | + |
2902 | + |
2903 | +// <IsProcessingInstructionPositionIterator> |
2904 | +const char* IsProcessingInstructionPositionIterator::class_name_str = "IsProcessingInstructionPositionIterator"; |
2905 | +IsProcessingInstructionPositionIterator::class_factory<IsProcessingInstructionPositionIterator> |
2906 | +IsProcessingInstructionPositionIterator::g_class_factory; |
2907 | + |
2908 | +const serialization::ClassVersion |
2909 | +IsProcessingInstructionPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2910 | + |
2911 | +const int IsProcessingInstructionPositionIterator::class_versions_count = |
2912 | +sizeof(IsProcessingInstructionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2913 | + |
2914 | +void IsProcessingInstructionPositionIterator::accept(PlanIterVisitor& v) const { |
2915 | + v.beginVisit(*this); |
2916 | + |
2917 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2918 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2919 | + for ( ; lIter != lEnd; ++lIter ){ |
2920 | + (*lIter)->accept(v); |
2921 | + } |
2922 | + |
2923 | + v.endVisit(*this); |
2924 | +} |
2925 | + |
2926 | +IsProcessingInstructionPositionIterator::~IsProcessingInstructionPositionIterator() {} |
2927 | + |
2928 | +// </IsProcessingInstructionPositionIterator> |
2929 | + |
2930 | + |
2931 | +// <IsTextPositionIterator> |
2932 | +const char* IsTextPositionIterator::class_name_str = "IsTextPositionIterator"; |
2933 | +IsTextPositionIterator::class_factory<IsTextPositionIterator> |
2934 | +IsTextPositionIterator::g_class_factory; |
2935 | + |
2936 | +const serialization::ClassVersion |
2937 | +IsTextPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2938 | + |
2939 | +const int IsTextPositionIterator::class_versions_count = |
2940 | +sizeof(IsTextPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2941 | + |
2942 | +void IsTextPositionIterator::accept(PlanIterVisitor& v) const { |
2943 | + v.beginVisit(*this); |
2944 | + |
2945 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2946 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2947 | + for ( ; lIter != lEnd; ++lIter ){ |
2948 | + (*lIter)->accept(v); |
2949 | + } |
2950 | + |
2951 | + v.endVisit(*this); |
2952 | +} |
2953 | + |
2954 | +IsTextPositionIterator::~IsTextPositionIterator() {} |
2955 | + |
2956 | +// </IsTextPositionIterator> |
2957 | + |
2958 | + |
2959 | +// <IsSiblingPositionIterator> |
2960 | +const char* IsSiblingPositionIterator::class_name_str = "IsSiblingPositionIterator"; |
2961 | +IsSiblingPositionIterator::class_factory<IsSiblingPositionIterator> |
2962 | +IsSiblingPositionIterator::g_class_factory; |
2963 | + |
2964 | +const serialization::ClassVersion |
2965 | +IsSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2966 | + |
2967 | +const int IsSiblingPositionIterator::class_versions_count = |
2968 | +sizeof(IsSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2969 | + |
2970 | +void IsSiblingPositionIterator::accept(PlanIterVisitor& v) const { |
2971 | + v.beginVisit(*this); |
2972 | + |
2973 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
2974 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
2975 | + for ( ; lIter != lEnd; ++lIter ){ |
2976 | + (*lIter)->accept(v); |
2977 | + } |
2978 | + |
2979 | + v.endVisit(*this); |
2980 | +} |
2981 | + |
2982 | +IsSiblingPositionIterator::~IsSiblingPositionIterator() {} |
2983 | + |
2984 | +// </IsSiblingPositionIterator> |
2985 | + |
2986 | + |
2987 | +// <InSameTreePositionIterator> |
2988 | +const char* InSameTreePositionIterator::class_name_str = "InSameTreePositionIterator"; |
2989 | +InSameTreePositionIterator::class_factory<InSameTreePositionIterator> |
2990 | +InSameTreePositionIterator::g_class_factory; |
2991 | + |
2992 | +const serialization::ClassVersion |
2993 | +InSameTreePositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
2994 | + |
2995 | +const int InSameTreePositionIterator::class_versions_count = |
2996 | +sizeof(InSameTreePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
2997 | + |
2998 | +void InSameTreePositionIterator::accept(PlanIterVisitor& v) const { |
2999 | + v.beginVisit(*this); |
3000 | + |
3001 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
3002 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
3003 | + for ( ; lIter != lEnd; ++lIter ){ |
3004 | + (*lIter)->accept(v); |
3005 | + } |
3006 | + |
3007 | + v.endVisit(*this); |
3008 | +} |
3009 | + |
3010 | +InSameTreePositionIterator::~InSameTreePositionIterator() {} |
3011 | + |
3012 | +// </InSameTreePositionIterator> |
3013 | + |
3014 | + |
3015 | +// <InCollectionPositionIterator> |
3016 | +const char* InCollectionPositionIterator::class_name_str = "InCollectionPositionIterator"; |
3017 | +InCollectionPositionIterator::class_factory<InCollectionPositionIterator> |
3018 | +InCollectionPositionIterator::g_class_factory; |
3019 | + |
3020 | +const serialization::ClassVersion |
3021 | +InCollectionPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
3022 | + |
3023 | +const int InCollectionPositionIterator::class_versions_count = |
3024 | +sizeof(InCollectionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
3025 | + |
3026 | +void InCollectionPositionIterator::accept(PlanIterVisitor& v) const { |
3027 | + v.beginVisit(*this); |
3028 | + |
3029 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
3030 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
3031 | + for ( ; lIter != lEnd; ++lIter ){ |
3032 | + (*lIter)->accept(v); |
3033 | + } |
3034 | + |
3035 | + v.endVisit(*this); |
3036 | +} |
3037 | + |
3038 | +InCollectionPositionIterator::~InCollectionPositionIterator() {} |
3039 | + |
3040 | +// </InCollectionPositionIterator> |
3041 | + |
3042 | + |
3043 | +// <InSameCollectionPositionIterator> |
3044 | +const char* InSameCollectionPositionIterator::class_name_str = "InSameCollectionPositionIterator"; |
3045 | +InSameCollectionPositionIterator::class_factory<InSameCollectionPositionIterator> |
3046 | +InSameCollectionPositionIterator::g_class_factory; |
3047 | + |
3048 | +const serialization::ClassVersion |
3049 | +InSameCollectionPositionIterator::class_versions[] ={{ 1, 0x000905, false}}; |
3050 | + |
3051 | +const int InSameCollectionPositionIterator::class_versions_count = |
3052 | +sizeof(InSameCollectionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion); |
3053 | + |
3054 | +void InSameCollectionPositionIterator::accept(PlanIterVisitor& v) const { |
3055 | + v.beginVisit(*this); |
3056 | + |
3057 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
3058 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
3059 | + for ( ; lIter != lEnd; ++lIter ){ |
3060 | + (*lIter)->accept(v); |
3061 | + } |
3062 | + |
3063 | + v.endVisit(*this); |
3064 | +} |
3065 | + |
3066 | +InSameCollectionPositionIterator::~InSameCollectionPositionIterator() {} |
3067 | + |
3068 | +// </InSameCollectionPositionIterator> |
3069 | + |
3070 | + |
3071 | + |
3072 | +} |
3073 | + |
3074 | + |
3075 | |
3076 | === added file 'src/runtime/nodes/pregenerated/node_position.h' |
3077 | --- src/runtime/nodes/pregenerated/node_position.h 1970-01-01 00:00:00 +0000 |
3078 | +++ src/runtime/nodes/pregenerated/node_position.h 2011-11-02 17:26:24 +0000 |
3079 | @@ -0,0 +1,858 @@ |
3080 | +/* |
3081 | + * Copyright 2006-2008 The FLWOR Foundation. |
3082 | + * |
3083 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
3084 | + * you may not use this file except in compliance with the License. |
3085 | + * You may obtain a copy of the License at |
3086 | + * |
3087 | + * http://www.apache.org/licenses/LICENSE-2.0 |
3088 | + * |
3089 | + * Unless required by applicable law or agreed to in writing, software |
3090 | + * distributed under the License is distributed on an "AS IS" BASIS, |
3091 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
3092 | + * See the License for the specific language governing permissions and |
3093 | + * limitations under the License. |
3094 | + */ |
3095 | + |
3096 | +// ****************************************** |
3097 | +// * * |
3098 | +// * THIS IS A GENERATED FILE. DO NOT EDIT! * |
3099 | +// * SEE .xml FILE WITH SAME NAME * |
3100 | +// * * |
3101 | +// ****************************************** |
3102 | +#ifndef ZORBA_RUNTIME_NODES_NODE_POSITION_H |
3103 | +#define ZORBA_RUNTIME_NODES_NODE_POSITION_H |
3104 | + |
3105 | + |
3106 | +#include "common/shared_types.h" |
3107 | + |
3108 | + |
3109 | + |
3110 | +#include "runtime/base/narybase.h" |
3111 | + |
3112 | + |
3113 | +namespace zorba { |
3114 | + |
3115 | +/** |
3116 | + * |
3117 | + * Author: Federico Cavalieri |
3118 | + */ |
3119 | +class NodePositionIterator : public NaryBaseIterator<NodePositionIterator, PlanIteratorState> |
3120 | +{ |
3121 | +public: |
3122 | + SERIALIZABLE_CLASS(NodePositionIterator); |
3123 | + |
3124 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodePositionIterator, |
3125 | + NaryBaseIterator<NodePositionIterator, PlanIteratorState>); |
3126 | + |
3127 | + void serialize( ::zorba::serialization::Archiver& ar) |
3128 | + { |
3129 | + serialize_baseclass(ar, |
3130 | + (NaryBaseIterator<NodePositionIterator, PlanIteratorState>*)this); |
3131 | + } |
3132 | + |
3133 | + NodePositionIterator( |
3134 | + static_context* sctx, |
3135 | + const QueryLoc& loc, |
3136 | + std::vector<PlanIter_t>& children) |
3137 | + : |
3138 | + NaryBaseIterator<NodePositionIterator, PlanIteratorState>(sctx, loc, children) |
3139 | + {} |
3140 | + |
3141 | + virtual ~NodePositionIterator(); |
3142 | + |
3143 | + void accept(PlanIterVisitor& v) const; |
3144 | + |
3145 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3146 | +}; |
3147 | + |
3148 | + |
3149 | +/** |
3150 | + * |
3151 | + * Author: Federico Cavalieri |
3152 | + */ |
3153 | +class IsAncestorPositionIterator : public NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState> |
3154 | +{ |
3155 | +public: |
3156 | + SERIALIZABLE_CLASS(IsAncestorPositionIterator); |
3157 | + |
3158 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAncestorPositionIterator, |
3159 | + NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>); |
3160 | + |
3161 | + void serialize( ::zorba::serialization::Archiver& ar) |
3162 | + { |
3163 | + serialize_baseclass(ar, |
3164 | + (NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>*)this); |
3165 | + } |
3166 | + |
3167 | + IsAncestorPositionIterator( |
3168 | + static_context* sctx, |
3169 | + const QueryLoc& loc, |
3170 | + std::vector<PlanIter_t>& children) |
3171 | + : |
3172 | + NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>(sctx, loc, children) |
3173 | + {} |
3174 | + |
3175 | + virtual ~IsAncestorPositionIterator(); |
3176 | + |
3177 | + void accept(PlanIterVisitor& v) const; |
3178 | + |
3179 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3180 | +}; |
3181 | + |
3182 | + |
3183 | +/** |
3184 | + * |
3185 | + * Author: Federico Cavalieri |
3186 | + */ |
3187 | +class IsFollowingSiblingPositionIterator : public NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState> |
3188 | +{ |
3189 | +public: |
3190 | + SERIALIZABLE_CLASS(IsFollowingSiblingPositionIterator); |
3191 | + |
3192 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingSiblingPositionIterator, |
3193 | + NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>); |
3194 | + |
3195 | + void serialize( ::zorba::serialization::Archiver& ar) |
3196 | + { |
3197 | + serialize_baseclass(ar, |
3198 | + (NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>*)this); |
3199 | + } |
3200 | + |
3201 | + IsFollowingSiblingPositionIterator( |
3202 | + static_context* sctx, |
3203 | + const QueryLoc& loc, |
3204 | + std::vector<PlanIter_t>& children) |
3205 | + : |
3206 | + NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>(sctx, loc, children) |
3207 | + {} |
3208 | + |
3209 | + virtual ~IsFollowingSiblingPositionIterator(); |
3210 | + |
3211 | + void accept(PlanIterVisitor& v) const; |
3212 | + |
3213 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3214 | +}; |
3215 | + |
3216 | + |
3217 | +/** |
3218 | + * |
3219 | + * Author: Federico Cavalieri |
3220 | + */ |
3221 | +class IsFollowingPositionIterator : public NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState> |
3222 | +{ |
3223 | +public: |
3224 | + SERIALIZABLE_CLASS(IsFollowingPositionIterator); |
3225 | + |
3226 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingPositionIterator, |
3227 | + NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>); |
3228 | + |
3229 | + void serialize( ::zorba::serialization::Archiver& ar) |
3230 | + { |
3231 | + serialize_baseclass(ar, |
3232 | + (NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>*)this); |
3233 | + } |
3234 | + |
3235 | + IsFollowingPositionIterator( |
3236 | + static_context* sctx, |
3237 | + const QueryLoc& loc, |
3238 | + std::vector<PlanIter_t>& children) |
3239 | + : |
3240 | + NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>(sctx, loc, children) |
3241 | + {} |
3242 | + |
3243 | + virtual ~IsFollowingPositionIterator(); |
3244 | + |
3245 | + void accept(PlanIterVisitor& v) const; |
3246 | + |
3247 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3248 | +}; |
3249 | + |
3250 | + |
3251 | +/** |
3252 | + * |
3253 | + * Author: Federico Cavalieri |
3254 | + */ |
3255 | +class IsInSubtreeOfPositionIterator : public NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState> |
3256 | +{ |
3257 | +public: |
3258 | + SERIALIZABLE_CLASS(IsInSubtreeOfPositionIterator); |
3259 | + |
3260 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsInSubtreeOfPositionIterator, |
3261 | + NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>); |
3262 | + |
3263 | + void serialize( ::zorba::serialization::Archiver& ar) |
3264 | + { |
3265 | + serialize_baseclass(ar, |
3266 | + (NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>*)this); |
3267 | + } |
3268 | + |
3269 | + IsInSubtreeOfPositionIterator( |
3270 | + static_context* sctx, |
3271 | + const QueryLoc& loc, |
3272 | + std::vector<PlanIter_t>& children) |
3273 | + : |
3274 | + NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>(sctx, loc, children) |
3275 | + {} |
3276 | + |
3277 | + virtual ~IsInSubtreeOfPositionIterator(); |
3278 | + |
3279 | + void accept(PlanIterVisitor& v) const; |
3280 | + |
3281 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3282 | +}; |
3283 | + |
3284 | + |
3285 | +/** |
3286 | + * |
3287 | + * Author: Federico Cavalieri |
3288 | + */ |
3289 | +class IsDescendantPositionIterator : public NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState> |
3290 | +{ |
3291 | +public: |
3292 | + SERIALIZABLE_CLASS(IsDescendantPositionIterator); |
3293 | + |
3294 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDescendantPositionIterator, |
3295 | + NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>); |
3296 | + |
3297 | + void serialize( ::zorba::serialization::Archiver& ar) |
3298 | + { |
3299 | + serialize_baseclass(ar, |
3300 | + (NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>*)this); |
3301 | + } |
3302 | + |
3303 | + IsDescendantPositionIterator( |
3304 | + static_context* sctx, |
3305 | + const QueryLoc& loc, |
3306 | + std::vector<PlanIter_t>& children) |
3307 | + : |
3308 | + NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>(sctx, loc, children) |
3309 | + {} |
3310 | + |
3311 | + virtual ~IsDescendantPositionIterator(); |
3312 | + |
3313 | + void accept(PlanIterVisitor& v) const; |
3314 | + |
3315 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3316 | +}; |
3317 | + |
3318 | + |
3319 | +/** |
3320 | + * |
3321 | + * Author: Federico Cavalieri |
3322 | + */ |
3323 | +class IsPrecedingSiblingPositionIterator : public NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState> |
3324 | +{ |
3325 | +public: |
3326 | + SERIALIZABLE_CLASS(IsPrecedingSiblingPositionIterator); |
3327 | + |
3328 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingSiblingPositionIterator, |
3329 | + NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>); |
3330 | + |
3331 | + void serialize( ::zorba::serialization::Archiver& ar) |
3332 | + { |
3333 | + serialize_baseclass(ar, |
3334 | + (NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>*)this); |
3335 | + } |
3336 | + |
3337 | + IsPrecedingSiblingPositionIterator( |
3338 | + static_context* sctx, |
3339 | + const QueryLoc& loc, |
3340 | + std::vector<PlanIter_t>& children) |
3341 | + : |
3342 | + NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>(sctx, loc, children) |
3343 | + {} |
3344 | + |
3345 | + virtual ~IsPrecedingSiblingPositionIterator(); |
3346 | + |
3347 | + void accept(PlanIterVisitor& v) const; |
3348 | + |
3349 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3350 | +}; |
3351 | + |
3352 | + |
3353 | +/** |
3354 | + * |
3355 | + * Author: Federico Cavalieri |
3356 | + */ |
3357 | +class IsPrecedingPositionIterator : public NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState> |
3358 | +{ |
3359 | +public: |
3360 | + SERIALIZABLE_CLASS(IsPrecedingPositionIterator); |
3361 | + |
3362 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingPositionIterator, |
3363 | + NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>); |
3364 | + |
3365 | + void serialize( ::zorba::serialization::Archiver& ar) |
3366 | + { |
3367 | + serialize_baseclass(ar, |
3368 | + (NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>*)this); |
3369 | + } |
3370 | + |
3371 | + IsPrecedingPositionIterator( |
3372 | + static_context* sctx, |
3373 | + const QueryLoc& loc, |
3374 | + std::vector<PlanIter_t>& children) |
3375 | + : |
3376 | + NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>(sctx, loc, children) |
3377 | + {} |
3378 | + |
3379 | + virtual ~IsPrecedingPositionIterator(); |
3380 | + |
3381 | + void accept(PlanIterVisitor& v) const; |
3382 | + |
3383 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3384 | +}; |
3385 | + |
3386 | + |
3387 | +/** |
3388 | + * |
3389 | + * Author: Federico Cavalieri |
3390 | + */ |
3391 | +class IsChildPositionIterator : public NaryBaseIterator<IsChildPositionIterator, PlanIteratorState> |
3392 | +{ |
3393 | +public: |
3394 | + SERIALIZABLE_CLASS(IsChildPositionIterator); |
3395 | + |
3396 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsChildPositionIterator, |
3397 | + NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>); |
3398 | + |
3399 | + void serialize( ::zorba::serialization::Archiver& ar) |
3400 | + { |
3401 | + serialize_baseclass(ar, |
3402 | + (NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>*)this); |
3403 | + } |
3404 | + |
3405 | + IsChildPositionIterator( |
3406 | + static_context* sctx, |
3407 | + const QueryLoc& loc, |
3408 | + std::vector<PlanIter_t>& children) |
3409 | + : |
3410 | + NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>(sctx, loc, children) |
3411 | + {} |
3412 | + |
3413 | + virtual ~IsChildPositionIterator(); |
3414 | + |
3415 | + void accept(PlanIterVisitor& v) const; |
3416 | + |
3417 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3418 | +}; |
3419 | + |
3420 | + |
3421 | +/** |
3422 | + * |
3423 | + * Author: Federico Cavalieri |
3424 | + */ |
3425 | +class IsAttributeOfPositionIterator : public NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState> |
3426 | +{ |
3427 | +public: |
3428 | + SERIALIZABLE_CLASS(IsAttributeOfPositionIterator); |
3429 | + |
3430 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAttributeOfPositionIterator, |
3431 | + NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>); |
3432 | + |
3433 | + void serialize( ::zorba::serialization::Archiver& ar) |
3434 | + { |
3435 | + serialize_baseclass(ar, |
3436 | + (NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>*)this); |
3437 | + } |
3438 | + |
3439 | + IsAttributeOfPositionIterator( |
3440 | + static_context* sctx, |
3441 | + const QueryLoc& loc, |
3442 | + std::vector<PlanIter_t>& children) |
3443 | + : |
3444 | + NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>(sctx, loc, children) |
3445 | + {} |
3446 | + |
3447 | + virtual ~IsAttributeOfPositionIterator(); |
3448 | + |
3449 | + void accept(PlanIterVisitor& v) const; |
3450 | + |
3451 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3452 | +}; |
3453 | + |
3454 | + |
3455 | +/** |
3456 | + * |
3457 | + * Author: Federico Cavalieri |
3458 | + */ |
3459 | +class IsParentPositionIterator : public NaryBaseIterator<IsParentPositionIterator, PlanIteratorState> |
3460 | +{ |
3461 | +public: |
3462 | + SERIALIZABLE_CLASS(IsParentPositionIterator); |
3463 | + |
3464 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsParentPositionIterator, |
3465 | + NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>); |
3466 | + |
3467 | + void serialize( ::zorba::serialization::Archiver& ar) |
3468 | + { |
3469 | + serialize_baseclass(ar, |
3470 | + (NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>*)this); |
3471 | + } |
3472 | + |
3473 | + IsParentPositionIterator( |
3474 | + static_context* sctx, |
3475 | + const QueryLoc& loc, |
3476 | + std::vector<PlanIter_t>& children) |
3477 | + : |
3478 | + NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>(sctx, loc, children) |
3479 | + {} |
3480 | + |
3481 | + virtual ~IsParentPositionIterator(); |
3482 | + |
3483 | + void accept(PlanIterVisitor& v) const; |
3484 | + |
3485 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3486 | +}; |
3487 | + |
3488 | + |
3489 | +/** |
3490 | + * |
3491 | + * Author: Federico Cavalieri |
3492 | + */ |
3493 | +class IsPrecedingInDocumentOrderPositionIterator : public NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState> |
3494 | +{ |
3495 | +public: |
3496 | + SERIALIZABLE_CLASS(IsPrecedingInDocumentOrderPositionIterator); |
3497 | + |
3498 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingInDocumentOrderPositionIterator, |
3499 | + NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>); |
3500 | + |
3501 | + void serialize( ::zorba::serialization::Archiver& ar) |
3502 | + { |
3503 | + serialize_baseclass(ar, |
3504 | + (NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>*)this); |
3505 | + } |
3506 | + |
3507 | + IsPrecedingInDocumentOrderPositionIterator( |
3508 | + static_context* sctx, |
3509 | + const QueryLoc& loc, |
3510 | + std::vector<PlanIter_t>& children) |
3511 | + : |
3512 | + NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>(sctx, loc, children) |
3513 | + {} |
3514 | + |
3515 | + virtual ~IsPrecedingInDocumentOrderPositionIterator(); |
3516 | + |
3517 | + void accept(PlanIterVisitor& v) const; |
3518 | + |
3519 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3520 | +}; |
3521 | + |
3522 | + |
3523 | +/** |
3524 | + * |
3525 | + * Author: Federico Cavalieri |
3526 | + */ |
3527 | +class IsFollowingInDocumentOrderPositionIterator : public NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState> |
3528 | +{ |
3529 | +public: |
3530 | + SERIALIZABLE_CLASS(IsFollowingInDocumentOrderPositionIterator); |
3531 | + |
3532 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingInDocumentOrderPositionIterator, |
3533 | + NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>); |
3534 | + |
3535 | + void serialize( ::zorba::serialization::Archiver& ar) |
3536 | + { |
3537 | + serialize_baseclass(ar, |
3538 | + (NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>*)this); |
3539 | + } |
3540 | + |
3541 | + IsFollowingInDocumentOrderPositionIterator( |
3542 | + static_context* sctx, |
3543 | + const QueryLoc& loc, |
3544 | + std::vector<PlanIter_t>& children) |
3545 | + : |
3546 | + NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>(sctx, loc, children) |
3547 | + {} |
3548 | + |
3549 | + virtual ~IsFollowingInDocumentOrderPositionIterator(); |
3550 | + |
3551 | + void accept(PlanIterVisitor& v) const; |
3552 | + |
3553 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3554 | +}; |
3555 | + |
3556 | + |
3557 | +/** |
3558 | + * |
3559 | + * Author: Federico Cavalieri |
3560 | + */ |
3561 | +class LevelPositionIterator : public NaryBaseIterator<LevelPositionIterator, PlanIteratorState> |
3562 | +{ |
3563 | +public: |
3564 | + SERIALIZABLE_CLASS(LevelPositionIterator); |
3565 | + |
3566 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(LevelPositionIterator, |
3567 | + NaryBaseIterator<LevelPositionIterator, PlanIteratorState>); |
3568 | + |
3569 | + void serialize( ::zorba::serialization::Archiver& ar) |
3570 | + { |
3571 | + serialize_baseclass(ar, |
3572 | + (NaryBaseIterator<LevelPositionIterator, PlanIteratorState>*)this); |
3573 | + } |
3574 | + |
3575 | + LevelPositionIterator( |
3576 | + static_context* sctx, |
3577 | + const QueryLoc& loc, |
3578 | + std::vector<PlanIter_t>& children) |
3579 | + : |
3580 | + NaryBaseIterator<LevelPositionIterator, PlanIteratorState>(sctx, loc, children) |
3581 | + {} |
3582 | + |
3583 | + virtual ~LevelPositionIterator(); |
3584 | + |
3585 | + void accept(PlanIterVisitor& v) const; |
3586 | + |
3587 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3588 | +}; |
3589 | + |
3590 | + |
3591 | +/** |
3592 | + * |
3593 | + * Author: Federico Cavalieri |
3594 | + */ |
3595 | +class IsAttributePositionIterator : public NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState> |
3596 | +{ |
3597 | +public: |
3598 | + SERIALIZABLE_CLASS(IsAttributePositionIterator); |
3599 | + |
3600 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAttributePositionIterator, |
3601 | + NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>); |
3602 | + |
3603 | + void serialize( ::zorba::serialization::Archiver& ar) |
3604 | + { |
3605 | + serialize_baseclass(ar, |
3606 | + (NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>*)this); |
3607 | + } |
3608 | + |
3609 | + IsAttributePositionIterator( |
3610 | + static_context* sctx, |
3611 | + const QueryLoc& loc, |
3612 | + std::vector<PlanIter_t>& children) |
3613 | + : |
3614 | + NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>(sctx, loc, children) |
3615 | + {} |
3616 | + |
3617 | + virtual ~IsAttributePositionIterator(); |
3618 | + |
3619 | + void accept(PlanIterVisitor& v) const; |
3620 | + |
3621 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3622 | +}; |
3623 | + |
3624 | + |
3625 | +/** |
3626 | + * |
3627 | + * Author: Federico Cavalieri |
3628 | + */ |
3629 | +class IsCommentPositionIterator : public NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState> |
3630 | +{ |
3631 | +public: |
3632 | + SERIALIZABLE_CLASS(IsCommentPositionIterator); |
3633 | + |
3634 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsCommentPositionIterator, |
3635 | + NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>); |
3636 | + |
3637 | + void serialize( ::zorba::serialization::Archiver& ar) |
3638 | + { |
3639 | + serialize_baseclass(ar, |
3640 | + (NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>*)this); |
3641 | + } |
3642 | + |
3643 | + IsCommentPositionIterator( |
3644 | + static_context* sctx, |
3645 | + const QueryLoc& loc, |
3646 | + std::vector<PlanIter_t>& children) |
3647 | + : |
3648 | + NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>(sctx, loc, children) |
3649 | + {} |
3650 | + |
3651 | + virtual ~IsCommentPositionIterator(); |
3652 | + |
3653 | + void accept(PlanIterVisitor& v) const; |
3654 | + |
3655 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3656 | +}; |
3657 | + |
3658 | + |
3659 | +/** |
3660 | + * |
3661 | + * Author: Federico Cavalieri |
3662 | + */ |
3663 | +class IsDocumentPositionIterator : public NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState> |
3664 | +{ |
3665 | +public: |
3666 | + SERIALIZABLE_CLASS(IsDocumentPositionIterator); |
3667 | + |
3668 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDocumentPositionIterator, |
3669 | + NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>); |
3670 | + |
3671 | + void serialize( ::zorba::serialization::Archiver& ar) |
3672 | + { |
3673 | + serialize_baseclass(ar, |
3674 | + (NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>*)this); |
3675 | + } |
3676 | + |
3677 | + IsDocumentPositionIterator( |
3678 | + static_context* sctx, |
3679 | + const QueryLoc& loc, |
3680 | + std::vector<PlanIter_t>& children) |
3681 | + : |
3682 | + NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>(sctx, loc, children) |
3683 | + {} |
3684 | + |
3685 | + virtual ~IsDocumentPositionIterator(); |
3686 | + |
3687 | + void accept(PlanIterVisitor& v) const; |
3688 | + |
3689 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3690 | +}; |
3691 | + |
3692 | + |
3693 | +/** |
3694 | + * |
3695 | + * Author: Federico Cavalieri |
3696 | + */ |
3697 | +class IsElementPositionIterator : public NaryBaseIterator<IsElementPositionIterator, PlanIteratorState> |
3698 | +{ |
3699 | +public: |
3700 | + SERIALIZABLE_CLASS(IsElementPositionIterator); |
3701 | + |
3702 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsElementPositionIterator, |
3703 | + NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>); |
3704 | + |
3705 | + void serialize( ::zorba::serialization::Archiver& ar) |
3706 | + { |
3707 | + serialize_baseclass(ar, |
3708 | + (NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>*)this); |
3709 | + } |
3710 | + |
3711 | + IsElementPositionIterator( |
3712 | + static_context* sctx, |
3713 | + const QueryLoc& loc, |
3714 | + std::vector<PlanIter_t>& children) |
3715 | + : |
3716 | + NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>(sctx, loc, children) |
3717 | + {} |
3718 | + |
3719 | + virtual ~IsElementPositionIterator(); |
3720 | + |
3721 | + void accept(PlanIterVisitor& v) const; |
3722 | + |
3723 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3724 | +}; |
3725 | + |
3726 | + |
3727 | +/** |
3728 | + * |
3729 | + * Author: Federico Cavalieri |
3730 | + */ |
3731 | +class IsProcessingInstructionPositionIterator : public NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState> |
3732 | +{ |
3733 | +public: |
3734 | + SERIALIZABLE_CLASS(IsProcessingInstructionPositionIterator); |
3735 | + |
3736 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsProcessingInstructionPositionIterator, |
3737 | + NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>); |
3738 | + |
3739 | + void serialize( ::zorba::serialization::Archiver& ar) |
3740 | + { |
3741 | + serialize_baseclass(ar, |
3742 | + (NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>*)this); |
3743 | + } |
3744 | + |
3745 | + IsProcessingInstructionPositionIterator( |
3746 | + static_context* sctx, |
3747 | + const QueryLoc& loc, |
3748 | + std::vector<PlanIter_t>& children) |
3749 | + : |
3750 | + NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>(sctx, loc, children) |
3751 | + {} |
3752 | + |
3753 | + virtual ~IsProcessingInstructionPositionIterator(); |
3754 | + |
3755 | + void accept(PlanIterVisitor& v) const; |
3756 | + |
3757 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3758 | +}; |
3759 | + |
3760 | + |
3761 | +/** |
3762 | + * |
3763 | + * Author: Federico Cavalieri |
3764 | + */ |
3765 | +class IsTextPositionIterator : public NaryBaseIterator<IsTextPositionIterator, PlanIteratorState> |
3766 | +{ |
3767 | +public: |
3768 | + SERIALIZABLE_CLASS(IsTextPositionIterator); |
3769 | + |
3770 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsTextPositionIterator, |
3771 | + NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>); |
3772 | + |
3773 | + void serialize( ::zorba::serialization::Archiver& ar) |
3774 | + { |
3775 | + serialize_baseclass(ar, |
3776 | + (NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>*)this); |
3777 | + } |
3778 | + |
3779 | + IsTextPositionIterator( |
3780 | + static_context* sctx, |
3781 | + const QueryLoc& loc, |
3782 | + std::vector<PlanIter_t>& children) |
3783 | + : |
3784 | + NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>(sctx, loc, children) |
3785 | + {} |
3786 | + |
3787 | + virtual ~IsTextPositionIterator(); |
3788 | + |
3789 | + void accept(PlanIterVisitor& v) const; |
3790 | + |
3791 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3792 | +}; |
3793 | + |
3794 | + |
3795 | +/** |
3796 | + * |
3797 | + * Author: Federico Cavalieri |
3798 | + */ |
3799 | +class IsSiblingPositionIterator : public NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState> |
3800 | +{ |
3801 | +public: |
3802 | + SERIALIZABLE_CLASS(IsSiblingPositionIterator); |
3803 | + |
3804 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsSiblingPositionIterator, |
3805 | + NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>); |
3806 | + |
3807 | + void serialize( ::zorba::serialization::Archiver& ar) |
3808 | + { |
3809 | + serialize_baseclass(ar, |
3810 | + (NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>*)this); |
3811 | + } |
3812 | + |
3813 | + IsSiblingPositionIterator( |
3814 | + static_context* sctx, |
3815 | + const QueryLoc& loc, |
3816 | + std::vector<PlanIter_t>& children) |
3817 | + : |
3818 | + NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>(sctx, loc, children) |
3819 | + {} |
3820 | + |
3821 | + virtual ~IsSiblingPositionIterator(); |
3822 | + |
3823 | + void accept(PlanIterVisitor& v) const; |
3824 | + |
3825 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3826 | +}; |
3827 | + |
3828 | + |
3829 | +/** |
3830 | + * |
3831 | + * Author: Federico Cavalieri |
3832 | + */ |
3833 | +class InSameTreePositionIterator : public NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState> |
3834 | +{ |
3835 | +public: |
3836 | + SERIALIZABLE_CLASS(InSameTreePositionIterator); |
3837 | + |
3838 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(InSameTreePositionIterator, |
3839 | + NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>); |
3840 | + |
3841 | + void serialize( ::zorba::serialization::Archiver& ar) |
3842 | + { |
3843 | + serialize_baseclass(ar, |
3844 | + (NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>*)this); |
3845 | + } |
3846 | + |
3847 | + InSameTreePositionIterator( |
3848 | + static_context* sctx, |
3849 | + const QueryLoc& loc, |
3850 | + std::vector<PlanIter_t>& children) |
3851 | + : |
3852 | + NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>(sctx, loc, children) |
3853 | + {} |
3854 | + |
3855 | + virtual ~InSameTreePositionIterator(); |
3856 | + |
3857 | + void accept(PlanIterVisitor& v) const; |
3858 | + |
3859 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3860 | +}; |
3861 | + |
3862 | + |
3863 | +/** |
3864 | + * |
3865 | + * Author: Federico Cavalieri |
3866 | + */ |
3867 | +class InCollectionPositionIterator : public NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState> |
3868 | +{ |
3869 | +public: |
3870 | + SERIALIZABLE_CLASS(InCollectionPositionIterator); |
3871 | + |
3872 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(InCollectionPositionIterator, |
3873 | + NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>); |
3874 | + |
3875 | + void serialize( ::zorba::serialization::Archiver& ar) |
3876 | + { |
3877 | + serialize_baseclass(ar, |
3878 | + (NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>*)this); |
3879 | + } |
3880 | + |
3881 | + InCollectionPositionIterator( |
3882 | + static_context* sctx, |
3883 | + const QueryLoc& loc, |
3884 | + std::vector<PlanIter_t>& children) |
3885 | + : |
3886 | + NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>(sctx, loc, children) |
3887 | + {} |
3888 | + |
3889 | + virtual ~InCollectionPositionIterator(); |
3890 | + |
3891 | + void accept(PlanIterVisitor& v) const; |
3892 | + |
3893 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3894 | +}; |
3895 | + |
3896 | + |
3897 | +/** |
3898 | + * |
3899 | + * Author: Federico Cavalieri |
3900 | + */ |
3901 | +class InSameCollectionPositionIterator : public NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState> |
3902 | +{ |
3903 | +public: |
3904 | + SERIALIZABLE_CLASS(InSameCollectionPositionIterator); |
3905 | + |
3906 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(InSameCollectionPositionIterator, |
3907 | + NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>); |
3908 | + |
3909 | + void serialize( ::zorba::serialization::Archiver& ar) |
3910 | + { |
3911 | + serialize_baseclass(ar, |
3912 | + (NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>*)this); |
3913 | + } |
3914 | + |
3915 | + InSameCollectionPositionIterator( |
3916 | + static_context* sctx, |
3917 | + const QueryLoc& loc, |
3918 | + std::vector<PlanIter_t>& children) |
3919 | + : |
3920 | + NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>(sctx, loc, children) |
3921 | + {} |
3922 | + |
3923 | + virtual ~InSameCollectionPositionIterator(); |
3924 | + |
3925 | + void accept(PlanIterVisitor& v) const; |
3926 | + |
3927 | + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; |
3928 | +}; |
3929 | + |
3930 | + |
3931 | +} |
3932 | +#endif |
3933 | +/* |
3934 | + * Local variables: |
3935 | + * mode: c++ |
3936 | + * End: |
3937 | + */ |
3938 | |
3939 | === modified file 'src/runtime/spec/mappings.xml' |
3940 | --- src/runtime/spec/mappings.xml 2011-09-30 08:08:13 +0000 |
3941 | +++ src/runtime/spec/mappings.xml 2011-11-02 17:26:24 +0000 |
3942 | @@ -22,7 +22,11 @@ |
3943 | |
3944 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/node-reference" |
3945 | define="ZORBA_NODEREF_FN_NS" |
3946 | - prefix="fn-zorba-ref"/> |
3947 | + prefix="fn-zorba-ref"/> |
3948 | + |
3949 | + <zorba:namespace uri="http://www.zorba-xquery.com/modules/node-position" |
3950 | + define="ZORBA_NODEPOS_FN_NS" |
3951 | + prefix="fn-zorba-pos"/> |
3952 | |
3953 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/schema" |
3954 | define="ZORBA_SCHEMA_FN_NS" |
3955 | |
3956 | === added file 'src/runtime/spec/nodes/node_position.xml' |
3957 | --- src/runtime/spec/nodes/node_position.xml 1970-01-01 00:00:00 +0000 |
3958 | +++ src/runtime/spec/nodes/node_position.xml 2011-11-02 17:26:24 +0000 |
3959 | @@ -0,0 +1,439 @@ |
3960 | +<?xml version="1.0" encoding="UTF-8"?> |
3961 | + |
3962 | +<!-- |
3963 | +///////////////////////////////////////////////////////////////////////////////// |
3964 | +// // |
3965 | +///////////////////////////////////////////////////////////////////////////////// |
3966 | +--> |
3967 | +<zorba:iterators |
3968 | + xmlns:zorba="http://www.zorba-xquery.com" |
3969 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
3970 | + xsi:schemaLocation="http://www.zorba-xquery.com ../runtime.xsd"> |
3971 | + |
3972 | + <!-- |
3973 | +/******************************************************************************* |
3974 | +********************************************************************************/ |
3975 | +--> |
3976 | +<zorba:iterator name="NodePositionIterator"> |
3977 | + |
3978 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
3979 | + |
3980 | + <zorba:function> |
3981 | + <zorba:signature localname="node-position" prefix="fn-zorba-pos"> |
3982 | + <zorba:param>node()</zorba:param> |
3983 | + <zorba:output>xs:anyURI</zorba:output> |
3984 | + </zorba:signature> |
3985 | + </zorba:function> |
3986 | + |
3987 | +</zorba:iterator> |
3988 | + |
3989 | + <!-- |
3990 | +/******************************************************************************* |
3991 | +********************************************************************************/ |
3992 | +--> |
3993 | + <zorba:iterator name="IsAncestorPositionIterator"> |
3994 | + |
3995 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
3996 | + |
3997 | + <zorba:function> |
3998 | + <zorba:signature localname="ancestor-of" prefix="fn-zorba-pos"> |
3999 | + <zorba:param>xs:anyURI</zorba:param> |
4000 | + <zorba:param>xs:anyURI</zorba:param> |
4001 | + <zorba:output>xs:boolean</zorba:output> |
4002 | + </zorba:signature> |
4003 | + </zorba:function> |
4004 | + |
4005 | + </zorba:iterator> |
4006 | + |
4007 | + <!-- |
4008 | +/******************************************************************************* |
4009 | +********************************************************************************/ |
4010 | +--> |
4011 | + <zorba:iterator name="IsFollowingSiblingPositionIterator"> |
4012 | + |
4013 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4014 | + |
4015 | + <zorba:function> |
4016 | + <zorba:signature localname="following-sibling-of" prefix="fn-zorba-pos"> |
4017 | + <zorba:param>xs:anyURI</zorba:param> |
4018 | + <zorba:param>xs:anyURI</zorba:param> |
4019 | + <zorba:output>xs:boolean</zorba:output> |
4020 | + </zorba:signature> |
4021 | + </zorba:function> |
4022 | + |
4023 | + </zorba:iterator> |
4024 | + |
4025 | +<!-- |
4026 | +/******************************************************************************* |
4027 | +********************************************************************************/ |
4028 | +--> |
4029 | + <zorba:iterator name="IsFollowingPositionIterator"> |
4030 | + |
4031 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4032 | + |
4033 | + <zorba:function> |
4034 | + <zorba:signature localname="following-of" prefix="fn-zorba-pos"> |
4035 | + <zorba:param>xs:anyURI</zorba:param> |
4036 | + <zorba:param>xs:anyURI</zorba:param> |
4037 | + <zorba:output>xs:boolean</zorba:output> |
4038 | + </zorba:signature> |
4039 | + </zorba:function> |
4040 | + |
4041 | + </zorba:iterator> |
4042 | + |
4043 | + |
4044 | + <!-- |
4045 | +/******************************************************************************* |
4046 | +********************************************************************************/ |
4047 | +--> |
4048 | + <zorba:iterator name="IsInSubtreeOfPositionIterator"> |
4049 | + |
4050 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4051 | + |
4052 | + <zorba:function> |
4053 | + <zorba:signature localname="in-subtree-of" prefix="fn-zorba-pos"> |
4054 | + <zorba:param>xs:anyURI</zorba:param> |
4055 | + <zorba:param>xs:anyURI</zorba:param> |
4056 | + <zorba:output>xs:boolean</zorba:output> |
4057 | + </zorba:signature> |
4058 | + </zorba:function> |
4059 | + |
4060 | + </zorba:iterator> |
4061 | + |
4062 | + |
4063 | + <!-- |
4064 | +/******************************************************************************* |
4065 | +********************************************************************************/ |
4066 | +--> |
4067 | + <zorba:iterator name="IsDescendantPositionIterator"> |
4068 | + |
4069 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4070 | + |
4071 | + <zorba:function> |
4072 | + <zorba:signature localname="descendant-of" prefix="fn-zorba-pos"> |
4073 | + <zorba:param>xs:anyURI</zorba:param> |
4074 | + <zorba:param>xs:anyURI</zorba:param> |
4075 | + <zorba:output>xs:boolean</zorba:output> |
4076 | + </zorba:signature> |
4077 | + </zorba:function> |
4078 | + |
4079 | + </zorba:iterator> |
4080 | + |
4081 | + <!-- |
4082 | +/******************************************************************************* |
4083 | +********************************************************************************/ |
4084 | +--> |
4085 | + <zorba:iterator name="IsPrecedingSiblingPositionIterator"> |
4086 | + |
4087 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4088 | + |
4089 | + <zorba:function> |
4090 | + <zorba:signature localname="preceding-sibling-of" prefix="fn-zorba-pos"> |
4091 | + <zorba:param>xs:anyURI</zorba:param> |
4092 | + <zorba:param>xs:anyURI</zorba:param> |
4093 | + <zorba:output>xs:boolean</zorba:output> |
4094 | + </zorba:signature> |
4095 | + </zorba:function> |
4096 | + |
4097 | + </zorba:iterator> |
4098 | + |
4099 | + <!-- |
4100 | +/******************************************************************************* |
4101 | +********************************************************************************/ |
4102 | +--> |
4103 | + <zorba:iterator name="IsPrecedingPositionIterator"> |
4104 | + |
4105 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4106 | + |
4107 | + <zorba:function> |
4108 | + <zorba:signature localname="preceding-of" prefix="fn-zorba-pos"> |
4109 | + <zorba:param>xs:anyURI</zorba:param> |
4110 | + <zorba:param>xs:anyURI</zorba:param> |
4111 | + <zorba:output>xs:boolean</zorba:output> |
4112 | + </zorba:signature> |
4113 | + </zorba:function> |
4114 | + |
4115 | + </zorba:iterator> |
4116 | + |
4117 | + <!-- |
4118 | +/******************************************************************************* |
4119 | +********************************************************************************/ |
4120 | +--> |
4121 | + <zorba:iterator name="IsChildPositionIterator"> |
4122 | + |
4123 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4124 | + |
4125 | + <zorba:function> |
4126 | + <zorba:signature localname="child-of" prefix="fn-zorba-pos"> |
4127 | + <zorba:param>xs:anyURI</zorba:param> |
4128 | + <zorba:param>xs:anyURI</zorba:param> |
4129 | + <zorba:output>xs:boolean</zorba:output> |
4130 | + </zorba:signature> |
4131 | + </zorba:function> |
4132 | + |
4133 | + </zorba:iterator> |
4134 | + |
4135 | + <!-- |
4136 | +/******************************************************************************* |
4137 | +********************************************************************************/ |
4138 | +--> |
4139 | + <zorba:iterator name="IsAttributeOfPositionIterator"> |
4140 | + |
4141 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4142 | + |
4143 | + <zorba:function> |
4144 | + <zorba:signature localname="attribute-of" prefix="fn-zorba-pos"> |
4145 | + <zorba:param>xs:anyURI</zorba:param> |
4146 | + <zorba:param>xs:anyURI</zorba:param> |
4147 | + <zorba:output>xs:boolean</zorba:output> |
4148 | + </zorba:signature> |
4149 | + </zorba:function> |
4150 | + |
4151 | + </zorba:iterator> |
4152 | + |
4153 | + |
4154 | + <!-- |
4155 | +/******************************************************************************* |
4156 | +********************************************************************************/ |
4157 | +--> |
4158 | + <zorba:iterator name="IsParentPositionIterator"> |
4159 | + |
4160 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4161 | + |
4162 | + <zorba:function> |
4163 | + <zorba:signature localname="parent-of" prefix="fn-zorba-pos"> |
4164 | + <zorba:param>xs:anyURI</zorba:param> |
4165 | + <zorba:param>xs:anyURI</zorba:param> |
4166 | + <zorba:output>xs:boolean</zorba:output> |
4167 | + </zorba:signature> |
4168 | + </zorba:function> |
4169 | + |
4170 | + </zorba:iterator> |
4171 | + |
4172 | + <!-- |
4173 | +/******************************************************************************* |
4174 | +********************************************************************************/ |
4175 | +--> |
4176 | + <zorba:iterator name="IsPrecedingInDocumentOrderPositionIterator"> |
4177 | + |
4178 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4179 | + |
4180 | + <zorba:function> |
4181 | + <zorba:signature localname="preceding-in-document-order-of" prefix="fn-zorba-pos"> |
4182 | + <zorba:param>xs:anyURI</zorba:param> |
4183 | + <zorba:param>xs:anyURI</zorba:param> |
4184 | + <zorba:output>xs:boolean</zorba:output> |
4185 | + </zorba:signature> |
4186 | + </zorba:function> |
4187 | + |
4188 | + </zorba:iterator> |
4189 | + |
4190 | + <!-- |
4191 | +/******************************************************************************* |
4192 | +********************************************************************************/ |
4193 | +--> |
4194 | + <zorba:iterator name="IsFollowingInDocumentOrderPositionIterator"> |
4195 | + |
4196 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4197 | + |
4198 | + <zorba:function> |
4199 | + <zorba:signature localname="following-in-document-order-of" prefix="fn-zorba-pos"> |
4200 | + <zorba:param>xs:anyURI</zorba:param> |
4201 | + <zorba:param>xs:anyURI</zorba:param> |
4202 | + <zorba:output>xs:boolean</zorba:output> |
4203 | + </zorba:signature> |
4204 | + </zorba:function> |
4205 | + |
4206 | + </zorba:iterator> |
4207 | + |
4208 | + <!-- |
4209 | +/******************************************************************************* |
4210 | +********************************************************************************/ |
4211 | +--> |
4212 | + <zorba:iterator name="LevelPositionIterator"> |
4213 | + |
4214 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4215 | + |
4216 | + <zorba:function> |
4217 | + <zorba:signature localname="level" prefix="fn-zorba-pos"> |
4218 | + <zorba:param>xs:anyURI</zorba:param> |
4219 | + <zorba:output>xs:integer</zorba:output> |
4220 | + </zorba:signature> |
4221 | + </zorba:function> |
4222 | + |
4223 | + </zorba:iterator> |
4224 | + |
4225 | + <!-- |
4226 | +/******************************************************************************* |
4227 | +********************************************************************************/ |
4228 | +--> |
4229 | + <zorba:iterator name="IsAttributePositionIterator"> |
4230 | + |
4231 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4232 | + |
4233 | + <zorba:function> |
4234 | + <zorba:signature localname="is-attribute" prefix="fn-zorba-pos"> |
4235 | + <zorba:param>xs:anyURI</zorba:param> |
4236 | + <zorba:output>xs:boolean</zorba:output> |
4237 | + </zorba:signature> |
4238 | + </zorba:function> |
4239 | + |
4240 | + </zorba:iterator> |
4241 | + |
4242 | + <!-- |
4243 | +/******************************************************************************* |
4244 | +********************************************************************************/ |
4245 | +--> |
4246 | + <zorba:iterator name="IsCommentPositionIterator"> |
4247 | + |
4248 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4249 | + |
4250 | + <zorba:function> |
4251 | + <zorba:signature localname="is-comment" prefix="fn-zorba-pos"> |
4252 | + <zorba:param>xs:anyURI</zorba:param> |
4253 | + <zorba:output>xs:boolean</zorba:output> |
4254 | + </zorba:signature> |
4255 | + </zorba:function> |
4256 | + |
4257 | + </zorba:iterator> |
4258 | + |
4259 | + <!-- |
4260 | +/******************************************************************************* |
4261 | +********************************************************************************/ |
4262 | +--> |
4263 | + <zorba:iterator name="IsDocumentPositionIterator"> |
4264 | + |
4265 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4266 | + |
4267 | + <zorba:function> |
4268 | + <zorba:signature localname="is-document" prefix="fn-zorba-pos"> |
4269 | + <zorba:param>xs:anyURI</zorba:param> |
4270 | + <zorba:output>xs:boolean</zorba:output> |
4271 | + </zorba:signature> |
4272 | + </zorba:function> |
4273 | + |
4274 | + </zorba:iterator> |
4275 | + |
4276 | + <!-- |
4277 | +/******************************************************************************* |
4278 | +********************************************************************************/ |
4279 | +--> |
4280 | + <zorba:iterator name="IsElementPositionIterator"> |
4281 | + |
4282 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4283 | + |
4284 | + <zorba:function> |
4285 | + <zorba:signature localname="is-element" prefix="fn-zorba-pos"> |
4286 | + <zorba:param>xs:anyURI</zorba:param> |
4287 | + <zorba:output>xs:boolean</zorba:output> |
4288 | + </zorba:signature> |
4289 | + </zorba:function> |
4290 | + |
4291 | + </zorba:iterator> |
4292 | + |
4293 | + <!-- |
4294 | +/******************************************************************************* |
4295 | +********************************************************************************/ |
4296 | +--> |
4297 | + <zorba:iterator name="IsProcessingInstructionPositionIterator"> |
4298 | + |
4299 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4300 | + |
4301 | + <zorba:function> |
4302 | + <zorba:signature localname="is-processing-instruction" prefix="fn-zorba-pos"> |
4303 | + <zorba:param>xs:anyURI</zorba:param> |
4304 | + <zorba:output>xs:boolean</zorba:output> |
4305 | + </zorba:signature> |
4306 | + </zorba:function> |
4307 | + |
4308 | + </zorba:iterator> |
4309 | + |
4310 | + <!-- |
4311 | +/******************************************************************************* |
4312 | +********************************************************************************/ |
4313 | +--> |
4314 | + <zorba:iterator name="IsTextPositionIterator"> |
4315 | + |
4316 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4317 | + |
4318 | + <zorba:function> |
4319 | + <zorba:signature localname="is-text" prefix="fn-zorba-pos"> |
4320 | + <zorba:param>xs:anyURI</zorba:param> |
4321 | + <zorba:output>xs:boolean</zorba:output> |
4322 | + </zorba:signature> |
4323 | + </zorba:function> |
4324 | + |
4325 | + </zorba:iterator> |
4326 | + |
4327 | + <!-- |
4328 | +/******************************************************************************* |
4329 | +********************************************************************************/ |
4330 | +--> |
4331 | + <zorba:iterator name="IsSiblingPositionIterator"> |
4332 | + |
4333 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4334 | + |
4335 | + <zorba:function> |
4336 | + <zorba:signature localname="sibling-of" prefix="fn-zorba-pos"> |
4337 | + <zorba:param>xs:anyURI</zorba:param> |
4338 | + <zorba:param>xs:anyURI</zorba:param> |
4339 | + <zorba:output>xs:boolean</zorba:output> |
4340 | + </zorba:signature> |
4341 | + </zorba:function> |
4342 | + |
4343 | + </zorba:iterator> |
4344 | + |
4345 | + <!-- |
4346 | +/******************************************************************************* |
4347 | +********************************************************************************/ |
4348 | +--> |
4349 | + <zorba:iterator name="InSameTreePositionIterator"> |
4350 | + |
4351 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4352 | + |
4353 | + <zorba:function> |
4354 | + <zorba:signature localname="in-same-tree-of" prefix="fn-zorba-pos"> |
4355 | + <zorba:param>xs:anyURI</zorba:param> |
4356 | + <zorba:param>xs:anyURI</zorba:param> |
4357 | + <zorba:output>xs:boolean</zorba:output> |
4358 | + </zorba:signature> |
4359 | + </zorba:function> |
4360 | + |
4361 | + </zorba:iterator> |
4362 | + |
4363 | + <!-- |
4364 | +/******************************************************************************* |
4365 | +********************************************************************************/ |
4366 | +--> |
4367 | + <zorba:iterator name="InCollectionPositionIterator"> |
4368 | + |
4369 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4370 | + |
4371 | + <zorba:function> |
4372 | + <zorba:signature localname="in-collection" prefix="fn-zorba-pos"> |
4373 | + <zorba:param>xs:anyURI</zorba:param> |
4374 | + <zorba:output>xs:boolean</zorba:output> |
4375 | + </zorba:signature> |
4376 | + </zorba:function> |
4377 | + |
4378 | + </zorba:iterator> |
4379 | + |
4380 | + <!-- |
4381 | +/******************************************************************************* |
4382 | +********************************************************************************/ |
4383 | +--> |
4384 | + <zorba:iterator name="InSameCollectionPositionIterator"> |
4385 | + |
4386 | + <zorba:description author="Federico Cavalieri"></zorba:description> |
4387 | + |
4388 | + <zorba:function> |
4389 | + <zorba:signature localname="in-same-collection-of" prefix="fn-zorba-pos"> |
4390 | + <zorba:param>xs:anyURI</zorba:param> |
4391 | + <zorba:param>xs:anyURI</zorba:param> |
4392 | + <zorba:output>xs:boolean</zorba:output> |
4393 | + </zorba:signature> |
4394 | + </zorba:function> |
4395 | + |
4396 | + </zorba:iterator> |
4397 | + |
4398 | +</zorba:iterators> |
4399 | |
4400 | === modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h' |
4401 | --- src/runtime/visitors/pregenerated/planiter_visitor.h 2011-10-19 15:28:51 +0000 |
4402 | +++ src/runtime/visitors/pregenerated/planiter_visitor.h 2011-11-02 17:26:24 +0000 |
4403 | @@ -303,6 +303,54 @@ |
4404 | |
4405 | class FrexpIterator; |
4406 | |
4407 | + class NodePositionIterator; |
4408 | + |
4409 | + class IsAncestorPositionIterator; |
4410 | + |
4411 | + class IsFollowingSiblingPositionIterator; |
4412 | + |
4413 | + class IsFollowingPositionIterator; |
4414 | + |
4415 | + class IsInSubtreeOfPositionIterator; |
4416 | + |
4417 | + class IsDescendantPositionIterator; |
4418 | + |
4419 | + class IsPrecedingSiblingPositionIterator; |
4420 | + |
4421 | + class IsPrecedingPositionIterator; |
4422 | + |
4423 | + class IsChildPositionIterator; |
4424 | + |
4425 | + class IsAttributeOfPositionIterator; |
4426 | + |
4427 | + class IsParentPositionIterator; |
4428 | + |
4429 | + class IsPrecedingInDocumentOrderPositionIterator; |
4430 | + |
4431 | + class IsFollowingInDocumentOrderPositionIterator; |
4432 | + |
4433 | + class LevelPositionIterator; |
4434 | + |
4435 | + class IsAttributePositionIterator; |
4436 | + |
4437 | + class IsCommentPositionIterator; |
4438 | + |
4439 | + class IsDocumentPositionIterator; |
4440 | + |
4441 | + class IsElementPositionIterator; |
4442 | + |
4443 | + class IsProcessingInstructionPositionIterator; |
4444 | + |
4445 | + class IsTextPositionIterator; |
4446 | + |
4447 | + class IsSiblingPositionIterator; |
4448 | + |
4449 | + class InSameTreePositionIterator; |
4450 | + |
4451 | + class InCollectionPositionIterator; |
4452 | + |
4453 | + class InSameCollectionPositionIterator; |
4454 | + |
4455 | class NodeReferenceIterator; |
4456 | |
4457 | class NodeByReferenceIterator; |
4458 | @@ -955,6 +1003,78 @@ |
4459 | virtual void beginVisit ( const FrexpIterator& ) = 0; |
4460 | virtual void endVisit ( const FrexpIterator& ) = 0; |
4461 | |
4462 | + virtual void beginVisit ( const NodePositionIterator& ) = 0; |
4463 | + virtual void endVisit ( const NodePositionIterator& ) = 0; |
4464 | + |
4465 | + virtual void beginVisit ( const IsAncestorPositionIterator& ) = 0; |
4466 | + virtual void endVisit ( const IsAncestorPositionIterator& ) = 0; |
4467 | + |
4468 | + virtual void beginVisit ( const IsFollowingSiblingPositionIterator& ) = 0; |
4469 | + virtual void endVisit ( const IsFollowingSiblingPositionIterator& ) = 0; |
4470 | + |
4471 | + virtual void beginVisit ( const IsFollowingPositionIterator& ) = 0; |
4472 | + virtual void endVisit ( const IsFollowingPositionIterator& ) = 0; |
4473 | + |
4474 | + virtual void beginVisit ( const IsInSubtreeOfPositionIterator& ) = 0; |
4475 | + virtual void endVisit ( const IsInSubtreeOfPositionIterator& ) = 0; |
4476 | + |
4477 | + virtual void beginVisit ( const IsDescendantPositionIterator& ) = 0; |
4478 | + virtual void endVisit ( const IsDescendantPositionIterator& ) = 0; |
4479 | + |
4480 | + virtual void beginVisit ( const IsPrecedingSiblingPositionIterator& ) = 0; |
4481 | + virtual void endVisit ( const IsPrecedingSiblingPositionIterator& ) = 0; |
4482 | + |
4483 | + virtual void beginVisit ( const IsPrecedingPositionIterator& ) = 0; |
4484 | + virtual void endVisit ( const IsPrecedingPositionIterator& ) = 0; |
4485 | + |
4486 | + virtual void beginVisit ( const IsChildPositionIterator& ) = 0; |
4487 | + virtual void endVisit ( const IsChildPositionIterator& ) = 0; |
4488 | + |
4489 | + virtual void beginVisit ( const IsAttributeOfPositionIterator& ) = 0; |
4490 | + virtual void endVisit ( const IsAttributeOfPositionIterator& ) = 0; |
4491 | + |
4492 | + virtual void beginVisit ( const IsParentPositionIterator& ) = 0; |
4493 | + virtual void endVisit ( const IsParentPositionIterator& ) = 0; |
4494 | + |
4495 | + virtual void beginVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) = 0; |
4496 | + virtual void endVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) = 0; |
4497 | + |
4498 | + virtual void beginVisit ( const IsFollowingInDocumentOrderPositionIterator& ) = 0; |
4499 | + virtual void endVisit ( const IsFollowingInDocumentOrderPositionIterator& ) = 0; |
4500 | + |
4501 | + virtual void beginVisit ( const LevelPositionIterator& ) = 0; |
4502 | + virtual void endVisit ( const LevelPositionIterator& ) = 0; |
4503 | + |
4504 | + virtual void beginVisit ( const IsAttributePositionIterator& ) = 0; |
4505 | + virtual void endVisit ( const IsAttributePositionIterator& ) = 0; |
4506 | + |
4507 | + virtual void beginVisit ( const IsCommentPositionIterator& ) = 0; |
4508 | + virtual void endVisit ( const IsCommentPositionIterator& ) = 0; |
4509 | + |
4510 | + virtual void beginVisit ( const IsDocumentPositionIterator& ) = 0; |
4511 | + virtual void endVisit ( const IsDocumentPositionIterator& ) = 0; |
4512 | + |
4513 | + virtual void beginVisit ( const IsElementPositionIterator& ) = 0; |
4514 | + virtual void endVisit ( const IsElementPositionIterator& ) = 0; |
4515 | + |
4516 | + virtual void beginVisit ( const IsProcessingInstructionPositionIterator& ) = 0; |
4517 | + virtual void endVisit ( const IsProcessingInstructionPositionIterator& ) = 0; |
4518 | + |
4519 | + virtual void beginVisit ( const IsTextPositionIterator& ) = 0; |
4520 | + virtual void endVisit ( const IsTextPositionIterator& ) = 0; |
4521 | + |
4522 | + virtual void beginVisit ( const IsSiblingPositionIterator& ) = 0; |
4523 | + virtual void endVisit ( const IsSiblingPositionIterator& ) = 0; |
4524 | + |
4525 | + virtual void beginVisit ( const InSameTreePositionIterator& ) = 0; |
4526 | + virtual void endVisit ( const InSameTreePositionIterator& ) = 0; |
4527 | + |
4528 | + virtual void beginVisit ( const InCollectionPositionIterator& ) = 0; |
4529 | + virtual void endVisit ( const InCollectionPositionIterator& ) = 0; |
4530 | + |
4531 | + virtual void beginVisit ( const InSameCollectionPositionIterator& ) = 0; |
4532 | + virtual void endVisit ( const InSameCollectionPositionIterator& ) = 0; |
4533 | + |
4534 | virtual void beginVisit ( const NodeReferenceIterator& ) = 0; |
4535 | virtual void endVisit ( const NodeReferenceIterator& ) = 0; |
4536 | |
4537 | |
4538 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp' |
4539 | --- src/runtime/visitors/pregenerated/printer_visitor.cpp 2011-10-19 15:28:51 +0000 |
4540 | +++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2011-11-02 17:26:24 +0000 |
4541 | @@ -51,6 +51,7 @@ |
4542 | #include "runtime/indexing/ic_ddl.h" |
4543 | #include "runtime/introspection/sctx.h" |
4544 | #include "runtime/maths/maths.h" |
4545 | +#include "runtime/nodes/node_position.h" |
4546 | #include "runtime/nodes/nodes.h" |
4547 | #include "runtime/numerics/numerics.h" |
4548 | #include "runtime/parsing_and_serializing/parse_fragment.h" |
4549 | @@ -2013,6 +2014,342 @@ |
4550 | // </FrexpIterator> |
4551 | |
4552 | |
4553 | +// <NodePositionIterator> |
4554 | +void PrinterVisitor::beginVisit ( const NodePositionIterator& a) { |
4555 | + thePrinter.startBeginVisit("NodePositionIterator", ++theId); |
4556 | + printCommons( &a, theId ); |
4557 | + thePrinter.endBeginVisit( theId ); |
4558 | +} |
4559 | + |
4560 | +void PrinterVisitor::endVisit ( const NodePositionIterator& ) { |
4561 | + thePrinter.startEndVisit(); |
4562 | + thePrinter.endEndVisit(); |
4563 | +} |
4564 | +// </NodePositionIterator> |
4565 | + |
4566 | + |
4567 | +// <IsAncestorPositionIterator> |
4568 | +void PrinterVisitor::beginVisit ( const IsAncestorPositionIterator& a) { |
4569 | + thePrinter.startBeginVisit("IsAncestorPositionIterator", ++theId); |
4570 | + printCommons( &a, theId ); |
4571 | + thePrinter.endBeginVisit( theId ); |
4572 | +} |
4573 | + |
4574 | +void PrinterVisitor::endVisit ( const IsAncestorPositionIterator& ) { |
4575 | + thePrinter.startEndVisit(); |
4576 | + thePrinter.endEndVisit(); |
4577 | +} |
4578 | +// </IsAncestorPositionIterator> |
4579 | + |
4580 | + |
4581 | +// <IsFollowingSiblingPositionIterator> |
4582 | +void PrinterVisitor::beginVisit ( const IsFollowingSiblingPositionIterator& a) { |
4583 | + thePrinter.startBeginVisit("IsFollowingSiblingPositionIterator", ++theId); |
4584 | + printCommons( &a, theId ); |
4585 | + thePrinter.endBeginVisit( theId ); |
4586 | +} |
4587 | + |
4588 | +void PrinterVisitor::endVisit ( const IsFollowingSiblingPositionIterator& ) { |
4589 | + thePrinter.startEndVisit(); |
4590 | + thePrinter.endEndVisit(); |
4591 | +} |
4592 | +// </IsFollowingSiblingPositionIterator> |
4593 | + |
4594 | + |
4595 | +// <IsFollowingPositionIterator> |
4596 | +void PrinterVisitor::beginVisit ( const IsFollowingPositionIterator& a) { |
4597 | + thePrinter.startBeginVisit("IsFollowingPositionIterator", ++theId); |
4598 | + printCommons( &a, theId ); |
4599 | + thePrinter.endBeginVisit( theId ); |
4600 | +} |
4601 | + |
4602 | +void PrinterVisitor::endVisit ( const IsFollowingPositionIterator& ) { |
4603 | + thePrinter.startEndVisit(); |
4604 | + thePrinter.endEndVisit(); |
4605 | +} |
4606 | +// </IsFollowingPositionIterator> |
4607 | + |
4608 | + |
4609 | +// <IsInSubtreeOfPositionIterator> |
4610 | +void PrinterVisitor::beginVisit ( const IsInSubtreeOfPositionIterator& a) { |
4611 | + thePrinter.startBeginVisit("IsInSubtreeOfPositionIterator", ++theId); |
4612 | + printCommons( &a, theId ); |
4613 | + thePrinter.endBeginVisit( theId ); |
4614 | +} |
4615 | + |
4616 | +void PrinterVisitor::endVisit ( const IsInSubtreeOfPositionIterator& ) { |
4617 | + thePrinter.startEndVisit(); |
4618 | + thePrinter.endEndVisit(); |
4619 | +} |
4620 | +// </IsInSubtreeOfPositionIterator> |
4621 | + |
4622 | + |
4623 | +// <IsDescendantPositionIterator> |
4624 | +void PrinterVisitor::beginVisit ( const IsDescendantPositionIterator& a) { |
4625 | + thePrinter.startBeginVisit("IsDescendantPositionIterator", ++theId); |
4626 | + printCommons( &a, theId ); |
4627 | + thePrinter.endBeginVisit( theId ); |
4628 | +} |
4629 | + |
4630 | +void PrinterVisitor::endVisit ( const IsDescendantPositionIterator& ) { |
4631 | + thePrinter.startEndVisit(); |
4632 | + thePrinter.endEndVisit(); |
4633 | +} |
4634 | +// </IsDescendantPositionIterator> |
4635 | + |
4636 | + |
4637 | +// <IsPrecedingSiblingPositionIterator> |
4638 | +void PrinterVisitor::beginVisit ( const IsPrecedingSiblingPositionIterator& a) { |
4639 | + thePrinter.startBeginVisit("IsPrecedingSiblingPositionIterator", ++theId); |
4640 | + printCommons( &a, theId ); |
4641 | + thePrinter.endBeginVisit( theId ); |
4642 | +} |
4643 | + |
4644 | +void PrinterVisitor::endVisit ( const IsPrecedingSiblingPositionIterator& ) { |
4645 | + thePrinter.startEndVisit(); |
4646 | + thePrinter.endEndVisit(); |
4647 | +} |
4648 | +// </IsPrecedingSiblingPositionIterator> |
4649 | + |
4650 | + |
4651 | +// <IsPrecedingPositionIterator> |
4652 | +void PrinterVisitor::beginVisit ( const IsPrecedingPositionIterator& a) { |
4653 | + thePrinter.startBeginVisit("IsPrecedingPositionIterator", ++theId); |
4654 | + printCommons( &a, theId ); |
4655 | + thePrinter.endBeginVisit( theId ); |
4656 | +} |
4657 | + |
4658 | +void PrinterVisitor::endVisit ( const IsPrecedingPositionIterator& ) { |
4659 | + thePrinter.startEndVisit(); |
4660 | + thePrinter.endEndVisit(); |
4661 | +} |
4662 | +// </IsPrecedingPositionIterator> |
4663 | + |
4664 | + |
4665 | +// <IsChildPositionIterator> |
4666 | +void PrinterVisitor::beginVisit ( const IsChildPositionIterator& a) { |
4667 | + thePrinter.startBeginVisit("IsChildPositionIterator", ++theId); |
4668 | + printCommons( &a, theId ); |
4669 | + thePrinter.endBeginVisit( theId ); |
4670 | +} |
4671 | + |
4672 | +void PrinterVisitor::endVisit ( const IsChildPositionIterator& ) { |
4673 | + thePrinter.startEndVisit(); |
4674 | + thePrinter.endEndVisit(); |
4675 | +} |
4676 | +// </IsChildPositionIterator> |
4677 | + |
4678 | + |
4679 | +// <IsAttributeOfPositionIterator> |
4680 | +void PrinterVisitor::beginVisit ( const IsAttributeOfPositionIterator& a) { |
4681 | + thePrinter.startBeginVisit("IsAttributeOfPositionIterator", ++theId); |
4682 | + printCommons( &a, theId ); |
4683 | + thePrinter.endBeginVisit( theId ); |
4684 | +} |
4685 | + |
4686 | +void PrinterVisitor::endVisit ( const IsAttributeOfPositionIterator& ) { |
4687 | + thePrinter.startEndVisit(); |
4688 | + thePrinter.endEndVisit(); |
4689 | +} |
4690 | +// </IsAttributeOfPositionIterator> |
4691 | + |
4692 | + |
4693 | +// <IsParentPositionIterator> |
4694 | +void PrinterVisitor::beginVisit ( const IsParentPositionIterator& a) { |
4695 | + thePrinter.startBeginVisit("IsParentPositionIterator", ++theId); |
4696 | + printCommons( &a, theId ); |
4697 | + thePrinter.endBeginVisit( theId ); |
4698 | +} |
4699 | + |
4700 | +void PrinterVisitor::endVisit ( const IsParentPositionIterator& ) { |
4701 | + thePrinter.startEndVisit(); |
4702 | + thePrinter.endEndVisit(); |
4703 | +} |
4704 | +// </IsParentPositionIterator> |
4705 | + |
4706 | + |
4707 | +// <IsPrecedingInDocumentOrderPositionIterator> |
4708 | +void PrinterVisitor::beginVisit ( const IsPrecedingInDocumentOrderPositionIterator& a) { |
4709 | + thePrinter.startBeginVisit("IsPrecedingInDocumentOrderPositionIterator", ++theId); |
4710 | + printCommons( &a, theId ); |
4711 | + thePrinter.endBeginVisit( theId ); |
4712 | +} |
4713 | + |
4714 | +void PrinterVisitor::endVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) { |
4715 | + thePrinter.startEndVisit(); |
4716 | + thePrinter.endEndVisit(); |
4717 | +} |
4718 | +// </IsPrecedingInDocumentOrderPositionIterator> |
4719 | + |
4720 | + |
4721 | +// <IsFollowingInDocumentOrderPositionIterator> |
4722 | +void PrinterVisitor::beginVisit ( const IsFollowingInDocumentOrderPositionIterator& a) { |
4723 | + thePrinter.startBeginVisit("IsFollowingInDocumentOrderPositionIterator", ++theId); |
4724 | + printCommons( &a, theId ); |
4725 | + thePrinter.endBeginVisit( theId ); |
4726 | +} |
4727 | + |
4728 | +void PrinterVisitor::endVisit ( const IsFollowingInDocumentOrderPositionIterator& ) { |
4729 | + thePrinter.startEndVisit(); |
4730 | + thePrinter.endEndVisit(); |
4731 | +} |
4732 | +// </IsFollowingInDocumentOrderPositionIterator> |
4733 | + |
4734 | + |
4735 | +// <LevelPositionIterator> |
4736 | +void PrinterVisitor::beginVisit ( const LevelPositionIterator& a) { |
4737 | + thePrinter.startBeginVisit("LevelPositionIterator", ++theId); |
4738 | + printCommons( &a, theId ); |
4739 | + thePrinter.endBeginVisit( theId ); |
4740 | +} |
4741 | + |
4742 | +void PrinterVisitor::endVisit ( const LevelPositionIterator& ) { |
4743 | + thePrinter.startEndVisit(); |
4744 | + thePrinter.endEndVisit(); |
4745 | +} |
4746 | +// </LevelPositionIterator> |
4747 | + |
4748 | + |
4749 | +// <IsAttributePositionIterator> |
4750 | +void PrinterVisitor::beginVisit ( const IsAttributePositionIterator& a) { |
4751 | + thePrinter.startBeginVisit("IsAttributePositionIterator", ++theId); |
4752 | + printCommons( &a, theId ); |
4753 | + thePrinter.endBeginVisit( theId ); |
4754 | +} |
4755 | + |
4756 | +void PrinterVisitor::endVisit ( const IsAttributePositionIterator& ) { |
4757 | + thePrinter.startEndVisit(); |
4758 | + thePrinter.endEndVisit(); |
4759 | +} |
4760 | +// </IsAttributePositionIterator> |
4761 | + |
4762 | + |
4763 | +// <IsCommentPositionIterator> |
4764 | +void PrinterVisitor::beginVisit ( const IsCommentPositionIterator& a) { |
4765 | + thePrinter.startBeginVisit("IsCommentPositionIterator", ++theId); |
4766 | + printCommons( &a, theId ); |
4767 | + thePrinter.endBeginVisit( theId ); |
4768 | +} |
4769 | + |
4770 | +void PrinterVisitor::endVisit ( const IsCommentPositionIterator& ) { |
4771 | + thePrinter.startEndVisit(); |
4772 | + thePrinter.endEndVisit(); |
4773 | +} |
4774 | +// </IsCommentPositionIterator> |
4775 | + |
4776 | + |
4777 | +// <IsDocumentPositionIterator> |
4778 | +void PrinterVisitor::beginVisit ( const IsDocumentPositionIterator& a) { |
4779 | + thePrinter.startBeginVisit("IsDocumentPositionIterator", ++theId); |
4780 | + printCommons( &a, theId ); |
4781 | + thePrinter.endBeginVisit( theId ); |
4782 | +} |
4783 | + |
4784 | +void PrinterVisitor::endVisit ( const IsDocumentPositionIterator& ) { |
4785 | + thePrinter.startEndVisit(); |
4786 | + thePrinter.endEndVisit(); |
4787 | +} |
4788 | +// </IsDocumentPositionIterator> |
4789 | + |
4790 | + |
4791 | +// <IsElementPositionIterator> |
4792 | +void PrinterVisitor::beginVisit ( const IsElementPositionIterator& a) { |
4793 | + thePrinter.startBeginVisit("IsElementPositionIterator", ++theId); |
4794 | + printCommons( &a, theId ); |
4795 | + thePrinter.endBeginVisit( theId ); |
4796 | +} |
4797 | + |
4798 | +void PrinterVisitor::endVisit ( const IsElementPositionIterator& ) { |
4799 | + thePrinter.startEndVisit(); |
4800 | + thePrinter.endEndVisit(); |
4801 | +} |
4802 | +// </IsElementPositionIterator> |
4803 | + |
4804 | + |
4805 | +// <IsProcessingInstructionPositionIterator> |
4806 | +void PrinterVisitor::beginVisit ( const IsProcessingInstructionPositionIterator& a) { |
4807 | + thePrinter.startBeginVisit("IsProcessingInstructionPositionIterator", ++theId); |
4808 | + printCommons( &a, theId ); |
4809 | + thePrinter.endBeginVisit( theId ); |
4810 | +} |
4811 | + |
4812 | +void PrinterVisitor::endVisit ( const IsProcessingInstructionPositionIterator& ) { |
4813 | + thePrinter.startEndVisit(); |
4814 | + thePrinter.endEndVisit(); |
4815 | +} |
4816 | +// </IsProcessingInstructionPositionIterator> |
4817 | + |
4818 | + |
4819 | +// <IsTextPositionIterator> |
4820 | +void PrinterVisitor::beginVisit ( const IsTextPositionIterator& a) { |
4821 | + thePrinter.startBeginVisit("IsTextPositionIterator", ++theId); |
4822 | + printCommons( &a, theId ); |
4823 | + thePrinter.endBeginVisit( theId ); |
4824 | +} |
4825 | + |
4826 | +void PrinterVisitor::endVisit ( const IsTextPositionIterator& ) { |
4827 | + thePrinter.startEndVisit(); |
4828 | + thePrinter.endEndVisit(); |
4829 | +} |
4830 | +// </IsTextPositionIterator> |
4831 | + |
4832 | + |
4833 | +// <IsSiblingPositionIterator> |
4834 | +void PrinterVisitor::beginVisit ( const IsSiblingPositionIterator& a) { |
4835 | + thePrinter.startBeginVisit("IsSiblingPositionIterator", ++theId); |
4836 | + printCommons( &a, theId ); |
4837 | + thePrinter.endBeginVisit( theId ); |
4838 | +} |
4839 | + |
4840 | +void PrinterVisitor::endVisit ( const IsSiblingPositionIterator& ) { |
4841 | + thePrinter.startEndVisit(); |
4842 | + thePrinter.endEndVisit(); |
4843 | +} |
4844 | +// </IsSiblingPositionIterator> |
4845 | + |
4846 | + |
4847 | +// <InSameTreePositionIterator> |
4848 | +void PrinterVisitor::beginVisit ( const InSameTreePositionIterator& a) { |
4849 | + thePrinter.startBeginVisit("InSameTreePositionIterator", ++theId); |
4850 | + printCommons( &a, theId ); |
4851 | + thePrinter.endBeginVisit( theId ); |
4852 | +} |
4853 | + |
4854 | +void PrinterVisitor::endVisit ( const InSameTreePositionIterator& ) { |
4855 | + thePrinter.startEndVisit(); |
4856 | + thePrinter.endEndVisit(); |
4857 | +} |
4858 | +// </InSameTreePositionIterator> |
4859 | + |
4860 | + |
4861 | +// <InCollectionPositionIterator> |
4862 | +void PrinterVisitor::beginVisit ( const InCollectionPositionIterator& a) { |
4863 | + thePrinter.startBeginVisit("InCollectionPositionIterator", ++theId); |
4864 | + printCommons( &a, theId ); |
4865 | + thePrinter.endBeginVisit( theId ); |
4866 | +} |
4867 | + |
4868 | +void PrinterVisitor::endVisit ( const InCollectionPositionIterator& ) { |
4869 | + thePrinter.startEndVisit(); |
4870 | + thePrinter.endEndVisit(); |
4871 | +} |
4872 | +// </InCollectionPositionIterator> |
4873 | + |
4874 | + |
4875 | +// <InSameCollectionPositionIterator> |
4876 | +void PrinterVisitor::beginVisit ( const InSameCollectionPositionIterator& a) { |
4877 | + thePrinter.startBeginVisit("InSameCollectionPositionIterator", ++theId); |
4878 | + printCommons( &a, theId ); |
4879 | + thePrinter.endBeginVisit( theId ); |
4880 | +} |
4881 | + |
4882 | +void PrinterVisitor::endVisit ( const InSameCollectionPositionIterator& ) { |
4883 | + thePrinter.startEndVisit(); |
4884 | + thePrinter.endEndVisit(); |
4885 | +} |
4886 | +// </InSameCollectionPositionIterator> |
4887 | + |
4888 | + |
4889 | // <NodeReferenceIterator> |
4890 | void PrinterVisitor::beginVisit ( const NodeReferenceIterator& a) { |
4891 | thePrinter.startBeginVisit("NodeReferenceIterator", ++theId); |
4892 | |
4893 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.h' |
4894 | --- src/runtime/visitors/pregenerated/printer_visitor.h 2011-10-19 15:28:51 +0000 |
4895 | +++ src/runtime/visitors/pregenerated/printer_visitor.h 2011-11-02 17:26:24 +0000 |
4896 | @@ -457,6 +457,78 @@ |
4897 | void beginVisit( const FrexpIterator& ); |
4898 | void endVisit ( const FrexpIterator& ); |
4899 | |
4900 | + void beginVisit( const NodePositionIterator& ); |
4901 | + void endVisit ( const NodePositionIterator& ); |
4902 | + |
4903 | + void beginVisit( const IsAncestorPositionIterator& ); |
4904 | + void endVisit ( const IsAncestorPositionIterator& ); |
4905 | + |
4906 | + void beginVisit( const IsFollowingSiblingPositionIterator& ); |
4907 | + void endVisit ( const IsFollowingSiblingPositionIterator& ); |
4908 | + |
4909 | + void beginVisit( const IsFollowingPositionIterator& ); |
4910 | + void endVisit ( const IsFollowingPositionIterator& ); |
4911 | + |
4912 | + void beginVisit( const IsInSubtreeOfPositionIterator& ); |
4913 | + void endVisit ( const IsInSubtreeOfPositionIterator& ); |
4914 | + |
4915 | + void beginVisit( const IsDescendantPositionIterator& ); |
4916 | + void endVisit ( const IsDescendantPositionIterator& ); |
4917 | + |
4918 | + void beginVisit( const IsPrecedingSiblingPositionIterator& ); |
4919 | + void endVisit ( const IsPrecedingSiblingPositionIterator& ); |
4920 | + |
4921 | + void beginVisit( const IsPrecedingPositionIterator& ); |
4922 | + void endVisit ( const IsPrecedingPositionIterator& ); |
4923 | + |
4924 | + void beginVisit( const IsChildPositionIterator& ); |
4925 | + void endVisit ( const IsChildPositionIterator& ); |
4926 | + |
4927 | + void beginVisit( const IsAttributeOfPositionIterator& ); |
4928 | + void endVisit ( const IsAttributeOfPositionIterator& ); |
4929 | + |
4930 | + void beginVisit( const IsParentPositionIterator& ); |
4931 | + void endVisit ( const IsParentPositionIterator& ); |
4932 | + |
4933 | + void beginVisit( const IsPrecedingInDocumentOrderPositionIterator& ); |
4934 | + void endVisit ( const IsPrecedingInDocumentOrderPositionIterator& ); |
4935 | + |
4936 | + void beginVisit( const IsFollowingInDocumentOrderPositionIterator& ); |
4937 | + void endVisit ( const IsFollowingInDocumentOrderPositionIterator& ); |
4938 | + |
4939 | + void beginVisit( const LevelPositionIterator& ); |
4940 | + void endVisit ( const LevelPositionIterator& ); |
4941 | + |
4942 | + void beginVisit( const IsAttributePositionIterator& ); |
4943 | + void endVisit ( const IsAttributePositionIterator& ); |
4944 | + |
4945 | + void beginVisit( const IsCommentPositionIterator& ); |
4946 | + void endVisit ( const IsCommentPositionIterator& ); |
4947 | + |
4948 | + void beginVisit( const IsDocumentPositionIterator& ); |
4949 | + void endVisit ( const IsDocumentPositionIterator& ); |
4950 | + |
4951 | + void beginVisit( const IsElementPositionIterator& ); |
4952 | + void endVisit ( const IsElementPositionIterator& ); |
4953 | + |
4954 | + void beginVisit( const IsProcessingInstructionPositionIterator& ); |
4955 | + void endVisit ( const IsProcessingInstructionPositionIterator& ); |
4956 | + |
4957 | + void beginVisit( const IsTextPositionIterator& ); |
4958 | + void endVisit ( const IsTextPositionIterator& ); |
4959 | + |
4960 | + void beginVisit( const IsSiblingPositionIterator& ); |
4961 | + void endVisit ( const IsSiblingPositionIterator& ); |
4962 | + |
4963 | + void beginVisit( const InSameTreePositionIterator& ); |
4964 | + void endVisit ( const InSameTreePositionIterator& ); |
4965 | + |
4966 | + void beginVisit( const InCollectionPositionIterator& ); |
4967 | + void endVisit ( const InCollectionPositionIterator& ); |
4968 | + |
4969 | + void beginVisit( const InSameCollectionPositionIterator& ); |
4970 | + void endVisit ( const InSameCollectionPositionIterator& ); |
4971 | + |
4972 | void beginVisit( const NodeReferenceIterator& ); |
4973 | void endVisit ( const NodeReferenceIterator& ); |
4974 | |
4975 | |
4976 | === modified file 'src/store/api/item.h' |
4977 | --- src/store/api/item.h 2011-10-05 17:49:48 +0000 |
4978 | +++ src/store/api/item.h 2011-11-02 17:26:24 +0000 |
4979 | @@ -662,6 +662,12 @@ |
4980 | * |
4981 | */ |
4982 | virtual bool |
4983 | + isInSubtreeOf(const store::Item_t&) const; |
4984 | + |
4985 | + /** |
4986 | + * |
4987 | + */ |
4988 | + virtual bool |
4989 | isDescendant(const store::Item_t&) const; |
4990 | |
4991 | /** |
4992 | @@ -686,17 +692,95 @@ |
4993 | * |
4994 | */ |
4995 | virtual bool |
4996 | + isAttribute(const store::Item_t&) const; |
4997 | + |
4998 | + /** |
4999 | + * |
5000 | + */ |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ structuralrelat ionships2- 2011-10- 06T12-27- 03.031Z/ log.html
Log at: http://