| Index: runtime/vm/ast_printer.h
|
| diff --git a/runtime/vm/ast_printer.h b/runtime/vm/ast_printer.h
|
| index 7c43ef69356d6ef5328baee79ace529be620c2a5..b5ee0bdaae348ef06102ec332826e2dffd3394d2 100644
|
| --- a/runtime/vm/ast_printer.h
|
| +++ b/runtime/vm/ast_printer.h
|
| @@ -12,12 +12,16 @@ namespace dart {
|
|
|
| // Forward declaration.
|
| class ParsedFunction;
|
| +class Log;
|
|
|
| class AstPrinter : public AstNodeVisitor {
|
| public:
|
| - static void PrintNode(AstNode* node);
|
| - static void PrintFunctionScope(const ParsedFunction& parsed_function);
|
| - static void PrintFunctionNodes(const ParsedFunction& parsed_function);
|
| + explicit AstPrinter(bool log = true);
|
| + ~AstPrinter();
|
| +
|
| + void PrintNode(AstNode* node);
|
| + void PrintFunctionScope(const ParsedFunction& parsed_function);
|
| + void PrintFunctionNodes(const ParsedFunction& parsed_function);
|
|
|
| #define DECLARE_VISITOR_FUNCTION(BaseName) \
|
| virtual void Visit##BaseName##Node(BaseName##Node* node);
|
| @@ -26,23 +30,22 @@ class AstPrinter : public AstNodeVisitor {
|
| #undef DECLARE_VISITOR_FUNCTION
|
|
|
| private:
|
| - AstPrinter();
|
| - ~AstPrinter();
|
| -
|
| static const int kScopeIndent = 2;
|
|
|
| - static void PrintLocalScopeVariable(const LocalScope* scope,
|
| - LocalVariable* var,
|
| - int indent = 0);
|
| - static void PrintLocalScope(const LocalScope* scope,
|
| - int variable_index,
|
| - int indent = 0);
|
| + void IndentN(int count);
|
| + void PrintLocalScopeVariable(const LocalScope* scope,
|
| + LocalVariable* var,
|
| + int indent = 0);
|
| + void PrintLocalScope(const LocalScope* scope,
|
| + int variable_index,
|
| + int indent = 0);
|
|
|
| void VisitGenericAstNode(AstNode* node);
|
| void VisitGenericLocalNode(AstNode* node, const LocalVariable& local);
|
| void VisitGenericFieldNode(AstNode* node, const Field& field);
|
|
|
| intptr_t indent_;
|
| + Log* logger_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AstPrinter);
|
| };
|
|
|