| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef RUNTIME_VM_PROGRAM_VISITOR_H_ | |
| 6 #define RUNTIME_VM_PROGRAM_VISITOR_H_ | |
| 7 | |
| 8 #include "vm/allocation.h" | |
| 9 | |
| 10 namespace dart { | |
| 11 | |
| 12 class Function; | |
| 13 class Class; | |
| 14 | |
| 15 template <typename T> | |
| 16 class Visitor : public ValueObject { | |
| 17 public: | |
| 18 virtual ~Visitor() {} | |
| 19 virtual void Visit(const T& obj) = 0; | |
| 20 }; | |
| 21 | |
| 22 typedef Visitor<Function> FunctionVisitor; | |
| 23 typedef Visitor<Class> ClassVisitor; | |
| 24 | |
| 25 class ProgramVisitor : public AllStatic { | |
| 26 public: | |
| 27 static void VisitFunctions(FunctionVisitor* visitor); | |
| 28 static void VisitClasses(ClassVisitor* visitor); | |
| 29 }; | |
| 30 | |
| 31 } // namespace dart | |
| 32 | |
| 33 #endif // RUNTIME_VM_PROGRAM_VISITOR_H_ | |
| OLD | NEW |