#include <pathexpression.h>
Public Member Functions | |
PathExpression () | |
Constructor. | |
virtual | ~PathExpression () |
void | addPathStep (PathStepExpression *ps) |
Appends a new path step expression to the end of this path expression. | |
virtual void | print (OutputStream &dos) const |
vector< PathStepExpression * > * | getPathSteps () |
Returns all path step expressions of this path expression. | |
unsigned | getPathSize () |
Returns the (current) path expression size. | |
PathStepExpression * | getPathStepAt (unsigned i) |
Returns the path step expression of a path expression at a specific position. | |
PathStepExpression * | getTailPathStep () |
Returns the last path step expression of a path expression. | |
PathStepExpression * | getPathStepAfterTextNodeTest () |
Returns the path step expression after the first text() node test of a path expression. | |
unsigned | getWeight () |
Returns the weight as a whole of a path expression. | |
PathExpressionAdornment * | getAdornment () |
Returns the path expression adornments. | |
bool | isEmptyPath () |
Returns if this path expression is empty. | |
bool | isDosNodePath () |
Returns if this path expression has a dos : : node () PathStepExpression at his end. | |
bool | isSyntacticallyEqualTo (PathExpression *path) |
Returns if this path expression is syntactically equal to the entered path expression. | |
bool | isSemanticallyContainedIn (PathExpression *path) |
Returns if this path expression is semantically contained in the entered path expression. | |
bool | hasInnerTextNodeTest () |
Returns if the path expression has an inner text() node test PathStepExpression. | |
bool | hasTerminatingTextNodeTest () |
Returns if the path expression has an text() node test PathStepExpression at his end. | |
bool | hasFollowingDescendantOrDosFrom (unsigned ps_idx) |
Returns if the path expression has a following /dos or /descendant axis from a specific position on. | |
bool | hasPreviousDescendantOrDosUpTo (unsigned ps_idx) |
Returns if the path expression has a previous /dos or /descendant axis from a specific position on. | |
bool | selectsNoNode () |
Returns if the path expression selects/locates no nodes of an arbitrary XML tree. | |
bool | containsStarDescendantSequence (unsigned pos) |
Returns if the path expression contains a sequence of wildcard / * node tests from a specific position on. | |
bool | mightHasChildDescendantConflict (PathExpression *path) |
Checks if there is a child-descendant conflict that forces the path step to be kept anyway, i.e. such that no projection can be applied. | |
void | replacePathStepAt (unsigned idx, PathStepExpression *ps) |
Replaces a path step expression at a specific position of a path expression by a new path step expression. | |
PathExpression * | clone () |
Returns a new, independent copy of a path expression or of this object respectively. | |
PathExpression * | cloneWithoutFinalDosNodeAndAttributes () |
Returns a new, independent copy of a path expression or of this object respectively without an ending /dos PathStepExpression or any PathStepAttribute. | |
Private Attributes | |
vector< PathStepExpression * > | pathsteps |
PathExpressionAdornment * | adornment |
Represents an XQuery path expression, which takes a number of path step expressions as argument.
Definition at line 54 of file pathexpression.h.
PathExpression::PathExpression | ( | ) |
Constructor.
Constructor - creating object for stepwise addition of path step expressions.
Definition at line 37 of file pathexpression.cpp.
Referenced by clone(), and cloneWithoutFinalDosNodeAndAttributes().
PathExpression::~PathExpression | ( | ) | [virtual] |
void PathExpression::addPathStep | ( | PathStepExpression * | ps | ) | [inline] |
Appends a new path step expression to the end of this path expression.
Appends a new path step expression to the end of this path expression.
[in] | ps | Pointer to a PathStepExpression object. |
void |
Definition at line 73 of file pathexpression.h.
References pathsteps.
Referenced by clone(), cloneWithoutFinalDosNodeAndAttributes(), PathEnvironment::getPathBetween(), ProjectionTreeNode::getRootPath(), DependencySet::insertTuple(), PathEnvironment::PathEnvironment(), PathExpressionAdornment::PathExpressionAdornment(), DependencyTuple::registerToPassiveProjectionTree(), and Role::Role().
PathExpression * PathExpression::clone | ( | ) |
Returns a new, independent copy of a path expression or of this object respectively.
Returns a new, independent copy of a path expression or of this object respectively.
PathExpression* | Copy of a path expression or of this object respectively. |
Definition at line 466 of file pathexpression.cpp.
References addPathStep(), PathExpression(), and pathsteps.
Referenced by VarStepExpression::clone(), Role::getSignOffExpression(), DependencySet::insertTuple(), DependencyTuple::registerToPassiveProjectionTree(), and Role::Role().
PathExpression * PathExpression::cloneWithoutFinalDosNodeAndAttributes | ( | ) |
Returns a new, independent copy of a path expression or of this object respectively without
an ending /dos
PathStepExpression or any PathStepAttribute.
Returns a new, independent copy of a path expression or of this object respectively without
an ending /dos
PathStepExpression or any PathStepAttribute.
PathExpression* | Copy of a path expression or of this object respectively without an ending /dos PathStepExpression or any PathStepAttribute. |
Definition at line 476 of file pathexpression.cpp.
References addPathStep(), PathExpression(), and pathsteps.
Referenced by VarStepExpression::cloneWithoutFinalDosNodeAndAttributes().
bool PathExpression::containsStarDescendantSequence | ( | unsigned | pos | ) |
Returns if the path expression contains a sequence of wildcard /
*
node tests from a specific position on.
Returns if the path expression contains a sequence of wildcard /
*
node tests from a specific position on.
[in] | pos | Position at which the path step expression should be checked. |
bool | true if the path expression contains a sequence of wildcard / * node tests from a specific position on, false otherwise. |
Definition at line 394 of file pathexpression.cpp.
References pathsteps.
Referenced by PathExpressionAdornment::PathExpressionAdornment().
PathExpressionAdornment * PathExpression::getAdornment | ( | ) |
Returns the path expression adornments.
Returns the path expression adornments.
PathExpressionAdornment* | Pointer to a PathExpressionAdornment object. |
Definition at line 90 of file pathexpression.cpp.
References adornment.
Referenced by isSemanticallyContainedIn().
unsigned PathExpression::getPathSize | ( | ) | [inline] |
Returns the (current) path expression size.
Returns the (current) path expression size, i.e. returns the number of path step expressions.
unsigned | Number of path step expressions of a path expression. |
Definition at line 94 of file pathexpression.h.
References pathsteps.
Referenced by ProjectionTreeLabel::atEndOfPath(), BufferIterator::BufferIterator(), ProjectionTreeLabels::computeProjectionTreeLabels(), ProjectionTreeNode::getRootPath(), BufferIterator::isSatisfyingPath(), isSemanticallyContainedIn(), isSyntacticallyEqualTo(), mightHasChildDescendantConflict(), PathExpressionAdornment::PathExpressionAdornment(), PathExpressionAdornment::print(), DependencyTuple::registerToPassiveProjectionTree(), ProjectionTreeNode::removeRedundantRoles(), and BufferIterator::reset().
PathStepExpression * PathExpression::getPathStepAfterTextNodeTest | ( | ) |
Returns the path step expression after the first text()
node test of a path expression.
Returns the path step expression after the first text()
node test of a path expression.
PathStepExpression* | Pointer to a PathStepExpression object. |
Definition at line 62 of file pathexpression.cpp.
References pathsteps.
Referenced by BufferIterator::BufferIterator(), BufferIterator::init(), and BufferIterator::reset().
PathStepExpression * PathExpression::getPathStepAt | ( | unsigned | i | ) | [inline] |
Returns the path step expression of a path expression at a specific position.
Returns the path step expression of a path expression at a specific position.
[in] | i | Position at which the path step expression should be obtained. |
PathStepExpression* | Pointer to a PathStepExpression object. |
Definition at line 104 of file pathexpression.h.
References pathsteps.
Referenced by BufferIterator::BufferIterator(), BufferIterator::debugPrint(), PathEnvironment::getPathBetween(), ProjectionTreeLabel::getPathStep(), ProjectionTreeNode::getRootPath(), BufferIterator::init(), BufferIterator::isMatchingNodeTestAndPredicates(), BufferIterator::isSatisfyingPath(), isSemanticallyContainedIn(), mightHasChildDescendantConflict(), PathExpressionAdornment::PathExpressionAdornment(), PassiveProjectionTreeNode::registerPath(), DependencyTuple::registerToPassiveProjectionTree(), and BufferIterator::reset().
vector< PathStepExpression * > * PathExpression::getPathSteps | ( | ) | [inline] |
Returns all path step expressions of this path expression.
Returns all path step expressions of this path expression, i.e. returns the member variable.
vector<PathStepExpression*>* | Pointer to a vector containing PathStepExpression objects. |
Definition at line 85 of file pathexpression.h.
References pathsteps.
Referenced by BufferIterator::debugPrint(), PathEnvironment::getPathBetween(), isSyntacticallyEqualTo(), PathExpressionAdornment::PathExpressionAdornment(), and Role::Role().
PathStepExpression * PathExpression::getTailPathStep | ( | ) |
Returns the last path step expression of a path expression.
Returns the last path step expression of a path expression.
PathStepExpression* | Pointer to a PathStepExpression object. |
Definition at line 54 of file pathexpression.cpp.
References pathsteps.
Referenced by DependencySet::insertTuple(), Role::isDosRole(), DependencyTuple::isDosTuple(), Role::isPosRole(), DependencyTuple::isPosTuple(), PathExpressionAdornment::PathExpressionAdornment(), and ProjectionTreeNode::removeRedundantRoles().
unsigned PathExpression::getWeight | ( | ) |
Returns the weight as a whole of a path expression.
Returns the weight as a whole of a path expression.
unsigned | Weight as a whole of a path expression. |
Definition at line 76 of file pathexpression.cpp.
References pathsteps.
bool PathExpression::hasFollowingDescendantOrDosFrom | ( | unsigned | ps_idx | ) |
Returns if the path expression has a following /dos
or /descendant
axis from a specific position on.
Returns if the path expression has a following /dos
or /descendant
axis from a specific position on.
[in] | ps_idx | Position at which the path step expression should be checked. |
bool | true if the path expression has a following /dos or /descendant axis from a specific position on, false otherwise. |
Definition at line 357 of file pathexpression.cpp.
References pathsteps.
bool PathExpression::hasInnerTextNodeTest | ( | ) |
Returns if the path expression has an inner text()
node test PathStepExpression.
Returns if the path expression has an inner text()
node test PathStepExpression.
bool | true if the path expression has an inner text() node test PathStepExpression, false otherwise. |
Definition at line 341 of file pathexpression.cpp.
References pathsteps.
Referenced by BufferIterator::BufferIterator(), BufferIterator::init(), ProjectionTreeNode::removeUnneededNodes(), and BufferIterator::reset().
bool PathExpression::hasPreviousDescendantOrDosUpTo | ( | unsigned | ps_idx | ) |
Returns if the path expression has a previous /dos
or /descendant
axis from a specific position on.
Returns if the path expression has a previous /dos
or /descendant
axis from a specific position on.
[in] | ps_idx | Position at which the path step expression should be checked. |
bool | true if the path expression has a previous /dos or /descendant axis from a specific position on, false otherwise. |
Definition at line 368 of file pathexpression.cpp.
References pathsteps.
Referenced by BufferIterator::BufferIterator().
bool PathExpression::hasTerminatingTextNodeTest | ( | ) |
Returns if the path expression has an text()
node test PathStepExpression at his end.
Returns if the path expression has an text()
node test PathStepExpression at his end.
bool | true if the path expression has an text() node test PathStepExpression at his end, false otherwise. |
Definition at line 351 of file pathexpression.cpp.
References pathsteps.
bool PathExpression::isDosNodePath | ( | ) |
Returns if this path expression has a dos
:
:
node
()
PathStepExpression at his end.
Returns if this path expression has a dos
:
:
node
()
PathStepExpression at his end.
bool | true f this path expression has a dos : : node () PathStepExpression at his end, false otherwise. |
Definition at line 98 of file pathexpression.cpp.
References pathsteps.
bool PathExpression::isEmptyPath | ( | ) | [inline] |
Returns if this path expression is empty.
Returns if this path expression is empty, i.e. returns if this path expression contains no path step expression.
bool | true if this path expression contains no path step expression, false otherwise. |
Definition at line 143 of file pathexpression.h.
References pathsteps.
Referenced by ExistsCondExpression::extractDependencies(), ProjectionTreeNode::getRootPath(), Role::getSignOffExpression(), DependencySet::insertTuple(), ProjectionTreeLabel::isChildLabel(), ProjectionTreeLabel::isDescendantLabel(), ProjectionTreeLabel::isDosLabel(), ProjectionTreeLabel::isDosNodeLabel(), ProjectionTreeLabel::isDosOrDescendantLabel(), Role::isDosRole(), ProjectionTreeLabel::isNodeLabel(), ProjectionTreeLabel::isStarLabel(), PathExpressionAdornment::PathExpressionAdornment(), Role::printExtended(), PassiveProjectionTree::registerPath(), and SignOffExpression::SignOffExpression().
bool PathExpression::isSemanticallyContainedIn | ( | PathExpression * | path | ) |
Returns if this path expression is semantically contained in the entered path expression.
Returns if this path expression is semantically contained in the entered path expression.
[in] | path | Pointer to a PathExpression object (path expression to be compared). |
bool | true if this path expression is semantically contained in the entered path expression, false otherwise. |
Definition at line 123 of file pathexpression.cpp.
References PathExpressionAdornment::getAdornedPath(), getAdornment(), PathStepExpression::getAxisType(), PathStepTagExpression::getNodeTest(), PathExpressionAdornment::getPathAdornments(), getPathSize(), getPathStepAt(), PathExpressionAdornment::getRewrittenPath(), PathExpressionAdornment::isChildNodePath(), PathExpressionAdornment::isChildTextPath(), PathExpressionAdornment::isDescendantNodePath(), PathExpressionAdornment::isDescendantTextPath(), PathExpressionAdornment::isDosNodePath(), PathStepExpression::isStarNodeTest(), and PathStepExpression::isTagNodeTest().
Referenced by DependencyTuple::isSemanticallyContainedIn().
bool PathExpression::isSyntacticallyEqualTo | ( | PathExpression * | path | ) |
Returns if this path expression is syntactically equal to the entered path expression.
Returns if this path expression is syntactically equal to the entered path expression.
[in] | path | Pointer to a PathExpression object (path expression to be compared). |
bool | true if this path expression is syntactically equal to the entered path expression, false otherwise. |
Definition at line 107 of file pathexpression.cpp.
References getPathSize(), getPathSteps(), and pathsteps.
Referenced by DependencyTuple::isSyntacticallyEqualTo().
bool PathExpression::mightHasChildDescendantConflict | ( | PathExpression * | path | ) |
Checks if there is a child-descendant conflict that forces the path step to be kept anyway, i.e. such that no projection can be applied.
A simple example for such a child-descendant conflict are two path expressions /a/d and //d. Here, such a conflict arises: when we read the document starting sequence <a><c> for instance, we are not allowed to project the <c>-tag away, although it is not matched by any of the projection paths. The reason is simple: consider the document <a><c><d/></c></a> and the query <q>{ <one>{ /a/d }</one>, <two>{ //d }</two> }</q>. It is easy to see that this query gives different results when evaluated on documents <a><c><d/></c></a> and <a><d/></a>. We denote this situation as child-descendant conflict, and in such cases the <c>-tag cannot be projected away, as witnessed by the above example. We refer the interested reader to the paper for more details.
[in] | path | Pointer to a PathExpression object. |
bool | true if the current path has a child-descendant conflict with the passed path, false otherwise. |
Definition at line 406 of file pathexpression.cpp.
References PathStepExpression::getAxisType(), PathStepTagExpression::getNodeTest(), getPathSize(), getPathStepAt(), PathStepExpression::isDosNodeStep(), PathStepExpression::isTagNodeTest(), and PathStepExpression::isTextNodeTest().
Referenced by DependencyTuple::isSemanticallyContainedIn().
void PathExpression::print | ( | OutputStream & | dos | ) | const [virtual] |
Prints the expression.
Prints the expression.
[in] | dos | Pointer to a OutputStream object. |
void |
Implements Expression.
Definition at line 48 of file pathexpression.cpp.
References pathsteps.
void PathExpression::replacePathStepAt | ( | unsigned | idx, | |
PathStepExpression * | ps | |||
) |
Replaces a path step expression at a specific position of a path expression by a new path step expression.
Replaces a path step expression at a specific position of a path expression by a new path step expression.
[in] | idx | Position at which replacement should take place. |
[in] | ps | Pointer to a PathStepExpression object. |
void |
Definition at line 458 of file pathexpression.cpp.
References pathsteps.
Referenced by PathExpressionAdornment::PathExpressionAdornment().
bool PathExpression::selectsNoNode | ( | ) |
Returns if the path expression selects/locates no nodes of an arbitrary XML tree.
Returns if the path expression selects/locates no nodes of an arbitrary XML tree.
bool | true if the path expression selects/locates no nodes of an arbitrary XML tree, false otherwise. |
Definition at line 383 of file pathexpression.cpp.
References pathsteps.
Referenced by PathExpressionAdornment::PathExpressionAdornment().
PathExpressionAdornment * PathExpression::adornment [private] |
The adornments associated with this path expression.
Definition at line 287 of file pathexpression.h.
Referenced by getAdornment(), and ~PathExpression().
vector< PathStepExpression * > PathExpression::pathsteps [private] |
The path step expressions of this path expressions.
Definition at line 281 of file pathexpression.h.
Referenced by addPathStep(), clone(), cloneWithoutFinalDosNodeAndAttributes(), containsStarDescendantSequence(), getPathSize(), getPathStepAfterTextNodeTest(), getPathStepAt(), getPathSteps(), getTailPathStep(), getWeight(), hasFollowingDescendantOrDosFrom(), hasInnerTextNodeTest(), hasPreviousDescendantOrDosUpTo(), hasTerminatingTextNodeTest(), isDosNodePath(), isEmptyPath(), isSyntacticallyEqualTo(), print(), replacePathStepAt(), selectsNoNode(), and ~PathExpression().