Qt 4.8
Public Types | Public Functions | Private Types | Properties | List of all members
QPatternist::Path Class Reference

Implements the path expression, containing two steps, such as in html/body. More...

#include <qpath_p.h>

Inheritance diagram for QPatternist::Path:
QPatternist::PairContainer QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection

Public Types

enum  Kind { RegularPath = 1, XSLTForEach, ForApplyTemplate }
 
- Public Types inherited from QPatternist::Expression
typedef QExplicitlySharedDataPointer< const ExpressionConstPtr
 A smart pointer wrapping const Expression instances. More...
 
enum  ID {
  IDBooleanValue = 1, IDCountFN, IDEmptyFN, IDExistsFN,
  IDExpressionSequence, IDGeneralComparison, IDIfThenClause, IDIgnorableExpression,
  IDIntegerValue, IDPositionFN, IDStringValue, IDValueComparison,
  IDRangeVariableReference, IDContextItem, IDUserFunctionCallsite, IDExpressionVariableReference,
  IDAttributeConstructor, IDUpperCaseFN, IDLowerCaseFN, IDFirstItemPredicate,
  IDEmptySequence, IDReturnOrderBy, IDLetClause, IDForClause,
  IDPath, IDNamespaceConstructor, IDArgumentReference, IDGenericPredicate,
  IDAxisStep, IDFloat, IDCombineNodes, IDUnresolvedVariableReference,
  IDCardinalityVerifier
}
 
typedef QList< Expression::PtrList
 
typedef QFlags< PropertyProperties
 
enum  Property {
  UseContextItem = 1, DisableElimination = 1 << 1, IsEvaluated = 1 << 2, DisableTypingDeduction = 1 << 3,
  EmptynessFollowsChild = 1 << 4, RewriteToEmptyOnEmpty = 1 << 5, RequiresFocus = 1 << 6, AffectsOrderOnly = 1 << 7,
  RequiresContextItem = (1 << 8) | RequiresFocus, CreatesFocusForLast = 1 << 9, LastOperandIsCollation = 1 << 10, DependsOnLocalVariable = (1 << 11) | DisableElimination,
  EvaluationCacheRedundant = (1 << 12), IsNodeConstructor = 1 << 13, RequiresCurrentItem = 1 << 14
}
 
typedef QExplicitlySharedDataPointer< ExpressionPtr
 A smart pointer wrapping mutable Expression instances. More...
 
typedef ::QAbstractXmlForwardIterator< Expression::PtrQAbstractXmlForwardIterator
 
typedef QVector< Expression::PtrVector
 

Public Functions

virtual ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const
 
virtual Expression::Ptr compress (const StaticContext::Ptr &context)
 
virtual Item::Iterator::Ptr evaluateSequence (const DynamicContext::Ptr &context) const
 
virtual Item evaluateSingleton (const DynamicContext::Ptr &context) const
 
virtual void evaluateToSequenceReceiver (const DynamicContext::Ptr &context) const
 
virtual SequenceType::List expectedOperandTypes () const
 
virtual ID id () const
 
Kind kind () const
 
Item::Iterator::Ptr mapToSequence (const Item &item, const DynamicContext::Ptr &context) const
 
virtual ItemType::Ptr newFocusType () const
 
 Path (const Expression::Ptr &operand1, const Expression::Ptr &operand2, const Kind kind=RegularPath)
 
virtual Properties properties () const
 
void setLast ()
 
virtual SequenceType::Ptr staticType () const
 
virtual Expression::Ptr typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
 
- Public Functions inherited from QPatternist::PairContainer
virtual bool compressOperands (const StaticContext::Ptr &)
 
virtual Expression::List operands () const
 
virtual void setOperands (const Expression::List &operands)
 
- Public Functions inherited from QPatternist::Expression
virtual const SourceLocationReflectionactualReflection () const
 Returns this. More...
 
virtual void announceFocusType (const ItemType::Ptr &itemType)
 
Properties deepProperties () const
 Computes the union of properties for this Expression and all its descending children. More...
 
virtual Properties dependencies () const
 
virtual QString description () const
 
virtual bool evaluateEBV (const DynamicContext::Ptr &context) const
 
virtual ItemType::Ptr expectedContextItemType () const
 
 Expression ()
 
bool has (const Property prop) const
 
bool hasDependency (const Property prop) const
 
bool is (const ID id) const
 
bool isEvaluated () const
 
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > optimizationPasses () const
 
virtual PatternPriority patternPriority () const
 
const Expression::Ptrrewrite (const Expression::Ptr &to, const StaticContext::Ptr &context) const
 Rewrites this Expression to to, and return to. More...
 
virtual ~Expression ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 
- Public Functions inherited from QPatternist::CppCastingHelper< Expression >
const TCastTarget * as () const
 
TCastTarget * as ()
 
- Public Functions inherited from QPatternist::SourceLocationReflection
virtual QSourceLocation sourceLocation () const
 
 SourceLocationReflection ()
 
virtual ~SourceLocationReflection ()
 

Private Types

typedef QExplicitlySharedDataPointer< const PathConstPtr
 

Properties

bool m_checkXPTY0018
 
bool m_hasCreatedSorter
 
bool m_isLast
 
const Kind m_kind
 

Additional Inherited Members

- Static Public Functions inherited from QPatternist::Expression
static void rewrite (Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::PairContainer
 PairContainer (const Expression::Ptr &operand1, const Expression::Ptr &operand2)
 
- Protected Functions inherited from QPatternist::Expression
void typeCheckOperands (const StaticContext::Ptr &context)
 
- Protected Functions inherited from QPatternist::CppCastingHelper< Expression >
 CppCastingHelper ()
 
- Protected Variables inherited from QPatternist::PairContainer
Expression::Ptr m_operand1
 
Expression::Ptr m_operand2
 

Detailed Description

Implements the path expression, containing two steps, such as in html/body.

See also
XQuery 1.0: An XML Query Language, 3.2 Path Expressions
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 72 of file qpath_p.h.

Typedefs

◆ ConstPtr

Definition at line 140 of file qpath_p.h.

Enumerations

◆ Kind

Enumerator
RegularPath 

This Path is a plain old path expression as found in XPath. Sorting is performed, and atomics are disallowed as left operand.

XSLTForEach 

This Path emulates an xsl:for-each instruction. This means no sorting of result, and atomics are allowed as left operand.

ForApplyTemplate 

This Path performs the iteration in an xsl:apply-templates instruction. This means sorting, and atomics are disallowed as left operand.

Definition at line 75 of file qpath_p.h.

Constructors and Destructors

◆ Path()

Path::Path ( const Expression::Ptr operand1,
const Expression::Ptr operand2,
const Kind  kind = RegularPath 
)

Definition at line 56 of file qpath.cpp.

58  : PairContainer(operand1, operand2)
60  , m_isLast(false)
62  , m_kind(kind)
63 {
64 }
bool m_checkXPTY0018
Definition: qpath_p.h:162
PairContainer(const Expression::Ptr &operand1, const Expression::Ptr &operand2)
Kind kind() const
Definition: qpath_p.h:134
bool m_hasCreatedSorter
Definition: qpath_p.h:154
const Kind m_kind
Definition: qpath_p.h:163

Functions

◆ accept()

ExpressionVisitorResult::Ptr Path::accept ( const ExpressionVisitor::Ptr visitor) const
virtual

Implements QPatternist::Expression.

Definition at line 251 of file qpath.cpp.

252 {
253  return visitor->visit(this);
254 }

◆ compress()

Expression::Ptr Path::compress ( const StaticContext::Ptr context)
virtual

compress() is the last stage performs in compiling an expression, done after the initial AST build and calling typeCheck(). compress() performs crucial simplifications, either by having drastic performance implications or that some expressions depend on it for proper behavior.

The default implementation performs a sparse conditional constant propagation. In short, a recursive process is performed in the AST which examines if the Expression's operands are constant values, and if so, performs a const fold(AST rewrite) into the result of evaluating the expression in question. This default behavior can be disabled by letting properties() return DisableElimination.

This compress() stage can be relative effective due to the design of XPath, in part because intrinsic functions are heavily used. Many Expressions override compress() and do optimizations specific to what they do. Also, many Expressions performs optimizations in their typeCheck().

Parameters
contextthe static context. Supplies compile time information, and is the channel for communicating error messages.
See also
Wikipedia, the free encyclopedia, Sparse conditional constant propagation
Wikipedia, the free encyclopedia, Intrinsic function
Wikipedia, the free encyclopedia, Compiler optimization

Reimplemented from QPatternist::Expression.

Definition at line 162 of file qpath.cpp.

163 {
164  const Expression::Ptr me(PairContainer::compress(context));
165 
166  /* "./expr" is by now equal to "expr" since we've done
167  * focus/type checks, and a node sorter has been inserted. */
169  return m_operand2;
170 
171  /* We do this as late as we can, such that we pick up the most recent type
172  * from the operand. */
174  m_checkXPTY0018 = true;
175 
176  return me;
177 }
bool m_checkXPTY0018
Definition: qpath_p.h:162
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
static const ItemType::Ptr item
virtual SequenceType::Ptr staticType() const =0
virtual ItemType::Ptr itemType() const =0
const Kind m_kind
Definition: qpath_p.h:163
bool is(const ID id) const

◆ evaluateSequence()

Item::Iterator::Ptr Path::evaluateSequence ( const DynamicContext::Ptr context) const
virtual

Evaluate this Expression by iterating over it. This is a central function for evaluating expressions.

Expressions must always always return a valid QAbstractXmlForwardIterator and may never return 0. If an empty result is of interest to be returned, the EmptyIterator should be returned.

The default implementation returns a SingletonIterator over the item returned from evaluateSingleton().

Note
This function may raise an exception when calling, not only when QAbstractXmlForwardIterator::next() is called on the return value. This is because in some cases evaluateSingleton() is called directly.

Reimplemented from QPatternist::Expression.

Definition at line 77 of file qpath.cpp.

78 {
79  /* Note, we use the old context for m_operand1. */
80  const Item::Iterator::Ptr source(m_operand1->evaluateSequence(context));
81 
82  const DynamicContext::Ptr focus(context->createFocus());
83  focus->setFocusIterator(source);
84 
85  const Item::Iterator::Ptr result(makeSequenceMappingIterator<Item>(ConstPtr(this), source, focus));
86 
87  if(m_checkXPTY0018)
88  {
89  /* This is an expensive code path, but it should happen very rarely. */
90 
91  enum FoundItem
92  {
93  FoundNone,
94  FoundNode,
95  FoundAtomicValue
96  } hasFound = FoundNone;
97 
98  Item::List whenChecked;
99 
100  Item next(result->next());
101 
102  while(next)
103  {
104  const FoundItem found = next.isAtomicValue() ? FoundAtomicValue : FoundNode;
105 
106  if(hasFound != FoundNone && hasFound != found)
107  {
108  /* It's an atomic value and we've already found a node. Mixed content. */
109  context->error(QtXmlPatterns::tr("The last step in a path must contain either nodes "
110  "or atomic values. It cannot be a mixture between the two."),
112  }
113  else
114  hasFound = found;
115 
116  whenChecked.append(next);
117  next = result->next();
118  }
119 
120  return makeListIterator(whenChecked);
121  }
122  else
123  return result;
124 }
bool m_checkXPTY0018
Definition: qpath_p.h:162
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
QAbstractXmlForwardIterator< T >::Ptr makeListIterator(const QList< T > &list)
DynamicContext::Ptr createFocus()
void error(const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
virtual void setFocusIterator(const Item::Iterator::Ptr &it)=0
QExplicitlySharedDataPointer< const Path > ConstPtr
Definition: qpath_p.h:140
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
Represents an item in the XPath 2.0 Data Model.
Definition: qitem_p.h:182
QList< Item > List
Definition: qitem_p.h:195
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const

◆ evaluateSingleton()

Item Path::evaluateSingleton ( const DynamicContext::Ptr context) const
virtual

Reimplemented from QPatternist::Expression.

Definition at line 126 of file qpath.cpp.

127 {
128  /* This function is called if both operands' cardinality is exactly-one. Therefore
129  * we manually go forward in the focus by calling next().
130  *
131  * We don't check for XPTY0018, only in evaluateSequence(), since if we're guaranteed
132  * to evaluate to one item, we can only evaluate to one node or one atomic value.
133  */
134 
135  /* Note, we use the old context for m_operand1. */
136  const Item::Iterator::Ptr source(m_operand1->evaluateSequence(context));
137 
138  const DynamicContext::Ptr focus(context->createFocus());
139  focus->setFocusIterator(source);
140 
141  /* This test is needed because if the focus is empty, we don't want to(nor can't) evaluate
142  * the next step. */
143  // TODO Why are we at all invoked then?
144  if(source->next())
145  return m_operand2->evaluateSingleton(focus);
146  else
147  return Item();
148 }
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
DynamicContext::Ptr createFocus()
virtual void setFocusIterator(const Item::Iterator::Ptr &it)=0
Represents an item in the XPath 2.0 Data Model.
Definition: qitem_p.h:182
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const

◆ evaluateToSequenceReceiver()

void Path::evaluateToSequenceReceiver ( const DynamicContext::Ptr context) const
virtual

Evaluates this Expression by sending its output to DynamicContext::outputReceiver().

Reimplemented from QPatternist::Expression.

Definition at line 150 of file qpath.cpp.

151 {
152  /* Note, we use the old context for m_operand1. */
153  const Item::Iterator::Ptr source(m_operand1->evaluateSequence(context));
154 
155  const DynamicContext::Ptr focus(context->createFocus());
156  focus->setFocusIterator(source);
157 
158  while(source->next())
160 }
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
DynamicContext::Ptr createFocus()
virtual void setFocusIterator(const Item::Iterator::Ptr &it)=0
virtual void evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const

◆ expectedOperandTypes()

SequenceType::List Path::expectedOperandTypes ( ) const
virtual

Returns a list of Sequence Types, describing the type of each of the expression's operands. Hence, this function has a relationship to the operands() function:

- The lengths of the lists returned by expectedOperandTypes()
and operands() should always be equal in length, since one
cannot describe the type of a non-existent operand(and all
operands must have type information).
- A significant difference between the two functions is that while
the type of objects in the list returned by operands() may vary
between compilations/static context, simply because the particular
Expression is part of different XPath expressions, the
types in the list returned by expectedOperandTypes is always the same
since the function/operator signature never changes.

This function should not be confused with staticType(), which returns the static type of the expression itself, not its operands. The function call is an expression where this is clear: the type of the return value is not the same as the arguments' types. The static type of the operands supplied to the expression can be determined via the staticType() function of the instances returned by operands().

If the expression has no operands, an empty list should be returned.

Implements QPatternist::Expression.

Definition at line 223 of file qpath.cpp.

224 {
225  SequenceType::List result;
226 
227  /* This value needs to be in sync with what we pass to
228  * applyFunctionConversion() in typeCheck() above.
229  *
230  * We don't have the XPTY0019 restriction when we're synthetic XSL-T code.
231  */
232  if(m_kind == XSLTForEach)
234  else
236 
238  return result;
239 }
static const SequenceType::Ptr ZeroOrMoreItems
static const SequenceType::Ptr ZeroOrMoreNodes
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const Kind m_kind
Definition: qpath_p.h:163
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ id()

Expression::ID Path::id ( ) const
virtual

This property, which has no setter, returns an enum value that uniquely identifies this Expression. Patternist makes no use of C++'s dynamic_cast feature, but uses this polymorphic function instead.

Returns
always IgnorableExpression.

Reimplemented from QPatternist::Expression.

Definition at line 266 of file qpath.cpp.

267 {
268  return IDPath;
269 }

◆ kind()

Kind QPatternist::Path::kind ( ) const
inline

Definition at line 134 of file qpath_p.h.

135  {
136  return m_kind;
137  }
const Kind m_kind
Definition: qpath_p.h:163

◆ mapToSequence()

Item::Iterator::Ptr Path::mapToSequence ( const Item item,
const DynamicContext::Ptr context 
) const
inline

Definition at line 66 of file qpath.cpp.

68 {
69  /* item is the focus here. That is in <e/>/1, item is <e/>. However,
70  * we don't use it, since the context item is accessed through
71  * DynamicContext::focusIterator() and friends. */
72  Q_ASSERT(item);
73  Q_UNUSED(item); /* Needed when compiling in release mode. */
74  return m_operand2->evaluateSequence(context);
75 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const

◆ newFocusType()

ItemType::Ptr Path::newFocusType ( ) const
virtual
Returns
the item type of the last step's static type.

Reimplemented from QPatternist::Expression.

Definition at line 261 of file qpath.cpp.

Referenced by typeCheck().

262 {
263  return m_operand1->staticType()->itemType();
264 }
virtual SequenceType::Ptr staticType() const =0
virtual ItemType::Ptr itemType() const =0

◆ properties()

Expression::Properties Path::properties ( ) const
virtual
Returns
a bitwise OR'd value of properties, describing the characteristics of the expression. These properties affects how this Expression is treated in for example type checking stages.

The default implementation returns 0. Override and let the function return a different value, if that's of interest.

An important decision when re-implementing properties() is whether to OR in the properties() of ones operands. For instance, if an operand has RequiresFocus set, that flag nost likely applies to the apparent as well, since it depends on its operand.

See also
deepProperties()
Returns
Expression::None, meaning no special properties

Reimplemented from QPatternist::Expression.

Definition at line 256 of file qpath.cpp.

◆ setLast()

void Path::setLast ( )
inline

Definition at line 166 of file qpath_p.h.

167  {
168  m_isLast = true;
169  }

◆ staticType()

SequenceType::Ptr Path::staticType ( ) const
virtual
Returns
the static type of the last step where the cardinality is multiplied with the cardinality of the first step's cardinality.

Implements QPatternist::Expression.

Definition at line 241 of file qpath.cpp.

242 {
243  const SequenceType::Ptr opType(m_operand2->staticType());
244 
245  /* For each parent step, we evaluate the child step. So multiply the two
246  * cardinalities. */
247  return makeGenericSequenceType(opType->itemType(),
248  m_operand1->staticType()->cardinality() * opType->cardinality());
249 }
virtual Cardinality cardinality() const =0
virtual SequenceType::Ptr staticType() const =0

◆ typeCheck()

Expression::Ptr Path::typeCheck ( const StaticContext::Ptr context,
const SequenceType::Ptr reqType 
)
virtual

This implementation guarantees to never rewrite away this Expression, but at most rewrite it as a child of another expression(that presumably have a type checking role). It is therefore always safe to override this function and call this implementation and not worry about that this Expression becomes deleted.

Many Expressions override typeCheck() and performs optimizations, as opposed to doing it in the compress() stage. This is due to that the design of those Expressions often are tied to that certain simplifications are done at the typeCheck() stage of the compilation process or that it in some other way is related to what the typeCheck() do. Also, the earlier the AST can be simplified, the better the chances are for subsequent optimizations.

It is important that the super class's typeCheck() is called before doing any custom type checking, since the call can change the children(notably, the childrens' static types). For example, if the Expression, MyExpression in the example, does not match the required type, typeCheck returns the Expression wrapped in for example ItemVerifier, CardinalityVerifier, or both.

typeCheck() may be called many times. typeCheck() must either raise an error if this Expression is an invalid expression. Thus, it is guaranteed that an Expression is valid after typeCheck() is called.

Parameters
contextsupplies information, such as namespace bindings and available function signatures, that can be needed at compilation time. context is guaranteed by the caller to never null.
reqTypethe static type that this Expression must match when evaluated. reqType is guaranteed by the caller to never null.
Returns
an Expression that can be this Expression, or another expression, which somehow is necessary for making this Expression conforming to reqType

Reimplemented from QPatternist::Expression.

Definition at line 179 of file qpath.cpp.

181 {
183 
184  /* Here we apply the function conversion first, and with the error code
185  * that we want -- XPTY0019 instead of XPTY0004. Unfortunately
186  * PairContainer::typeCheck() will do the type check again, which is
187  * redundant in the case of when we're not XSLTForEach.
188  *
189  * If we're XSLTForEach, it means we're a synthetic "map" expression for
190  * implementing various XSL-T expressions, and hence don't have the
191  * constraint of XPTY0019.
192  *
193  * It's important that typeCheck() is run for the operands(of course), and the call to
194  * PairContainer::typeCheck() ensures that below, in the case that we're XSL-T code.
195  *
196  * The type we expect, CommonSequenceTypes::ZeroOrMoreNodes() needs to be in sync with
197  * what we return in expectedOperandTypes(). */
198  if(m_kind != XSLTForEach)
199  {
202  context,
205  }
206 
207  /* If our step ends with atomic values, we cannot sort.
208  *
209  * We must smack the NodeSortExpression ontop before calling typeCheck(), since the latter
210  * may insert an Atomizer, as possibly mandated by reqType. By doing it after, the Atomizer
211  * will be a parent to NodeSortExpression, as opposed to a child.
212  */
213  if(!m_hasCreatedSorter)
214  {
215  m_hasCreatedSorter = true;
216 
217  return NodeSortExpression::wrapAround(Expression::Ptr(this), context)->typeCheck(context, reqType);
218  }
219  else
220  return PairContainer::typeCheck(context, reqType);
221 }
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
Definition: qexpression.cpp:70
static const SequenceType::Ptr ZeroOrMoreNodes
virtual ItemType::Ptr newFocusType() const
Definition: qpath.cpp:261
static Expression::Ptr applyFunctionConversion(const Expression::Ptr &operand, const SequenceType::Ptr &reqType, const StaticContext::Ptr &context, const ReportContext::ErrorCode code=ReportContext::XPTY0004, const Options=Options(AutomaticallyConvert|CheckFocus))
Builds a pipeline of artificial AST nodes that ensures operand conforms to the type reqType by applyi...
bool m_hasCreatedSorter
Definition: qpath_p.h:154
const Kind m_kind
Definition: qpath_p.h:163
static Expression::Ptr wrapAround(const Expression::Ptr &operand, const StaticContext::Ptr &context)
Definition: qnodesort.cpp:92
virtual void announceFocusType(const ItemType::Ptr &itemType)

Properties

◆ m_checkXPTY0018

bool QPatternist::Path::m_checkXPTY0018
private

Definition at line 162 of file qpath_p.h.

Referenced by compress(), and evaluateSequence().

◆ m_hasCreatedSorter

bool QPatternist::Path::m_hasCreatedSorter
private

One might think this block exists for preventing multiple NodeSortExpressions to be created. However, that is not an issue, since NodeSortExpression optimizes this away anyway.

The real reason is to avoid infinite recursion. When our typeCheck() forwards on the type check to the just created NodeSortExpression, it in turn calls typeCheck() on its child, which is this Path. Rince and repeat.

We only create node sorts when we're a regular path expression, and not when standing in as a generic map expression.

Definition at line 154 of file qpath_p.h.

Referenced by typeCheck().

◆ m_isLast

bool QPatternist::Path::m_isLast
private

Whether this path is the step. For instance, in a/b/c, the last path has c as the right operand.

Definition at line 160 of file qpath_p.h.

Referenced by compress(), and setLast().

◆ m_kind

const Kind QPatternist::Path::m_kind
private

Definition at line 163 of file qpath_p.h.

Referenced by compress(), expectedOperandTypes(), kind(), and typeCheck().


The documentation for this class was generated from the following files: