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(); | |
79 }; | 77 }; |
80 | 78 |
81 | 79 |
82 // Prints the AST structure | 80 // Prints the AST structure |
83 class AstPrinter: public PrettyPrinter { | 81 class AstPrinter: public PrettyPrinter { |
84 public: | 82 public: |
85 AstPrinter(); | 83 AstPrinter(); |
86 virtual ~AstPrinter(); | 84 virtual ~AstPrinter(); |
87 | 85 |
88 const char* PrintProgram(FunctionLiteral* program); | 86 const char* PrintProgram(FunctionLiteral* program); |
(...skipping 23 matching lines...) Expand all Loading... |
112 void dec_indent() { indent_--; } | 110 void dec_indent() { indent_--; } |
113 | 111 |
114 int indent_; | 112 int indent_; |
115 }; | 113 }; |
116 | 114 |
117 #endif // DEBUG | 115 #endif // DEBUG |
118 | 116 |
119 } } // namespace v8::internal | 117 } } // namespace v8::internal |
120 | 118 |
121 #endif // V8_PRETTYPRINTER_H_ | 119 #endif // V8_PRETTYPRINTER_H_ |
OLD | NEW |