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 "allocation.h" | 8 #include "allocation.h" |
9 #include "ast.h" | 9 #include "ast.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
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(); |
44 const char* Output() const { return output_; } | 44 const char* Output() const { return output_; } |
45 | 45 |
46 virtual void PrintStatements(ZoneList<Statement*>* statements); | 46 virtual void PrintStatements(ZoneList<Statement*>* statements); |
47 void PrintLabels(ZoneStringList* labels); | 47 void PrintLabels(ZoneList<const AstString*>* labels); |
48 virtual void PrintArguments(ZoneList<Expression*>* arguments); | 48 virtual void PrintArguments(ZoneList<Expression*>* arguments); |
49 void PrintLiteral(Handle<Object> value, bool quote); | 49 void PrintLiteral(Handle<Object> value, bool quote); |
| 50 void PrintLiteral(const AstString* value, bool quote); |
50 void PrintParameters(Scope* scope); | 51 void PrintParameters(Scope* scope); |
51 void PrintDeclarations(ZoneList<Declaration*>* declarations); | 52 void PrintDeclarations(ZoneList<Declaration*>* declarations); |
52 void PrintFunctionLiteral(FunctionLiteral* function); | 53 void PrintFunctionLiteral(FunctionLiteral* function); |
53 void PrintCaseClause(CaseClause* clause); | 54 void PrintCaseClause(CaseClause* clause); |
54 | 55 |
55 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 56 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
56 }; | 57 }; |
57 | 58 |
58 | 59 |
59 // Prints the AST structure | 60 // Prints the AST structure |
(...skipping 16 matching lines...) Expand all Loading... |
76 | 77 |
77 void PrintStatements(ZoneList<Statement*>* statements); | 78 void PrintStatements(ZoneList<Statement*>* statements); |
78 void PrintDeclarations(ZoneList<Declaration*>* declarations); | 79 void PrintDeclarations(ZoneList<Declaration*>* declarations); |
79 void PrintParameters(Scope* scope); | 80 void PrintParameters(Scope* scope); |
80 void PrintArguments(ZoneList<Expression*>* arguments); | 81 void PrintArguments(ZoneList<Expression*>* arguments); |
81 void PrintCaseClause(CaseClause* clause); | 82 void PrintCaseClause(CaseClause* clause); |
82 void PrintLiteralIndented(const char* info, Handle<Object> value, bool quote); | 83 void PrintLiteralIndented(const char* info, Handle<Object> value, bool quote); |
83 void PrintLiteralWithModeIndented(const char* info, | 84 void PrintLiteralWithModeIndented(const char* info, |
84 Variable* var, | 85 Variable* var, |
85 Handle<Object> value); | 86 Handle<Object> value); |
86 void PrintLabelsIndented(ZoneStringList* labels); | 87 void PrintLabelsIndented(ZoneList<const AstString*>* labels); |
87 | 88 |
88 void inc_indent() { indent_++; } | 89 void inc_indent() { indent_++; } |
89 void dec_indent() { indent_--; } | 90 void dec_indent() { indent_--; } |
90 | 91 |
91 int indent_; | 92 int indent_; |
92 }; | 93 }; |
93 | 94 |
94 #endif // DEBUG | 95 #endif // DEBUG |
95 | 96 |
96 } } // namespace v8::internal | 97 } } // namespace v8::internal |
97 | 98 |
98 #endif // V8_PRETTYPRINTER_H_ | 99 #endif // V8_PRETTYPRINTER_H_ |
OLD | NEW |