Index: runtime/vm/kernel.cc |
diff --git a/runtime/vm/kernel.cc b/runtime/vm/kernel.cc |
index 726d0d867bffc9c5e6a7901264d79a1149122b6f..de0c95197f76e68e9b2f182af6a14dea242e254f 100644 |
--- a/runtime/vm/kernel.cc |
+++ b/runtime/vm/kernel.cc |
@@ -10,14 +10,6 @@ namespace dart { |
namespace kernel { |
-template <typename T> |
-void VisitList(List<T>* list, Visitor* visitor) { |
- for (int i = 0; i < list->length(); ++i) { |
- (*list)[i]->AcceptVisitor(visitor); |
- } |
-} |
- |
- |
Source::~Source() { |
delete[] uri_; |
delete[] source_code_; |
@@ -36,210 +28,51 @@ Node::~Node() {} |
TreeNode::~TreeNode() {} |
-void TreeNode::AcceptVisitor(Visitor* visitor) { |
- AcceptTreeVisitor(visitor); |
-} |
- |
- |
LinkedNode::~LinkedNode() {} |
Library::~Library() {} |
-void Library::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitLibrary(this); |
-} |
- |
- |
-void Library::VisitChildren(Visitor* visitor) { |
- VisitList(&classes(), visitor); |
- VisitList(&procedures(), visitor); |
- VisitList(&fields(), visitor); |
-} |
- |
- |
Typedef::~Typedef() {} |
-void Typedef::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitTypedef(this); |
-} |
- |
- |
-void Typedef::VisitChildren(Visitor* visitor) { |
- VisitList(&type_parameters(), visitor); |
- type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
Class::~Class() {} |
-void Class::AcceptTreeVisitor(TreeVisitor* visitor) { |
- AcceptClassVisitor(visitor); |
-} |
- |
- |
NormalClass::~NormalClass() {} |
-void NormalClass::AcceptClassVisitor(ClassVisitor* visitor) { |
- visitor->VisitNormalClass(this); |
-} |
- |
- |
-void NormalClass::VisitChildren(Visitor* visitor) { |
- VisitList(&type_parameters(), visitor); |
- if (super_class() != NULL) visitor->VisitInterfaceType(super_class()); |
- VisitList(&implemented_classes(), visitor); |
- VisitList(&constructors(), visitor); |
- VisitList(&procedures(), visitor); |
- VisitList(&fields(), visitor); |
-} |
- |
- |
-MixinClass::~MixinClass() {} |
- |
- |
-void MixinClass::AcceptClassVisitor(ClassVisitor* visitor) { |
- visitor->VisitMixinClass(this); |
-} |
- |
- |
-void MixinClass::VisitChildren(Visitor* visitor) { |
- VisitList(&type_parameters(), visitor); |
- visitor->VisitInterfaceType(first()); |
- visitor->VisitInterfaceType(second()); |
- VisitList(&implemented_classes(), visitor); |
- VisitList(&constructors(), visitor); |
-} |
- |
- |
Member::~Member() {} |
-void Member::AcceptTreeVisitor(TreeVisitor* visitor) { |
- AcceptMemberVisitor(visitor); |
-} |
- |
- |
Field::~Field() {} |
-void Field::AcceptMemberVisitor(MemberVisitor* visitor) { |
- visitor->VisitField(this); |
-} |
- |
- |
-void Field::VisitChildren(Visitor* visitor) { |
- type()->AcceptDartTypeVisitor(visitor); |
- visitor->VisitName(name()); |
- if (initializer() != NULL) initializer()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
Constructor::~Constructor() {} |
-void Constructor::AcceptMemberVisitor(MemberVisitor* visitor) { |
- visitor->VisitConstructor(this); |
-} |
- |
- |
-void Constructor::VisitChildren(Visitor* visitor) { |
- visitor->VisitName(name()); |
- visitor->VisitFunctionNode(function()); |
- VisitList(&initializers(), visitor); |
-} |
- |
- |
Procedure::~Procedure() {} |
-void Procedure::AcceptMemberVisitor(MemberVisitor* visitor) { |
- visitor->VisitProcedure(this); |
-} |
- |
- |
-void Procedure::VisitChildren(Visitor* visitor) { |
- visitor->VisitName(name()); |
- if (function() != NULL) visitor->VisitFunctionNode(function()); |
-} |
- |
- |
Initializer::~Initializer() {} |
-void Initializer::AcceptTreeVisitor(TreeVisitor* visitor) { |
- AcceptInitializerVisitor(visitor); |
-} |
- |
- |
InvalidInitializer::~InvalidInitializer() {} |
-void InvalidInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) { |
- visitor->VisitInvalidInitializer(this); |
-} |
- |
- |
-void InvalidInitializer::VisitChildren(Visitor* visitor) {} |
- |
- |
FieldInitializer::~FieldInitializer() {} |
-void FieldInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) { |
- visitor->VisitFieldInitializer(this); |
-} |
- |
- |
-void FieldInitializer::VisitChildren(Visitor* visitor) { |
- value()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
SuperInitializer::~SuperInitializer() {} |
-void SuperInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) { |
- visitor->VisitSuperInitializer(this); |
-} |
- |
- |
-void SuperInitializer::VisitChildren(Visitor* visitor) { |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
RedirectingInitializer::~RedirectingInitializer() {} |
-void RedirectingInitializer::AcceptInitializerVisitor( |
- InitializerVisitor* visitor) { |
- visitor->VisitRedirectingInitializer(this); |
-} |
- |
- |
-void RedirectingInitializer::VisitChildren(Visitor* visitor) { |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
LocalInitializer::~LocalInitializer() {} |
-void LocalInitializer::AcceptInitializerVisitor(InitializerVisitor* visitor) { |
- visitor->VisitLocalInitializer(this); |
-} |
- |
- |
-void LocalInitializer::VisitChildren(Visitor* visitor) { |
- visitor->VisitVariableDeclaration(variable()); |
-} |
- |
- |
FunctionNode::~FunctionNode() {} |
@@ -251,28 +84,9 @@ void FunctionNode::ReplaceBody(Statement* body) { |
} |
-void FunctionNode::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitFunctionNode(this); |
-} |
- |
- |
-void FunctionNode::VisitChildren(Visitor* visitor) { |
- VisitList(&type_parameters(), visitor); |
- VisitList(&positional_parameters(), visitor); |
- VisitList(&named_parameters(), visitor); |
- if (return_type() != NULL) return_type()->AcceptDartTypeVisitor(visitor); |
- if (body() != NULL) body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
Expression::~Expression() {} |
-void Expression::AcceptTreeVisitor(TreeVisitor* visitor) { |
- AcceptExpressionVisitor(visitor); |
-} |
- |
- |
InvalidExpression::~InvalidExpression() {} |
@@ -281,8 +95,6 @@ void InvalidExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void InvalidExpression::VisitChildren(Visitor* visitor) {} |
- |
VariableGet::~VariableGet() {} |
@@ -292,9 +104,6 @@ void VariableGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VariableGet::VisitChildren(Visitor* visitor) {} |
- |
- |
VariableSet::~VariableSet() {} |
@@ -303,11 +112,6 @@ void VariableSet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VariableSet::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
PropertyGet::~PropertyGet() {} |
@@ -316,12 +120,6 @@ void PropertyGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void PropertyGet::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
- visitor->VisitName(name()); |
-} |
- |
- |
PropertySet::~PropertySet() {} |
@@ -330,13 +128,6 @@ void PropertySet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void PropertySet::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
- visitor->VisitName(name()); |
- value()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
DirectPropertyGet::~DirectPropertyGet() {} |
@@ -345,11 +136,6 @@ void DirectPropertyGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void DirectPropertyGet::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
DirectPropertySet::~DirectPropertySet() {} |
@@ -358,12 +144,6 @@ void DirectPropertySet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void DirectPropertySet::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
- value()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
StaticGet::~StaticGet() {} |
@@ -372,9 +152,6 @@ void StaticGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void StaticGet::VisitChildren(Visitor* visitor) {} |
- |
- |
StaticSet::~StaticSet() {} |
@@ -383,39 +160,12 @@ void StaticSet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void StaticSet::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
Arguments::~Arguments() {} |
-void Arguments::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitArguments(this); |
-} |
- |
- |
-void Arguments::VisitChildren(Visitor* visitor) { |
- VisitList(&types(), visitor); |
- VisitList(&positional(), visitor); |
- VisitList(&named(), visitor); |
-} |
- |
- |
NamedExpression::~NamedExpression() {} |
-void NamedExpression::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitNamedExpression(this); |
-} |
- |
- |
-void NamedExpression::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
MethodInvocation::~MethodInvocation() {} |
@@ -424,13 +174,6 @@ void MethodInvocation::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void MethodInvocation::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
- visitor->VisitName(name()); |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
DirectMethodInvocation::~DirectMethodInvocation() {} |
@@ -440,12 +183,6 @@ void DirectMethodInvocation::AcceptExpressionVisitor( |
} |
-void DirectMethodInvocation::VisitChildren(Visitor* visitor) { |
- receiver()->AcceptExpressionVisitor(visitor); |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
StaticInvocation::~StaticInvocation() {} |
@@ -454,11 +191,6 @@ void StaticInvocation::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void StaticInvocation::VisitChildren(Visitor* visitor) { |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
ConstructorInvocation::~ConstructorInvocation() {} |
@@ -468,11 +200,6 @@ void ConstructorInvocation::AcceptExpressionVisitor( |
} |
-void ConstructorInvocation::VisitChildren(Visitor* visitor) { |
- visitor->VisitArguments(arguments()); |
-} |
- |
- |
Not::~Not() {} |
@@ -481,11 +208,6 @@ void Not::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void Not::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
LogicalExpression::~LogicalExpression() {} |
@@ -494,12 +216,6 @@ void LogicalExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void LogicalExpression::VisitChildren(Visitor* visitor) { |
- left()->AcceptExpressionVisitor(visitor); |
- right()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
ConditionalExpression::~ConditionalExpression() {} |
@@ -509,13 +225,6 @@ void ConditionalExpression::AcceptExpressionVisitor( |
} |
-void ConditionalExpression::VisitChildren(Visitor* visitor) { |
- condition()->AcceptExpressionVisitor(visitor); |
- then()->AcceptExpressionVisitor(visitor); |
- otherwise()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
StringConcatenation::~StringConcatenation() {} |
@@ -524,11 +233,6 @@ void StringConcatenation::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void StringConcatenation::VisitChildren(Visitor* visitor) { |
- VisitList(&expressions(), visitor); |
-} |
- |
- |
IsExpression::~IsExpression() {} |
@@ -537,12 +241,6 @@ void IsExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void IsExpression::VisitChildren(Visitor* visitor) { |
- operand()->AcceptExpressionVisitor(visitor); |
- type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
AsExpression::~AsExpression() {} |
@@ -551,18 +249,9 @@ void AsExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void AsExpression::VisitChildren(Visitor* visitor) { |
- operand()->AcceptExpressionVisitor(visitor); |
- type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
BasicLiteral::~BasicLiteral() {} |
-void BasicLiteral::VisitChildren(Visitor* visitor) {} |
- |
- |
StringLiteral::~StringLiteral() {} |
@@ -619,9 +308,6 @@ void SymbolLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void SymbolLiteral::VisitChildren(Visitor* visitor) {} |
- |
- |
TypeLiteral::~TypeLiteral() {} |
@@ -630,11 +316,6 @@ void TypeLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void TypeLiteral::VisitChildren(Visitor* visitor) { |
- type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
ThisExpression::~ThisExpression() {} |
@@ -643,9 +324,6 @@ void ThisExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void ThisExpression::VisitChildren(Visitor* visitor) {} |
- |
- |
Rethrow::~Rethrow() {} |
@@ -654,9 +332,6 @@ void Rethrow::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void Rethrow::VisitChildren(Visitor* visitor) {} |
- |
- |
Throw::~Throw() {} |
@@ -665,11 +340,6 @@ void Throw::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void Throw::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
ListLiteral::~ListLiteral() {} |
@@ -678,12 +348,6 @@ void ListLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void ListLiteral::VisitChildren(Visitor* visitor) { |
- type()->AcceptDartTypeVisitor(visitor); |
- VisitList(&expressions(), visitor); |
-} |
- |
- |
MapLiteral::~MapLiteral() {} |
@@ -692,27 +356,9 @@ void MapLiteral::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void MapLiteral::VisitChildren(Visitor* visitor) { |
- key_type()->AcceptDartTypeVisitor(visitor); |
- value_type()->AcceptDartTypeVisitor(visitor); |
- VisitList(&entries(), visitor); |
-} |
- |
- |
MapEntry::~MapEntry() {} |
-void MapEntry::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitMapEntry(this); |
-} |
- |
- |
-void MapEntry::VisitChildren(Visitor* visitor) { |
- key()->AcceptExpressionVisitor(visitor); |
- value()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
AwaitExpression::~AwaitExpression() {} |
@@ -721,11 +367,6 @@ void AwaitExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void AwaitExpression::VisitChildren(Visitor* visitor) { |
- operand()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
FunctionExpression::~FunctionExpression() {} |
@@ -734,11 +375,6 @@ void FunctionExpression::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void FunctionExpression::VisitChildren(Visitor* visitor) { |
- visitor->VisitFunctionNode(function()); |
-} |
- |
- |
Let::~Let() {} |
@@ -747,12 +383,6 @@ void Let::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void Let::VisitChildren(Visitor* visitor) { |
- visitor->VisitVariableDeclaration(variable()); |
- body()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
VectorCreation::~VectorCreation() {} |
@@ -761,9 +391,6 @@ void VectorCreation::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VectorCreation::VisitChildren(Visitor* visitor) {} |
- |
- |
VectorGet::~VectorGet() {} |
@@ -772,11 +399,6 @@ void VectorGet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VectorGet::VisitChildren(Visitor* visitor) { |
- vector_expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
VectorSet::~VectorSet() {} |
@@ -785,12 +407,6 @@ void VectorSet::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VectorSet::VisitChildren(Visitor* visitor) { |
- vector_expression()->AcceptExpressionVisitor(visitor); |
- value()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
VectorCopy::~VectorCopy() {} |
@@ -799,11 +415,6 @@ void VectorCopy::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void VectorCopy::VisitChildren(Visitor* visitor) { |
- vector_expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
ClosureCreation::~ClosureCreation() {} |
@@ -812,337 +423,81 @@ void ClosureCreation::AcceptExpressionVisitor(ExpressionVisitor* visitor) { |
} |
-void ClosureCreation::VisitChildren(Visitor* visitor) { |
- context_vector()->AcceptExpressionVisitor(visitor); |
- function_type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
Statement::~Statement() {} |
-void Statement::AcceptTreeVisitor(TreeVisitor* visitor) { |
- AcceptStatementVisitor(visitor); |
-} |
- |
- |
InvalidStatement::~InvalidStatement() {} |
-void InvalidStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitInvalidStatement(this); |
-} |
- |
- |
-void InvalidStatement::VisitChildren(Visitor* visitor) {} |
- |
- |
ExpressionStatement::~ExpressionStatement() {} |
-void ExpressionStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitExpressionStatement(this); |
-} |
- |
- |
-void ExpressionStatement::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
Block::~Block() {} |
-void Block::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitBlock(this); |
-} |
- |
- |
-void Block::VisitChildren(Visitor* visitor) { |
- VisitList(&statements(), visitor); |
-} |
- |
- |
EmptyStatement::~EmptyStatement() {} |
-void EmptyStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitEmptyStatement(this); |
-} |
- |
- |
-void EmptyStatement::VisitChildren(Visitor* visitor) {} |
- |
- |
AssertStatement::~AssertStatement() {} |
-void AssertStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitAssertStatement(this); |
-} |
- |
- |
-void AssertStatement::VisitChildren(Visitor* visitor) { |
- condition()->AcceptExpressionVisitor(visitor); |
- if (message() != NULL) message()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
LabeledStatement::~LabeledStatement() {} |
-void LabeledStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitLabeledStatement(this); |
-} |
- |
- |
-void LabeledStatement::VisitChildren(Visitor* visitor) { |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
BreakStatement::~BreakStatement() {} |
-void BreakStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitBreakStatement(this); |
-} |
- |
- |
-void BreakStatement::VisitChildren(Visitor* visitor) {} |
- |
- |
WhileStatement::~WhileStatement() {} |
-void WhileStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitWhileStatement(this); |
-} |
- |
- |
-void WhileStatement::VisitChildren(Visitor* visitor) { |
- condition()->AcceptExpressionVisitor(visitor); |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
DoStatement::~DoStatement() {} |
-void DoStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitDoStatement(this); |
-} |
- |
- |
-void DoStatement::VisitChildren(Visitor* visitor) { |
- body()->AcceptStatementVisitor(visitor); |
- condition()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
ForStatement::~ForStatement() {} |
-void ForStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitForStatement(this); |
-} |
- |
- |
-void ForStatement::VisitChildren(Visitor* visitor) { |
- VisitList(&variables(), visitor); |
- if (condition() != NULL) condition()->AcceptExpressionVisitor(visitor); |
- VisitList(&updates(), visitor); |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
ForInStatement::~ForInStatement() {} |
-void ForInStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitForInStatement(this); |
-} |
- |
- |
-void ForInStatement::VisitChildren(Visitor* visitor) { |
- visitor->VisitVariableDeclaration(variable()); |
- iterable()->AcceptExpressionVisitor(visitor); |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
SwitchStatement::~SwitchStatement() {} |
-void SwitchStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitSwitchStatement(this); |
-} |
- |
- |
-void SwitchStatement::VisitChildren(Visitor* visitor) { |
- condition()->AcceptExpressionVisitor(visitor); |
- VisitList(&cases(), visitor); |
-} |
- |
- |
SwitchCase::~SwitchCase() {} |
-void SwitchCase::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitSwitchCase(this); |
-} |
- |
- |
-void SwitchCase::VisitChildren(Visitor* visitor) { |
- VisitList(&expressions(), visitor); |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
ContinueSwitchStatement::~ContinueSwitchStatement() {} |
-void ContinueSwitchStatement::AcceptStatementVisitor( |
- StatementVisitor* visitor) { |
- visitor->VisitContinueSwitchStatement(this); |
-} |
- |
- |
-void ContinueSwitchStatement::VisitChildren(Visitor* visitor) {} |
- |
- |
IfStatement::~IfStatement() {} |
-void IfStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitIfStatement(this); |
-} |
- |
- |
-void IfStatement::VisitChildren(Visitor* visitor) { |
- condition()->AcceptExpressionVisitor(visitor); |
- then()->AcceptStatementVisitor(visitor); |
- otherwise()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
ReturnStatement::~ReturnStatement() {} |
-void ReturnStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitReturnStatement(this); |
-} |
- |
- |
-void ReturnStatement::VisitChildren(Visitor* visitor) { |
- if (expression() != NULL) expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
TryCatch::~TryCatch() {} |
-void TryCatch::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitTryCatch(this); |
-} |
- |
- |
-void TryCatch::VisitChildren(Visitor* visitor) { |
- body()->AcceptStatementVisitor(visitor); |
- VisitList(&catches(), visitor); |
-} |
- |
- |
Catch::~Catch() {} |
-void Catch::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitCatch(this); |
-} |
- |
- |
-void Catch::VisitChildren(Visitor* visitor) { |
- if (guard() != NULL) guard()->AcceptDartTypeVisitor(visitor); |
- if (exception() != NULL) visitor->VisitVariableDeclaration(exception()); |
- if (stack_trace() != NULL) visitor->VisitVariableDeclaration(stack_trace()); |
- body()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
TryFinally::~TryFinally() {} |
-void TryFinally::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitTryFinally(this); |
-} |
- |
- |
-void TryFinally::VisitChildren(Visitor* visitor) { |
- body()->AcceptStatementVisitor(visitor); |
- finalizer()->AcceptStatementVisitor(visitor); |
-} |
- |
- |
YieldStatement::~YieldStatement() {} |
-void YieldStatement::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitYieldStatement(this); |
-} |
- |
- |
-void YieldStatement::VisitChildren(Visitor* visitor) { |
- expression()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
VariableDeclaration::~VariableDeclaration() {} |
-void VariableDeclaration::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitVariableDeclaration(this); |
-} |
- |
- |
-void VariableDeclaration::VisitChildren(Visitor* visitor) { |
- if (type() != NULL) type()->AcceptDartTypeVisitor(visitor); |
- if (initializer() != NULL) initializer()->AcceptExpressionVisitor(visitor); |
-} |
- |
- |
FunctionDeclaration::~FunctionDeclaration() {} |
-void FunctionDeclaration::AcceptStatementVisitor(StatementVisitor* visitor) { |
- visitor->VisitFunctionDeclaration(this); |
-} |
- |
- |
-void FunctionDeclaration::VisitChildren(Visitor* visitor) { |
- visitor->VisitVariableDeclaration(variable()); |
- visitor->VisitFunctionNode(function()); |
-} |
- |
- |
Name::~Name() {} |
-void Name::AcceptVisitor(Visitor* visitor) { |
- visitor->VisitName(this); |
-} |
- |
- |
-void Name::VisitChildren(Visitor* visitor) {} |
- |
- |
DartType::~DartType() {} |
-void DartType::AcceptVisitor(Visitor* visitor) { |
- AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
InvalidType::~InvalidType() {} |
@@ -1151,9 +506,6 @@ void InvalidType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void InvalidType::VisitChildren(Visitor* visitor) {} |
- |
- |
DynamicType::~DynamicType() {} |
@@ -1162,9 +514,6 @@ void DynamicType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void DynamicType::VisitChildren(Visitor* visitor) {} |
- |
- |
VoidType::~VoidType() {} |
@@ -1173,9 +522,6 @@ void VoidType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void VoidType::VisitChildren(Visitor* visitor) {} |
- |
- |
BottomType::~BottomType() {} |
@@ -1184,9 +530,6 @@ void BottomType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void BottomType::VisitChildren(Visitor* visitor) {} |
- |
- |
InterfaceType::~InterfaceType() {} |
@@ -1195,11 +538,6 @@ void InterfaceType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void InterfaceType::VisitChildren(Visitor* visitor) { |
- VisitList(&type_arguments(), visitor); |
-} |
- |
- |
TypedefType::~TypedefType() {} |
@@ -1208,11 +546,6 @@ void TypedefType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void TypedefType::VisitChildren(Visitor* visitor) { |
- VisitList(&type_arguments(), visitor); |
-} |
- |
- |
FunctionType::~FunctionType() {} |
@@ -1221,16 +554,6 @@ void FunctionType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void FunctionType::VisitChildren(Visitor* visitor) { |
- VisitList(&type_parameters(), visitor); |
- VisitList(&positional_parameters(), visitor); |
- for (int i = 0; i < named_parameters().length(); ++i) { |
- named_parameters()[i]->type()->AcceptDartTypeVisitor(visitor); |
- } |
- return_type()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
TypeParameterType::~TypeParameterType() {} |
@@ -1239,9 +562,6 @@ void TypeParameterType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void TypeParameterType::VisitChildren(Visitor* visitor) {} |
- |
- |
VectorType::~VectorType() {} |
@@ -1250,22 +570,9 @@ void VectorType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { |
} |
-void VectorType::VisitChildren(Visitor* visitor) {} |
- |
- |
TypeParameter::~TypeParameter() {} |
-void TypeParameter::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitTypeParameter(this); |
-} |
- |
- |
-void TypeParameter::VisitChildren(Visitor* visitor) { |
- bound()->AcceptDartTypeVisitor(visitor); |
-} |
- |
- |
Program::~Program() { |
while (valid_token_positions.length() > 0) { |
delete valid_token_positions.RemoveLast(); |
@@ -1276,16 +583,6 @@ Program::~Program() { |
} |
-void Program::AcceptTreeVisitor(TreeVisitor* visitor) { |
- visitor->VisitProgram(this); |
-} |
- |
- |
-void Program::VisitChildren(Visitor* visitor) { |
- VisitList(&libraries(), visitor); |
-} |
- |
- |
} // namespace kernel |
} // namespace dart |