PathStepExpression Class Reference

Represents base class of all path step expressions. More...

#include <pathstepexpression.h>

Inheritance diagram for PathStepExpression:

Inheritance graph
[legend]
Collaboration diagram for PathStepExpression:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PathStepExpression (EXP_TYPE _type, AXIS_TYPE _axis, PathStepAttribute *_attribute)
 Constructor.
virtual ~PathStepExpression ()
virtual void print (OutputStream &dos) const =0
 Prints the corresponding path step expression.
AXIS_TYPE getAxisType ()
 Returns the AXIS_TYPE.
void setAxisType (AXIS_TYPE _axis)
 Sets the AXIS_TYPE.
NODETEST_TYPE getNodeTestType ()
 Returns the NODETEST_TYPE.
PathStepAttributegetAttribute ()
 Returns the attribute of this path step expression.
void setAttribute (PathStepAttribute *_attribute)
 Sets the attribute of this path step expression.
unsigned getStepWeight (bool is_last_step)
 Returns the weight of this path step expression.
bool isTagNodeTest ()
 Returns if this path step expression is of the form /tag.
bool isStarNodeTest ()
 Returns if this path step expression is of the form /*.
bool isNodeNodeTest ()
 Returns if this path step expression is of the form /node().
bool isTextNodeTest ()
 Returns if this path step expression is of the form /text().
bool isDosNodeStep ()
 Returns if this path step expression is of the form /dos::node().
bool isSyntacticallyEqualTo (PathStepExpression *ps)
 Returns if this path step expression is syntactically equal to the entered path step expression.
virtual bool isMatchingTag (TAG tag)=0
 Returns if the correspnding path step expression is matching the entered TAG.
bool hasAttribute ()
 Returns if this path step expression contains an PathStepAttribute.
virtual PathStepExpressionclone ()=0
 Returns a new, independent copy of a path step expression or of this object respectively.
virtual PathStepExpressioncloneWithoutAttributes ()=0
 Returns a new, independent copy of a path step expression or of this object respectively without any PathStepAttribute.

Protected Attributes

AXIS_TYPE axis
 The type of axis for this path step expression.
PathStepAttributeattribute
 The attribute associated with this path step expression.


Detailed Description

Represents base class of all path step expressions.

Represents base class of all path step expressions.

Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 81 of file pathstepexpression.h.


Constructor & Destructor Documentation

PathStepExpression::PathStepExpression ( EXP_TYPE  _type,
AXIS_TYPE  _axis,
PathStepAttribute _attribute 
)

Constructor.

Constructor - creating object for an EXP_TYPE, an AXIS_TYPE and a PathStepAttribute if required.

Parameters:
[in] _type EXP_TYPE.
[in] _axis AXIS_TYPE.
[in] _attribute Pointer to a PathStepAttribute object.

Definition at line 41 of file pathstepexpression.cpp.

PathStepExpression::~PathStepExpression (  )  [virtual]

Destructor.

Definition at line 48 of file pathstepexpression.cpp.

References attribute.


Member Function Documentation

PathStepExpression * PathStepExpression::clone (  )  [pure virtual]

Returns a new, independent copy of a path step expression or of this object respectively.

Returns a new, independent copy of a path step expression or of this object respectively.

Return values:
PathStepExpression* Copy of a path step expression or of this object respectively.

Implemented in PathStepNodeExpression, PathStepStarExpression, PathStepTagExpression, and PathStepTextExpression.

Referenced by PathEnvironment::getPathBetween(), ProjectionTreeNode::getRootPath(), PathExpressionAdornment::PathExpressionAdornment(), and DependencyTuple::registerToPassiveProjectionTree().

PathStepExpression * PathStepExpression::cloneWithoutAttributes (  )  [pure virtual]

Returns a new, independent copy of a path step expression or of this object respectively without any PathStepAttribute.

Returns a new, independent copy of a path step expression or of this object respectively without any PathStepAttribute.

Return values:
PathStepExpression* Copy of a path step expression or of this object respectively without any PathStepAttribute.

Implemented in PathStepNodeExpression, PathStepStarExpression, PathStepTagExpression, and PathStepTextExpression.

PathStepAttribute * PathStepExpression::getAttribute (  )  [inline]

Returns the attribute of this path step expression.

Returns the attribute of this path step expression. The returned PathStepAttribute might be NULL.

Return values:
PathStepAttribute* Pointer to a PathStepAttribute object.

Definition at line 137 of file pathstepexpression.h.

References attribute.

Referenced by BufferIterator::BufferIterator(), Role::isPosRole(), and DependencyTuple::isPosTuple().

AXIS_TYPE PathStepExpression::getAxisType (  )  [inline]

NODETEST_TYPE PathStepExpression::getNodeTestType (  ) 

Returns the NODETEST_TYPE.

Returns the NODETEST_TYPE.

Return values:
NODETEST_TYPE. 

Definition at line 52 of file pathstepexpression.cpp.

References Expression::type.

Referenced by BufferIterator::isMatchingNodeTestAndPredicates(), and isSyntacticallyEqualTo().

unsigned PathStepExpression::getStepWeight ( bool  is_last_step  ) 

Returns the weight of this path step expression.

Returns the weight of this path step expression.

Parameters:
[in] is_last_step Indicator if this path step expression is the last one, i.e. true if it is the last one, false otherwise.
Return values:
unsigned Weight of this path step expression.

Definition at line 67 of file pathstepexpression.cpp.

References axis, Expression::type, WEIGHT_AXIS_CHILD, WEIGHT_AXIS_DESCENDANT, WEIGHT_AXIS_DOS, WEIGHT_INNER_NODETEST, WEIGHT_NODETEST_NODE, WEIGHT_NODETEST_STAR, WEIGHT_NODETEST_TAG, and WEIGHT_NODETEST_TEXT.

bool PathStepExpression::hasAttribute (  )  [inline]

Returns if this path step expression contains an PathStepAttribute.

Returns if this path step expression contains an PathStepAttribute.

Return values:
bool true if this path step expression contains an PathStepAttribute, false otherwise.

Definition at line 235 of file pathstepexpression.h.

References attribute.

Referenced by BufferIterator::BufferIterator(), Role::isPosRole(), and DependencyTuple::isPosTuple().

bool PathStepExpression::isDosNodeStep (  )  [inline]

Returns if this path step expression is of the form /dos::node().

Returns if this path step expression is of the form /dos::node().

Return values:
bool true if this path step expression is of the form /dos::node(), false otherwise.

Definition at line 207 of file pathstepexpression.h.

References axis, and Expression::type.

Referenced by BufferIterator::BufferIterator(), BufferIterator::init(), Role::isDosRole(), DependencyTuple::isDosTuple(), PathExpression::mightHasChildDescendantConflict(), PathExpressionAdornment::PathExpressionAdornment(), ProjectionTreeNode::removeRedundantRoles(), and BufferIterator::reset().

bool PathStepExpression::isMatchingTag ( TAG  tag  )  [pure virtual]

Returns if the correspnding path step expression is matching the entered TAG.

Returns if the correspnding path step expression is matching the entered TAG.

Parameters:
[in] tag TAG.
Return values:
bool true if the correspnding path step expression is matching the entered TAG, false otherwise.

Implemented in PathStepNodeExpression, PathStepStarExpression, PathStepTagExpression, and PathStepTextExpression.

Referenced by PassiveProjectionTreeConfiguration::applyTag(), isSyntacticallyEqualTo(), and ProjectionTreeLabel::matchesTag().

bool PathStepExpression::isNodeNodeTest (  )  [inline]

Returns if this path step expression is of the form /node().

Returns if this path step expression is of the form /node().

Return values:
bool true if this path step expression is of the form /node(), false otherwise.

Definition at line 186 of file pathstepexpression.h.

References Expression::type.

Referenced by ProjectionTreeLabel::isDosNodeLabel(), ProjectionTreeLabel::isNodeLabel(), ProjectionTreeLabel::matchesText(), and PathExpressionAdornment::PathExpressionAdornment().

bool PathStepExpression::isStarNodeTest (  )  [inline]

Returns if this path step expression is of the form /*.

Returns if this path step expression is of the form /*.

Return values:
bool true if this path step expression is of the form /*, false otherwise.

Definition at line 176 of file pathstepexpression.h.

References Expression::type.

Referenced by PathExpression::isSemanticallyContainedIn(), ProjectionTreeLabel::isStarLabel(), and PathExpressionAdornment::PathExpressionAdornment().

bool PathStepExpression::isSyntacticallyEqualTo ( PathStepExpression ps  ) 

Returns if this path step expression is syntactically equal to the entered path step expression.

Returns if this path step expression is syntactically equal to the entered path step expression.

Parameters:
[in] ps Pointer to a PathStepExpression object (path step expression to be compared).
Return values:
bool true if this path step expression is syntactically equal to the entered path step expression, false otherwise.

Definition at line 105 of file pathstepexpression.cpp.

References axis, getAxisType(), getNodeTestType(), isMatchingTag(), and isTagNodeTest().

Referenced by PassiveProjectionTreeNode::registerPath().

bool PathStepExpression::isTagNodeTest (  )  [inline]

Returns if this path step expression is of the form /tag.

Returns if this path step expression is of the form /tag.

Return values:
bool true if this path step expression is of the form /tag, false otherwise.

Definition at line 166 of file pathstepexpression.h.

References Expression::type.

Referenced by ProjectionTreeLabel::getTag(), PathExpression::isSemanticallyContainedIn(), isSyntacticallyEqualTo(), and PathExpression::mightHasChildDescendantConflict().

bool PathStepExpression::isTextNodeTest (  )  [inline]

Returns if this path step expression is of the form /text().

Returns if this path step expression is of the form /text().

Return values:
bool true if this path step expression is of the form /text(), false otherwise.

Definition at line 196 of file pathstepexpression.h.

References Expression::type.

Referenced by ProjectionTreeLabel::matchesText(), PathExpression::mightHasChildDescendantConflict(), and PathExpressionAdornment::PathExpressionAdornment().

void PathStepExpression::print ( OutputStream dos  )  const [pure virtual]

Prints the corresponding path step expression.

Prints the corresponding path step expression.

Parameters:
[in] dos Pointer to a OutputStream object.
Return values:
void 

Implements Expression.

Implemented in PathStepNodeExpression, PathStepStarExpression, PathStepTagExpression, and PathStepTextExpression.

void PathStepExpression::setAttribute ( PathStepAttribute _attribute  )  [inline]

Sets the attribute of this path step expression.

Sets the attribute of this path step expression.

Parameters:
[in] _attribute Pointer to a PathStepAttribute object.
Return values:
void 

Definition at line 147 of file pathstepexpression.h.

References attribute.

void PathStepExpression::setAxisType ( AXIS_TYPE  _axis  )  [inline]

Sets the AXIS_TYPE.

Sets the AXIS_TYPE, i.e. sets the member variable.

Parameters:
[in] _axis AXIS_TYPE.
Return values:
void 

Definition at line 120 of file pathstepexpression.h.

Referenced by PathExpressionAdornment::PathExpressionAdornment().


Member Data Documentation

The attribute associated with this path step expression.

The attribute associated with this path step expression, which is the third argument of the constructor. This member variable may be NULL.

Definition at line 268 of file pathstepexpression.h.

Referenced by PathStepTextExpression::clone(), PathStepTagExpression::clone(), PathStepStarExpression::clone(), PathStepNodeExpression::clone(), getAttribute(), hasAttribute(), PathStepTextExpression::print(), PathStepTagExpression::print(), PathStepStarExpression::print(), PathStepNodeExpression::print(), setAttribute(), and ~PathStepExpression().


Generated on Sun May 24 20:20:27 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9