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