Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: runtime/vm/ast_printer.h

Issue 293013005: Fix issue 18435 (2nd attempt). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/ast_printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_PRINTER_H_ 5 #ifndef VM_AST_PRINTER_H_
6 #define VM_AST_PRINTER_H_ 6 #define VM_AST_PRINTER_H_
7 7
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 // Forward declaration. 13 // Forward declaration.
14 class ParsedFunction; 14 class ParsedFunction;
15 15
16 class AstPrinter : public AstNodeVisitor { 16 class AstPrinter : public AstNodeVisitor {
17 public: 17 public:
18 static void PrintNode(AstNode* node); 18 static void PrintNode(AstNode* node);
19 static void PrintFunctionScope(const ParsedFunction& parsed_function); 19 static void PrintFunctionScope(const ParsedFunction& parsed_function);
20 static void PrintFunctionNodes(const ParsedFunction& parsed_function); 20 static void PrintFunctionNodes(const ParsedFunction& parsed_function);
21 static void PrintLocalScope(const LocalScope* scope, int variable_index);
22
23 21
24 #define DECLARE_VISITOR_FUNCTION(BaseName) \ 22 #define DECLARE_VISITOR_FUNCTION(BaseName) \
25 virtual void Visit##BaseName##Node(BaseName##Node* node); 23 virtual void Visit##BaseName##Node(BaseName##Node* node);
26 24
27 FOR_EACH_NODE(DECLARE_VISITOR_FUNCTION) 25 FOR_EACH_NODE(DECLARE_VISITOR_FUNCTION)
28 #undef DECLARE_VISITOR_FUNCTION 26 #undef DECLARE_VISITOR_FUNCTION
29 27
30 private: 28 private:
31 AstPrinter(); 29 AstPrinter();
32 ~AstPrinter(); 30 ~AstPrinter();
33 31
32 static void PrintLocalScopeVariable(const LocalScope* scope,
33 LocalVariable* var);
34 static void PrintLocalScope(const LocalScope* scope, int variable_index);
35
34 void VisitGenericAstNode(AstNode* node); 36 void VisitGenericAstNode(AstNode* node);
35 void VisitGenericLocalNode(AstNode* node, const LocalVariable& local); 37 void VisitGenericLocalNode(AstNode* node, const LocalVariable& local);
36 void VisitGenericFieldNode(AstNode* node, const Field& field); 38 void VisitGenericFieldNode(AstNode* node, const Field& field);
37 39
38 DISALLOW_COPY_AND_ASSIGN(AstPrinter); 40 DISALLOW_COPY_AND_ASSIGN(AstPrinter);
39 }; 41 };
40 42
41 } // namespace dart 43 } // namespace dart
42 44
43 #endif // VM_AST_PRINTER_H_ 45 #endif // VM_AST_PRINTER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/ast_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698