Qt 4.8
|
Base class for the implementations of the fn:avg()
and fn:sum()
function.
More...
#include <qaggregatefns_p.h>
Protected Variables | |
AtomicMathematician::Ptr | m_mather |
Protected Variables inherited from QPatternist::UnlimitedContainer | |
Expression::List | m_operands |
Base class for the implementations of the fn:avg()
and fn:sum()
function.
Definition at line 108 of file qaggregatefns_p.h.
|
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.
context | supplies 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. |
reqType | the static type that this Expression must match when evaluated. reqType is guaranteed by the caller to never null. |
reqType
Reimplemented from QPatternist::FunctionCall.
Reimplemented in QPatternist::SumFN, and QPatternist::AvgFN.
Definition at line 98 of file qaggregatefns.cpp.
Referenced by QPatternist::SumFN::typeCheck().
|
protected |
Definition at line 114 of file qaggregatefns_p.h.