forked from qt-creator/qt-creator
Incorporated change 4a1c0db988c87b4b4922e5a2607adadd633d99a1 from kinetic-declarativeui.
Added a utility method to get a casted AST root node. Reviewed-by: Christian Kamm
This commit is contained in:
committed by
Tim Jenssen
parent
a704b974b5
commit
d19418f4d8
@@ -296,6 +296,14 @@ public:
|
|||||||
return program->uiObjectMemberCast();
|
return program->uiObjectMemberCast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AST::SourceElement *sourceElement() const
|
||||||
|
{
|
||||||
|
if (! program)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return program->sourceElementCast();
|
||||||
|
}
|
||||||
|
|
||||||
QList<DiagnosticMessage> diagnosticMessages() const
|
QList<DiagnosticMessage> diagnosticMessages() const
|
||||||
{ return diagnostic_messages; }
|
{ return diagnostic_messages; }
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ UiObjectMember *Node::uiObjectMemberCast()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SourceElement *Node::sourceElementCast()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ExpressionNode *ExpressionNode::expressionCast()
|
ExpressionNode *ExpressionNode::expressionCast()
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
@@ -772,6 +777,11 @@ void SourceElements::accept0(Visitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SourceElement *SourceElement::sourceElementCast()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
void FunctionSourceElement::accept0(Visitor *visitor)
|
void FunctionSourceElement::accept0(Visitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ public:
|
|||||||
virtual BinaryExpression *binaryExpressionCast();
|
virtual BinaryExpression *binaryExpressionCast();
|
||||||
virtual Statement *statementCast();
|
virtual Statement *statementCast();
|
||||||
virtual UiObjectMember *uiObjectMemberCast();
|
virtual UiObjectMember *uiObjectMemberCast();
|
||||||
|
virtual SourceElement *sourceElementCast();
|
||||||
|
|
||||||
void accept(Visitor *visitor);
|
void accept(Visitor *visitor);
|
||||||
static void accept(Node *node, Visitor *visitor);
|
static void accept(Node *node, Visitor *visitor);
|
||||||
@@ -2164,6 +2165,8 @@ public:
|
|||||||
{ kind = K; }
|
{ kind = K; }
|
||||||
|
|
||||||
virtual ~SourceElement() {}
|
virtual ~SourceElement() {}
|
||||||
|
|
||||||
|
virtual SourceElement *sourceElementCast();
|
||||||
};
|
};
|
||||||
|
|
||||||
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
|
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
|
||||||
|
|||||||
@@ -162,6 +162,14 @@ public:
|
|||||||
return program->uiObjectMemberCast();
|
return program->uiObjectMemberCast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AST::SourceElement *sourceElement() const
|
||||||
|
{
|
||||||
|
if (! program)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return program->sourceElementCast();
|
||||||
|
}
|
||||||
|
|
||||||
QList<DiagnosticMessage> diagnosticMessages() const
|
QList<DiagnosticMessage> diagnosticMessages() const
|
||||||
{ return diagnostic_messages; }
|
{ return diagnostic_messages; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user