Qt 4.8
|
A reference to a variable declared with declare variable
or let
.
More...
#include <qexpressionvariablereference_p.h>
Properties | |
const VariableDeclaration * | m_varDecl |
A reference to a variable declared with declare variable
or let
.
It's also used by variable bindings in case
branches of the typeswitch
expression.
This AST node is only used up until the typeCheck() stage. Therefore it has no functions for evaluation, such as evaluateSequence().
Definition at line 76 of file qexpressionvariablereference_p.h.
ExpressionVariableReference::ExpressionVariableReference | ( | const VariableSlotID | slot, |
const VariableDeclaration * | varDecl | ||
) |
Definition at line 49 of file qexpressionvariablereference.cpp.
|
virtual |
Implements QPatternist::Expression.
Definition at line 83 of file qexpressionvariablereference.cpp.
|
virtual |
Determines the Effective Boolean Value of the expression.
The Effective Boolean Value of a value is not necessarily the same as converting the value to a new value of type xs:boolean.
Note that this function cannot return the empty sequence, evaluateSingleton() must be overridden in order to be able to do that.
The default implementation results in a type error. Hence, this function must be overridden if such behavior is not of interest.
Reimplemented from QPatternist::Expression.
Definition at line 55 of file qexpressionvariablereference.cpp.
|
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().
Reimplemented from QPatternist::Expression.
Definition at line 65 of file qexpressionvariablereference.cpp.
|
virtual |
Reimplemented from QPatternist::Expression.
Definition at line 60 of file qexpressionvariablereference.cpp.
|
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.
Reimplemented from QPatternist::Expression.
Definition at line 78 of file qexpressionvariablereference.cpp.
|
inline |
Definition at line 98 of file qexpressionvariablereference_p.h.
Referenced by QPatternist::checkVariableCircularity().
|
virtual |
Implements QPatternist::Expression.
Definition at line 88 of file qexpressionvariablereference.cpp.
|
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::Expression.
Definition at line 69 of file qexpressionvariablereference.cpp.
|
inline |
Definition at line 103 of file qexpressionvariablereference_p.h.
Referenced by QPatternist::checkVariableCircularity().
|
private |
Definition at line 95 of file qexpressionvariablereference_p.h.
Referenced by sourceExpression(), staticType(), typeCheck(), and variableDeclaration().