OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const char* Output() const { return output_; } | 67 const char* Output() const { return output_; } |
68 | 68 |
69 virtual void PrintStatements(ZoneList<Statement*>* statements); | 69 virtual void PrintStatements(ZoneList<Statement*>* statements); |
70 void PrintLabels(ZoneStringList* labels); | 70 void PrintLabels(ZoneStringList* labels); |
71 virtual void PrintArguments(ZoneList<Expression*>* arguments); | 71 virtual void PrintArguments(ZoneList<Expression*>* arguments); |
72 void PrintLiteral(Handle<Object> value, bool quote); | 72 void PrintLiteral(Handle<Object> value, bool quote); |
73 void PrintParameters(Scope* scope); | 73 void PrintParameters(Scope* scope); |
74 void PrintDeclarations(ZoneList<Declaration*>* declarations); | 74 void PrintDeclarations(ZoneList<Declaration*>* declarations); |
75 void PrintFunctionLiteral(FunctionLiteral* function); | 75 void PrintFunctionLiteral(FunctionLiteral* function); |
76 void PrintCaseClause(CaseClause* clause); | 76 void PrintCaseClause(CaseClause* clause); |
| 77 |
| 78 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
77 }; | 79 }; |
78 | 80 |
79 | 81 |
80 // Prints the AST structure | 82 // Prints the AST structure |
81 class AstPrinter: public PrettyPrinter { | 83 class AstPrinter: public PrettyPrinter { |
82 public: | 84 public: |
83 AstPrinter(); | 85 AstPrinter(); |
84 virtual ~AstPrinter(); | 86 virtual ~AstPrinter(); |
85 | 87 |
86 const char* PrintProgram(FunctionLiteral* program); | 88 const char* PrintProgram(FunctionLiteral* program); |
(...skipping 23 matching lines...) Expand all Loading... |
110 void dec_indent() { indent_--; } | 112 void dec_indent() { indent_--; } |
111 | 113 |
112 int indent_; | 114 int indent_; |
113 }; | 115 }; |
114 | 116 |
115 #endif // DEBUG | 117 #endif // DEBUG |
116 | 118 |
117 } } // namespace v8::internal | 119 } } // namespace v8::internal |
118 | 120 |
119 #endif // V8_PRETTYPRINTER_H_ | 121 #endif // V8_PRETTYPRINTER_H_ |
OLD | NEW |