mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 15:01:29 +00:00
103881d01c
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER This lets us remove a hack from the PRESUBMIT.py script that existed for reasons that are no longer valid, and sets us up to add some presubmit checks for the GN build. R=asiva@google.com, rmacnak@google.com Review URL: https://codereview.chromium.org/2450713004 .
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_VM_AST_PRINTER_H_
|
|
#define RUNTIME_VM_AST_PRINTER_H_
|
|
|
|
#include "vm/ast.h"
|
|
#include "vm/growable_array.h"
|
|
|
|
namespace dart {
|
|
|
|
// Forward declaration.
|
|
class ParsedFunction;
|
|
class Log;
|
|
|
|
class AstPrinter : public AstNodeVisitor {
|
|
public:
|
|
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);
|
|
|
|
FOR_EACH_NODE(DECLARE_VISITOR_FUNCTION)
|
|
#undef DECLARE_VISITOR_FUNCTION
|
|
|
|
private:
|
|
static const int kScopeIndent = 2;
|
|
|
|
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);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_AST_PRINTER_H_
|