Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: src/ast/prettyprinter.h

Issue 1974623002: Remove AstNode::PrettyPrint, --print-source, and --print-builtin-source (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/prettyprinter.h
diff --git a/src/ast/prettyprinter.h b/src/ast/prettyprinter.h
index bb36c2bd90828d214896f43093c15a0baf619155..de1bbf614ecd0a664fd388b54f2669aff630a042 100644
--- a/src/ast/prettyprinter.h
+++ b/src/ast/prettyprinter.h
@@ -53,15 +53,15 @@ class CallPrinter : public AstVisitor {
#ifdef DEBUG
-class PrettyPrinter: public AstVisitor {
+// Prints the AST structure
+class AstPrinter : public AstVisitor {
public:
- explicit PrettyPrinter(Isolate* isolate);
- virtual ~PrettyPrinter();
+ explicit AstPrinter(Isolate* isolate);
+ virtual ~AstPrinter();
// The following routines print a node into a string.
// The result string is alive as long as the PrettyPrinter is alive.
const char* Print(AstNode* node);
- const char* PrintExpression(FunctionLiteral* program);
const char* PrintProgram(FunctionLiteral* program);
void PRINTF_FORMAT(2, 3) Print(const char* format, ...);
@@ -75,48 +75,13 @@ class PrettyPrinter: public AstVisitor {
#undef DECLARE_VISIT
private:
- Isolate* isolate_;
- char* output_; // output string buffer
- int size_; // output_ size
- int pos_; // current printing position
+ friend class IndentedScope;
- protected:
void Init();
- const char* Output() const { return output_; }
- virtual void PrintStatements(ZoneList<Statement*>* statements);
void PrintLabels(ZoneList<const AstRawString*>* labels);
- virtual void PrintArguments(ZoneList<Expression*>* arguments);
- void PrintLiteral(Handle<Object> value, bool quote);
void PrintLiteral(const AstRawString* value, bool quote);
- void PrintParameters(Scope* scope);
- void PrintDeclarations(ZoneList<Declaration*>* declarations);
- void PrintFunctionLiteral(FunctionLiteral* function);
- void PrintCaseClause(CaseClause* clause);
- void PrintObjectLiteralProperty(ObjectLiteralProperty* property);
-
- DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
-};
-
-
-// Prints the AST structure
-class AstPrinter: public PrettyPrinter {
- public:
- explicit AstPrinter(Isolate* isolate);
- virtual ~AstPrinter();
-
- const char* PrintProgram(FunctionLiteral* program);
-
- // Print a node to stdout.
- static void PrintOut(Isolate* isolate, AstNode* node);
-
- // Individual nodes
-#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
- AST_NODE_LIST(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
- private:
- friend class IndentedScope;
+ void PrintLiteral(Handle<Object> value, bool quote);
void PrintIndented(const char* txt);
void PrintIndentedVisit(const char* s, AstNode* node);
@@ -135,6 +100,12 @@ class AstPrinter: public PrettyPrinter {
void inc_indent() { indent_++; }
void dec_indent() { indent_--; }
+ DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
+
+ Isolate* isolate_;
+ char* output_; // output string buffer
+ int size_; // output_ size
+ int pos_; // current printing position
int indent_;
};
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698