Qt 4.8
|
Represents a declared variable. Only used at the compilation stage. More...
#include <qvariabledeclaration_p.h>
Public Types | |
typedef QHash< QXmlName, VariableDeclaration::Ptr > | Hash |
The key is the variable name. More... | |
typedef QList< VariableDeclaration::Ptr > | List |
typedef QExplicitlySharedDataPointer< VariableDeclaration > | Ptr |
typedef QStack< VariableDeclaration::Ptr > | Stack |
enum | Type { RangeVariable, ExpressionVariable, FunctionArgument, PositionalVariable, TemplateParameter, GlobalVariable, ExternalVariable } |
Public Functions | |
const Expression::Ptr & | expression () const |
bool | isUsed () const |
void | setExpression (const Expression::Ptr &expr) |
bool | usedByMany () const |
Returns how many times this variable is used. More... | |
VariableDeclaration (const QXmlName n, const VariableSlotID varSlot, const Type t, const SequenceType::Ptr &seqType) | |
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... | |
Static Public Functions | |
static bool | contains (const VariableDeclaration::List &list, const QXmlName &lookup) |
Returns true if list contains lookup . More... | |
Public Variables | |
bool | canSourceRewrite |
Whether a reference can rewrite itself to expression(). More... | |
const QXmlName | name |
VariableReference::List | references |
const SequenceType::Ptr | sequenceType |
const VariableSlotID | slot |
const Type | type |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Properties | |
Expression::Ptr | m_expression |
Related Functions | |
(Note that these are not member functions.) | |
static QString | formatKeyword (const VariableDeclaration::Ptr &var, const NamePool::Ptr &np) |
Formats var appropriately for display. More... | |
Represents a declared variable. Only used at the compilation stage.
Definition at line 77 of file qvariabledeclaration_p.h.
The key is the variable name.
Definition at line 87 of file qvariabledeclaration_p.h.
Definition at line 82 of file qvariabledeclaration_p.h.
Definition at line 80 of file qvariabledeclaration_p.h.
Definition at line 81 of file qvariabledeclaration_p.h.
Definition at line 89 of file qvariabledeclaration_p.h.
|
inline |
Creates a VariableDeclaration.
sourceExpr
and seqType
may be null
.
Definition at line 117 of file qvariabledeclaration_p.h.
|
static |
Returns true
if list
contains lookup
.
Definition at line 48 of file qvariabledeclaration.cpp.
Referenced by QPatternist::CallTemplate::typeCheck(), usedByMany(), and QPatternist::yyparse().
|
inline |
Definition at line 135 of file qvariabledeclaration_p.h.
Referenced by QPatternist::TemplateParameterReference::sourceExpression(), QPatternist::ExpressionVariableReference::sourceExpression(), QPatternist::ExpressionVariableReference::staticType(), and QPatternist::ExpressionVariableReference::typeCheck().
|
inline |
Definition at line 130 of file qvariabledeclaration_p.h.
|
inline |
Definition at line 140 of file qvariabledeclaration_p.h.
|
inline |
Returns how many times this variable is used.
Definition at line 148 of file qvariabledeclaration_p.h.
|
related |
Formats var
appropriately for display.
Definition at line 189 of file qvariabledeclaration_p.h.
Referenced by QPatternist::AbstractFloatMathematician< isDouble >::calculate(), and QPatternist::ComparisonPlatform< IndexOfIterator, false >::fetchComparator().
bool QPatternist::VariableDeclaration::canSourceRewrite |
Whether a reference can rewrite itself to expression().
The default value is true
.
Definition at line 177 of file qvariabledeclaration_p.h.
Referenced by QPatternist::ExpressionVariableReference::typeCheck().
|
private |
Definition at line 180 of file qvariabledeclaration_p.h.
Referenced by expression(), and setExpression().
const QXmlName QPatternist::VariableDeclaration::name |
VariableReference::List QPatternist::VariableDeclaration::references |
Definition at line 170 of file qvariabledeclaration_p.h.
Referenced by isUsed(), and usedByMany().
const SequenceType::Ptr QPatternist::VariableDeclaration::sequenceType |
The declared type of the variable. What the value might be, depends on the context which VariableDeclaration is used in. Note that sequenceType is hence not in anyway obligated to the type of expression().
Definition at line 169 of file qvariabledeclaration_p.h.
Referenced by QPatternist::TemplateParameterReference::staticType().
const VariableSlotID QPatternist::VariableDeclaration::slot |
Definition at line 160 of file qvariabledeclaration_p.h.
const Type QPatternist::VariableDeclaration::type |
Definition at line 161 of file qvariabledeclaration_p.h.
Referenced by QPatternist::checkVariableCircularity().