Qt 4.8
Public Functions | Protected Functions | Protected Variables | List of all members
QPatternist::PairContainer Class Reference

Base class for expressions that has exactly two operands. More...

#include <qpaircontainer_p.h>

Inheritance diagram for QPatternist::PairContainer:
QPatternist::Expression QSharedData QPatternist::CppCastingHelper< Expression > QPatternist::SourceLocationReflection QPatternist::AndExpression QPatternist::ArithmeticExpression QPatternist::AttributeConstructor QPatternist::CombineNodes QPatternist::ComputedNamespaceConstructor QPatternist::ElementConstructor QPatternist::ForClause QPatternist::GeneralComparison QPatternist::GenericPredicate QPatternist::LetClause QPatternist::NodeComparison QPatternist::Path QPatternist::ProcessingInstructionConstructor QPatternist::QuantifiedExpression QPatternist::RangeExpression QPatternist::ValueComparison

Public Functions

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 ExpressionVisitorResult::Ptr accept (const ExpressionVisitor::Ptr &visitor) const =0
 
virtual const SourceLocationReflectionactualReflection () const
 Returns this. More...
 
virtual void announceFocusType (const ItemType::Ptr &itemType)
 
virtual Expression::Ptr compress (const StaticContext::Ptr &context)
 
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 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 ItemType::Ptr expectedContextItemType () const
 
virtual SequenceType::List expectedOperandTypes () const =0
 
 Expression ()
 
bool has (const Property prop) const
 
bool hasDependency (const Property prop) const
 
virtual ID id () const
 
bool is (const ID id) const
 
bool isEvaluated () const
 
virtual ItemType::Ptr newFocusType () const
 
virtual QList< QExplicitlySharedDataPointer< OptimizationPass > > optimizationPasses () const
 
virtual PatternPriority patternPriority () const
 
virtual Properties properties () const
 
const Expression::Ptrrewrite (const Expression::Ptr &to, const StaticContext::Ptr &context) const
 Rewrites this Expression to to, and return to. More...
 
virtual SequenceType::Ptr staticType () const =0
 
virtual Expression::Ptr typeCheck (const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
 
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 ()
 

Protected Functions

 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

Expression::Ptr m_operand1
 
Expression::Ptr m_operand2
 

Additional Inherited Members

- 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
 
- 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
 

Detailed Description

Base class for expressions that has exactly two operands.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 70 of file qpaircontainer_p.h.

Constructors and Destructors

◆ PairContainer()

PairContainer::PairContainer ( const Expression::Ptr operand1,
const Expression::Ptr operand2 
)
protected

Definition at line 50 of file qpaircontainer.cpp.

51  : m_operand1(operand1),
52  m_operand2(operand2)
53 {
56 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ compressOperands()

bool PairContainer::compressOperands ( const StaticContext::Ptr )
virtual
Returns
true if all operands are constant values of somekind, and are already evaluated. A string literal, is a typical example.

Implements QPatternist::Expression.

Definition at line 75 of file qpaircontainer.cpp.

76 {
79  rewrite(m_operand1, m_operand1->compress(context), context);
80  rewrite(m_operand2, m_operand2->compress(context), context);
81 
83 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
virtual Expression::Ptr compress(const StaticContext::Ptr &context)
static void rewrite(Expression::Ptr &old, const Expression::Ptr &New, const StaticContext::Ptr &context)

◆ operands()

Expression::List PairContainer::operands ( ) const
virtual
Returns
the expression's child expressions. For example, a function's arguments is returned here.

If this Expression has no operands, an empty list should be returned.

Implements QPatternist::Expression.

Definition at line 58 of file qpaircontainer.cpp.

Referenced by QPatternist::ElementConstructor::typeCheck().

59 {
60  Expression::List list;
61  list.append(m_operand1);
62  list.append(m_operand2);
63  return list;
64 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507

◆ setOperands()

void PairContainer::setOperands ( const Expression::List operands)
virtual

Implements QPatternist::Expression.

Definition at line 66 of file qpaircontainer.cpp.

67 {
68  Q_ASSERT(ops.count() == 2);
69  m_operand1 = ops.first();
70  m_operand2 = ops.last();
71  Q_ASSERT(m_operand1);
73 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Properties

◆ m_operand1

Expression::Ptr QPatternist::PairContainer::m_operand1
protected

Definition at line 80 of file qpaircontainer_p.h.

Referenced by QPatternist::LetClause::bindVariable(), QPatternist::OrExpression::compress(), QPatternist::AndExpression::compress(), QPatternist::NodeComparison::compress(), QPatternist::ValueComparison::compress(), QPatternist::GeneralComparison::compress(), QPatternist::Path::compress(), compressOperands(), QPatternist::ProcessingInstructionConstructor::data(), QPatternist::NodeComparison::evaluate(), QPatternist::OrExpression::evaluateEBV(), QPatternist::AndExpression::evaluateEBV(), QPatternist::QuantifiedExpression::evaluateEBV(), QPatternist::GeneralComparison::evaluateEBV(), QPatternist::CombineNodes::evaluateEBV(), QPatternist::RangeExpression::evaluateSequence(), QPatternist::ForClause::evaluateSequence(), QPatternist::CombineNodes::evaluateSequence(), QPatternist::GenericPredicate::evaluateSequence(), QPatternist::Path::evaluateSequence(), QPatternist::AttributeConstructor::evaluateSingleton(), QPatternist::ElementConstructor::evaluateSingleton(), QPatternist::ValueComparison::evaluateSingleton(), QPatternist::ArithmeticExpression::evaluateSingleton(), QPatternist::RangeExpression::evaluateSingleton(), QPatternist::Path::evaluateSingleton(), QPatternist::GenericPredicate::evaluateSingleton(), QPatternist::ProcessingInstructionConstructor::evaluateTardata(), QPatternist::ComputedNamespaceConstructor::evaluateToSequenceReceiver(), QPatternist::AttributeConstructor::evaluateToSequenceReceiver(), QPatternist::ElementConstructor::evaluateToSequenceReceiver(), QPatternist::ForClause::evaluateToSequenceReceiver(), QPatternist::Path::evaluateToSequenceReceiver(), QPatternist::Path::newFocusType(), QPatternist::GenericPredicate::newFocusType(), operands(), PairContainer(), QPatternist::Path::properties(), setOperands(), QPatternist::ArithmeticExpression::staticType(), QPatternist::ForClause::staticType(), QPatternist::CombineNodes::staticType(), QPatternist::RangeExpression::staticType(), QPatternist::ValueComparison::staticType(), QPatternist::NodeComparison::staticType(), QPatternist::GenericPredicate::staticType(), QPatternist::Path::staticType(), QPatternist::ValueComparison::typeCheck(), QPatternist::ForClause::typeCheck(), QPatternist::GeneralComparison::typeCheck(), QPatternist::LetClause::typeCheck(), QPatternist::CombineNodes::typeCheck(), QPatternist::ArithmeticExpression::typeCheck(), and QPatternist::Path::typeCheck().

◆ m_operand2

Expression::Ptr QPatternist::PairContainer::m_operand2
protected

Definition at line 81 of file qpaircontainer_p.h.

Referenced by QPatternist::OrExpression::compress(), QPatternist::AndExpression::compress(), QPatternist::NodeComparison::compress(), QPatternist::ForClause::compress(), QPatternist::ValueComparison::compress(), QPatternist::GeneralComparison::compress(), QPatternist::Path::compress(), compressOperands(), QPatternist::ProcessingInstructionConstructor::data(), QPatternist::NodeComparison::evaluate(), QPatternist::OrExpression::evaluateEBV(), QPatternist::AndExpression::evaluateEBV(), QPatternist::QuantifiedExpression::evaluateEBV(), QPatternist::LetClause::evaluateEBV(), QPatternist::GeneralComparison::evaluateEBV(), QPatternist::CombineNodes::evaluateEBV(), QPatternist::RangeExpression::evaluateSequence(), QPatternist::LetClause::evaluateSequence(), QPatternist::CombineNodes::evaluateSequence(), QPatternist::AttributeConstructor::evaluateSingleton(), QPatternist::ElementConstructor::evaluateSingleton(), QPatternist::ArithmeticExpression::evaluateSingleton(), QPatternist::ValueComparison::evaluateSingleton(), QPatternist::LetClause::evaluateSingleton(), QPatternist::Path::evaluateSingleton(), QPatternist::UnaryExpression::evaluateSingleton(), QPatternist::ComputedNamespaceConstructor::evaluateToSequenceReceiver(), QPatternist::AttributeConstructor::evaluateToSequenceReceiver(), QPatternist::ElementConstructor::evaluateToSequenceReceiver(), QPatternist::ForClause::evaluateToSequenceReceiver(), QPatternist::LetClause::evaluateToSequenceReceiver(), QPatternist::Path::evaluateToSequenceReceiver(), QPatternist::TruthPredicate::map(), QPatternist::TruthPredicate::mapToItem(), QPatternist::ForClause::mapToItem(), QPatternist::GenericPredicate::mapToItem(), QPatternist::ForClause::mapToSequence(), QPatternist::Path::mapToSequence(), operands(), PairContainer(), QPatternist::Path::properties(), setOperands(), QPatternist::ArithmeticExpression::staticType(), QPatternist::ForClause::staticType(), QPatternist::CombineNodes::staticType(), QPatternist::RangeExpression::staticType(), QPatternist::ValueComparison::staticType(), QPatternist::LetClause::staticType(), QPatternist::NodeComparison::staticType(), QPatternist::Path::staticType(), QPatternist::ValueComparison::typeCheck(), QPatternist::GeneralComparison::typeCheck(), QPatternist::LetClause::typeCheck(), QPatternist::ArithmeticExpression::typeCheck(), QPatternist::CombineNodes::typeCheck(), QPatternist::ElementConstructor::typeCheck(), and QPatternist::Path::typeCheck().


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