OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PRETTYPRINTER_H_ | 5 #ifndef V8_PRETTYPRINTER_H_ |
6 #define V8_PRETTYPRINTER_H_ | 6 #define V8_PRETTYPRINTER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 const char* Print(AstNode* node); | 23 const char* Print(AstNode* node); |
24 const char* PrintExpression(FunctionLiteral* program); | 24 const char* PrintExpression(FunctionLiteral* program); |
25 const char* PrintProgram(FunctionLiteral* program); | 25 const char* PrintProgram(FunctionLiteral* program); |
26 | 26 |
27 void Print(const char* format, ...); | 27 void Print(const char* format, ...); |
28 | 28 |
29 // Print a node to stdout. | 29 // Print a node to stdout. |
30 static void PrintOut(Zone* zone, AstNode* node); | 30 static void PrintOut(Zone* zone, AstNode* node); |
31 | 31 |
32 // Individual nodes | 32 // Individual nodes |
33 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 33 #define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE; |
34 AST_NODE_LIST(DECLARE_VISIT) | 34 AST_NODE_LIST(DECLARE_VISIT) |
35 #undef DECLARE_VISIT | 35 #undef DECLARE_VISIT |
36 | 36 |
37 private: | 37 private: |
38 char* output_; // output string buffer | 38 char* output_; // output string buffer |
39 int size_; // output_ size | 39 int size_; // output_ size |
40 int pos_; // current printing position | 40 int pos_; // current printing position |
41 | 41 |
42 protected: | 42 protected: |
43 void Init(); | 43 void Init(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void dec_indent() { indent_--; } | 91 void dec_indent() { indent_--; } |
92 | 92 |
93 int indent_; | 93 int indent_; |
94 }; | 94 }; |
95 | 95 |
96 #endif // DEBUG | 96 #endif // DEBUG |
97 | 97 |
98 } } // namespace v8::internal | 98 } } // namespace v8::internal |
99 | 99 |
100 #endif // V8_PRETTYPRINTER_H_ | 100 #endif // V8_PRETTYPRINTER_H_ |
OLD | NEW |