5#ifndef V8_AST_PRETTYPRINTER_H_
6#define V8_AST_PRETTYPRINTER_H_
47#define DECLARE_VISIT(type) void Visit##type(type* node);
53 void Print(
const char* str);
54 void Print(DirectHandle<String> str);
56 void Find(AstNode* node,
bool print =
false);
85class AstPrinter final :
public AstVisitor<AstPrinter> {
87 explicit AstPrinter(uintptr_t stack_limit);
92 const char* Print(
AstNode* node);
101#define DECLARE_VISIT(type) void Visit##type(type* node);
106 friend class IndentedScope;
111 void PrintLiteral(
const AstRawString* value,
bool quote);
114 void PrintIndented(
const char* txt);
115 void PrintIndentedVisit(
const char* s,
AstNode* node);
122 void PrintLiteralIndented(
const char* info,
Literal*
literal,
bool quote);
123 void PrintLiteralIndented(
const char* info,
const AstRawString* value,
125 void PrintLiteralIndented(
const char* info,
const AstConsString* value,
127 void PrintLiteralWithModeIndented(
const char* info,
Variable* var,
130 const char* prefix =
"");
131 void PrintObjectProperties(
134 void PrintClassProperties(
136 void PrintClassStaticElements(
139 void inc_indent() { indent_++; }
140 void dec_indent() { indent_--; }
#define DECLARE_VISIT(type)
#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS()
Assignment * destructuring_assignment_
Expression * spread_arg() const
SpreadErrorInArgsHint error_in_spread_args_
IncrementalStringBuilder builder_
void FindArguments(const ZonePtrList< Expression > *arguments)
void PrintLiteral(DirectHandle< Object > value, bool quote)
ObjectLiteralProperty * destructuring_prop_
ErrorHint GetErrorHint() const
Assignment * destructuring_assignment() const
FunctionKind function_kind_
CallPrinter(Isolate *isolate, bool is_user_js, SpreadErrorInArgsHint error_in_spread_args=SpreadErrorInArgsHint::kNoErrorInArgs)
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS()
void Find(AstNode *node, bool print=false)
DirectHandle< String > Print(FunctionLiteral *program, int position)
bool is_async_iterator_error_
void FindStatements(const ZonePtrList< Statement > *statements)
ObjectLiteralProperty * destructuring_prop() const
Comparator::Output * output_
FunctionLiteral * literal
#define PRINTF_FORMAT(format_param, dots_param)