| 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_AST_PRETTYPRINTER_H_ | 5 #ifndef V8_AST_PRETTYPRINTER_H_ |
| 6 #define V8_AST_PRETTYPRINTER_H_ | 6 #define V8_AST_PRETTYPRINTER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void Init(); | 79 void Init(); |
| 80 | 80 |
| 81 void PrintLabels(ZoneList<const AstRawString*>* labels); | 81 void PrintLabels(ZoneList<const AstRawString*>* labels); |
| 82 void PrintLiteral(const AstRawString* value, bool quote); | 82 void PrintLiteral(const AstRawString* value, bool quote); |
| 83 void PrintLiteral(Handle<Object> value, bool quote); | 83 void PrintLiteral(Handle<Object> value, bool quote); |
| 84 void PrintIndented(const char* txt); | 84 void PrintIndented(const char* txt); |
| 85 void PrintIndentedVisit(const char* s, AstNode* node); | 85 void PrintIndentedVisit(const char* s, AstNode* node); |
| 86 | 86 |
| 87 void PrintStatements(ZoneList<Statement*>* statements); | 87 void PrintStatements(ZoneList<Statement*>* statements); |
| 88 void PrintDeclarations(ZoneList<Declaration*>* declarations); | 88 void PrintDeclarations(ZoneList<Declaration*>* declarations); |
| 89 void PrintParameters(Scope* scope); | 89 void PrintParameters(DeclarationScope* scope); |
| 90 void PrintArguments(ZoneList<Expression*>* arguments); | 90 void PrintArguments(ZoneList<Expression*>* arguments); |
| 91 void PrintCaseClause(CaseClause* clause); | 91 void PrintCaseClause(CaseClause* clause); |
| 92 void PrintLiteralIndented(const char* info, Handle<Object> value, bool quote); | 92 void PrintLiteralIndented(const char* info, Handle<Object> value, bool quote); |
| 93 void PrintLiteralWithModeIndented(const char* info, | 93 void PrintLiteralWithModeIndented(const char* info, |
| 94 Variable* var, | 94 Variable* var, |
| 95 Handle<Object> value); | 95 Handle<Object> value); |
| 96 void PrintLabelsIndented(ZoneList<const AstRawString*>* labels); | 96 void PrintLabelsIndented(ZoneList<const AstRawString*>* labels); |
| 97 void PrintProperties(ZoneList<ObjectLiteral::Property*>* properties); | 97 void PrintProperties(ZoneList<ObjectLiteral::Property*>* properties); |
| 98 void PrintTryStatement(TryStatement* try_statement); | 98 void PrintTryStatement(TryStatement* try_statement); |
| 99 | 99 |
| 100 void inc_indent() { indent_++; } | 100 void inc_indent() { indent_++; } |
| 101 void dec_indent() { indent_--; } | 101 void dec_indent() { indent_--; } |
| 102 | 102 |
| 103 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 103 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
| 104 | 104 |
| 105 Isolate* isolate_; | 105 Isolate* isolate_; |
| 106 char* output_; // output string buffer | 106 char* output_; // output string buffer |
| 107 int size_; // output_ size | 107 int size_; // output_ size |
| 108 int pos_; // current printing position | 108 int pos_; // current printing position |
| 109 int indent_; | 109 int indent_; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif // DEBUG | 112 #endif // DEBUG |
| 113 | 113 |
| 114 } // namespace internal | 114 } // namespace internal |
| 115 } // namespace v8 | 115 } // namespace v8 |
| 116 | 116 |
| 117 #endif // V8_AST_PRETTYPRINTER_H_ | 117 #endif // V8_AST_PRETTYPRINTER_H_ |
| OLD | NEW |