Qt 4.8
|
Implements XPath 2.0's treat as
expression.
More...
#include <qtreatas_p.h>
Properties | |
const SequenceType::Ptr | m_reqType |
Implements XPath 2.0's treat as
expression.
TreatAs is always a compile-time class only, and is always deallocated by re-writing to CardinalityVerifier or ItemVerifier or both, by calling TypeChecker::applyFunctionConversion().
One approach could be to skip instantiating TreatAs and simply let the return value of TypeChecker::applyFunctionConversion() be inserted into the AST, but that wouldn't handle type checking the context item properly, which depends on that the StaticContext have been set by the parent Expression.
Definition at line 82 of file qtreatas_p.h.
TreatAs::TreatAs | ( | const Expression::Ptr & | operand, |
const SequenceType::Ptr & | reqType | ||
) |
Creats a TreatAs where it is checked that the expression operand
conforms to the type reqType
.
Definition at line 51 of file qtreatas.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 75 of file qtreatas.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 85 of file qtreatas.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 80 of file qtreatas.cpp.
|
virtual |
This function rewrites always. First the type that this TreatAs expression tests for is verified. Then, the type the treat as
expression itself must match, reqType
, is verified.
Reimplemented from QPatternist::Expression.
Definition at line 58 of file qtreatas.cpp.
|
private |
Definition at line 114 of file qtreatas_p.h.
Referenced by staticType(), and typeCheck().