Lines Matching refs:node

32 void PrettyPrinter::VisitBlock(Block* node) {
33 if (!node->is_initializer_block()) Print("{ ");
34 PrintStatements(node->statements());
35 if (node->statements()->length() > 0) Print(" ");
36 if (!node->is_initializer_block()) Print("}");
40 void PrettyPrinter::VisitVariableDeclaration(VariableDeclaration* node) {
42 PrintLiteral(node->proxy()->name(), false);
47 void PrettyPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {
49 PrintLiteral(node->proxy()->name(), false);
51 PrintFunctionLiteral(node->fun());
56 void PrettyPrinter::VisitModuleDeclaration(ModuleDeclaration* node) {
58 PrintLiteral(node->proxy()->name(), false);
60 Visit(node->module());
65 void PrettyPrinter::VisitImportDeclaration(ImportDeclaration* node) {
67 PrintLiteral(node->proxy()->name(), false);
69 Visit(node->module());
74 void PrettyPrinter::VisitExportDeclaration(ExportDeclaration* node) {
76 PrintLiteral(node->proxy()->name(), false);
81 void PrettyPrinter::VisitModuleLiteral(ModuleLiteral* node) {
82 VisitBlock(node->body());
86 void PrettyPrinter::VisitModuleVariable(ModuleVariable* node) {
87 Visit(node->proxy());
91 void PrettyPrinter::VisitModulePath(ModulePath* node) {
92 Visit(node->module());
94 PrintLiteral(node->name(), false);
98 void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) {
100 PrintLiteral(node->url(), true);
104 void PrettyPrinter::VisitModuleStatement(ModuleStatement* node) {
106 PrintLiteral(node->proxy()->name(), false);
108 Visit(node->body());
112 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) {
113 Visit(node->expression());
118 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) {
123 void PrettyPrinter::VisitIfStatement(IfStatement* node) {
125 Visit(node->condition());
127 Visit(node->then_statement());
128 if (node->HasElseStatement()) {
130 Visit(node->else_statement());
135 void PrettyPrinter::VisitContinueStatement(ContinueStatement* node) {
137 ZoneList<const AstRawString*>* labels = node->target()->labels();
147 void PrettyPrinter::VisitBreakStatement(BreakStatement* node) {
149 ZoneList<const AstRawString*>* labels = node->target()->labels();
159 void PrettyPrinter::VisitReturnStatement(ReturnStatement* node) {
161 Visit(node->expression());
166 void PrettyPrinter::VisitWithStatement(WithStatement* node) {
168 Visit(node->expression());
170 Visit(node->statement());
174 void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) {
175 PrintLabels(node->labels());
177 Visit(node->tag());
179 ZoneList<CaseClause*>* cases = node->cases();
200 void PrettyPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
201 PrintLabels(node->labels());
203 Visit(node->body());
205 Visit(node->cond());
210 void PrettyPrinter::VisitWhileStatement(WhileStatement* node) {
211 PrintLabels(node->labels());
213 Visit(node->cond());
215 Visit(node->body());
219 void PrettyPrinter::VisitForStatement(ForStatement* node) {
220 PrintLabels(node->labels());
222 if (node->init() != NULL) {
223 Visit(node->init());
228 if (node->cond() != NULL) Visit(node->cond());
230 if (node->next() != NULL) {
231 Visit(node->next()); // prints extra ';', unfortunately
235 Visit(node->body());
239 void PrettyPrinter::VisitForInStatement(ForInStatement* node) {
240 PrintLabels(node->labels());
242 Visit(node->each());
244 Visit(node->enumerable());
246 Visit(node->body());
250 void PrettyPrinter::VisitForOfStatement(ForOfStatement* node) {
251 PrintLabels(node->labels());
253 Visit(node->each());
255 Visit(node->iterable());
257 Visit(node->body());
261 void PrettyPrinter::VisitTryCatchStatement(TryCatchStatement* node) {
263 Visit(node->try_block());
266 PrintLiteral(node->variable()->name(), quote);
268 Visit(node->catch_block());
272 void PrettyPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) {
274 Visit(node->try_block());
276 Visit(node->finally_block());
280 void PrettyPrinter::VisitDebuggerStatement(DebuggerStatement* node) {
285 void PrettyPrinter::VisitFunctionLiteral(FunctionLiteral* node) {
287 PrintFunctionLiteral(node);
292 void PrettyPrinter::VisitClassLiteral(ClassLiteral* node) {
294 PrintLiteral(node->name(), false);
295 if (node->extends()) {
297 Visit(node->extends());
300 for (int i = 0; i < node->properties()->length(); i++) {
301 PrintObjectLiteralProperty(node->properties()->at(i));
307 void PrettyPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
309 PrintLiteral(node->name(), false);
314 void PrettyPrinter::VisitConditional(Conditional* node) {
315 Visit(node->condition());
317 Visit(node->then_expression());
319 Visit(node->else_expression());
323 void PrettyPrinter::VisitLiteral(Literal* node) {
324 PrintLiteral(node->value(), true);
328 void PrettyPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
330 PrintLiteral(node->pattern(), false);
332 PrintLiteral(node->flags(), false);
337 void PrettyPrinter::VisitObjectLiteral(ObjectLiteral* node) {
339 for (int i = 0; i < node->properties()->length(); i++) {
341 PrintObjectLiteralProperty(node->properties()->at(i));
357 void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) {
359 for (int i = 0; i < node->values()->length(); i++) {
361 Visit(node->values()->at(i));
367 void PrettyPrinter::VisitVariableProxy(VariableProxy* node) {
368 PrintLiteral(node->name(), false);
372 void PrettyPrinter::VisitAssignment(Assignment* node) {
373 Visit(node->target());
374 Print(" %s ", Token::String(node->op()));
375 Visit(node->value());
379 void PrettyPrinter::VisitYield(Yield* node) {
381 Visit(node->expression());
385 void PrettyPrinter::VisitThrow(Throw* node) {
387 Visit(node->exception());
391 void PrettyPrinter::VisitProperty(Property* node) {
392 Expression* key = node->key();
396 Visit(node->obj());
400 Visit(node->obj());
408 void PrettyPrinter::VisitCall(Call* node) {
409 Visit(node->expression());
410 PrintArguments(node->arguments());
414 void PrettyPrinter::VisitCallNew(CallNew* node) {
416 Visit(node->expression());
418 PrintArguments(node->arguments());
422 void PrettyPrinter::VisitCallRuntime(CallRuntime* node) {
424 PrintLiteral(node->name(), false);
425 PrintArguments(node->arguments());
429 void PrettyPrinter::VisitUnaryOperation(UnaryOperation* node) {
430 Token::Value op = node->op();
434 Visit(node->expression());
439 void PrettyPrinter::VisitCountOperation(CountOperation* node) {
441 if (node->is_prefix()) Print("%s", Token::String(node->op()));
442 Visit(node->expression());
443 if (node->is_postfix()) Print("%s", Token::String(node->op()));
448 void PrettyPrinter::VisitBinaryOperation(BinaryOperation* node) {
450 Visit(node->left());
451 Print(" %s ", Token::String(node->op()));
452 Visit(node->right());
457 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) {
459 Visit(node->left());
460 Print(" %s ", Token::String(node->op()));
461 Visit(node->right());
466 void PrettyPrinter::VisitThisFunction(ThisFunction* node) {
471 void PrettyPrinter::VisitSuperReference(SuperReference* node) {
476 const char* PrettyPrinter::Print(AstNode* node) {
478 Visit(node);
500 void PrettyPrinter::PrintOut(Zone* zone, AstNode* node) {
502 PrintF("%s", printer.Print(node));
719 void AstPrinter::PrintIndentedVisit(const char* s, AstNode* node) {
721 Visit(node);
773 void AstPrinter::VisitBlock(Block* node) {
774 const char* block_txt = node->is_initializer_block() ? "BLOCK INIT" : "BLOCK";
776 PrintStatements(node->statements());
781 void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) {
782 PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()),
783 node->proxy()->var(),
784 node->proxy()->name());
789 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {
791 PrintLiteral(node->proxy()->name(), true);
793 PrintLiteral(node->fun()->name(), false);
798 void AstPrinter::VisitModuleDeclaration(ModuleDeclaration* node) {
800 PrintLiteralIndented("NAME", node->proxy()->name(), true);
801 Visit(node->module());
805 void AstPrinter::VisitImportDeclaration(ImportDeclaration* node) {
807 PrintLiteralIndented("NAME", node->proxy()->name(), true);
808 Visit(node->module());
812 void AstPrinter::VisitExportDeclaration(ExportDeclaration* node) {
814 PrintLiteral(node->proxy()->name(), true);
818 void AstPrinter::VisitModuleLiteral(ModuleLiteral* node) {
820 VisitBlock(node->body());
824 void AstPrinter::VisitModuleVariable(ModuleVariable* node) {
826 Visit(node->proxy());
830 void AstPrinter::VisitModulePath(ModulePath* node) {
832 PrintIndentedVisit("MODULE PATH PARENT", node->module());
833 PrintLiteralIndented("NAME", node->name(), true);
837 void AstPrinter::VisitModuleUrl(ModuleUrl* node) {
838 PrintLiteralIndented("URL", node->url(), true);
842 void AstPrinter::VisitModuleStatement(ModuleStatement* node) {
844 PrintLiteralIndented("NAME", node->proxy()->name(), true);
845 PrintStatements(node->body()->statements());
849 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) {
851 Visit(node->expression());
855 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) {
860 void AstPrinter::VisitIfStatement(IfStatement* node) {
862 PrintIndentedVisit("CONDITION", node->condition());
863 PrintIndentedVisit("THEN", node->then_statement());
864 if (node->HasElseStatement()) {
865 PrintIndentedVisit("ELSE", node->else_statement());
870 void AstPrinter::VisitContinueStatement(ContinueStatement* node) {
872 PrintLabelsIndented(node->target()->labels());
876 void AstPrinter::VisitBreakStatement(BreakStatement* node) {
878 PrintLabelsIndented(node->target()->labels());
882 void AstPrinter::VisitReturnStatement(ReturnStatement* node) {
884 Visit(node->expression());
888 void AstPrinter::VisitWithStatement(WithStatement* node) {
890 PrintIndentedVisit("OBJECT", node->expression());
891 PrintIndentedVisit("BODY", node->statement());
895 void AstPrinter::VisitSwitchStatement(SwitchStatement* node) {
897 PrintLabelsIndented(node->labels());
898 PrintIndentedVisit("TAG", node->tag());
899 for (int i = 0; i < node->cases()->length(); i++) {
900 Visit(node->cases()->at(i));
917 void AstPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
919 PrintLabelsIndented(node->labels());
920 PrintIndentedVisit("BODY", node->body());
921 PrintIndentedVisit("COND", node->cond());
925 void AstPrinter::VisitWhileStatement(WhileStatement* node) {
927 PrintLabelsIndented(node->labels());
928 PrintIndentedVisit("COND", node->cond());
929 PrintIndentedVisit("BODY", node->body());
933 void AstPrinter::VisitForStatement(ForStatement* node) {
935 PrintLabelsIndented(node->labels());
936 if (node->init()) PrintIndentedVisit("INIT", node->init());
937 if (node->cond()) PrintIndentedVisit("COND", node->cond());
938 PrintIndentedVisit("BODY", node->body());
939 if (node->next()) PrintIndentedVisit("NEXT", node->next());
943 void AstPrinter::VisitForInStatement(ForInStatement* node) {
945 PrintIndentedVisit("FOR", node->each());
946 PrintIndentedVisit("IN", node->enumerable());
947 PrintIndentedVisit("BODY", node->body());
951 void AstPrinter::VisitForOfStatement(ForOfStatement* node) {
953 PrintIndentedVisit("FOR", node->each());
954 PrintIndentedVisit("OF", node->iterable());
955 PrintIndentedVisit("BODY", node->body());
959 void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) {
961 PrintIndentedVisit("TRY", node->try_block());
963 node->variable(),
964 node->variable()->name());
965 PrintIndentedVisit("CATCH", node->catch_block());
969 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) {
971 PrintIndentedVisit("TRY", node->try_block());
972 PrintIndentedVisit("FINALLY", node->finally_block());
976 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) {
981 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) {
983 PrintLiteralIndented("NAME", node->name(), false);
984 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false);
985 PrintParameters(node->scope());
989 // PrintStatements(node->body());
993 void AstPrinter::VisitClassLiteral(ClassLiteral* node) {
995 PrintLiteralIndented("NAME", node->name(), false);
999 void AstPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
1001 PrintLiteralIndented("NAME", node->name(), false);
1005 void AstPrinter::VisitConditional(Conditional* node) {
1007 PrintIndentedVisit("CONDITION", node->condition());
1008 PrintIndentedVisit("THEN", node->then_expression());
1009 PrintIndentedVisit("ELSE", node->else_expression());
1014 void AstPrinter::VisitLiteral(Literal* node) {
1015 PrintLiteralIndented("LITERAL", node->value(), true);
1019 void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
1021 PrintLiteralIndented("PATTERN", node->pattern(), false);
1022 PrintLiteralIndented("FLAGS", node->flags(), false);
1026 void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) {
1028 for (int i = 0; i < node->properties()->length(); i++) {
1030 switch (node->properties()->at(i)->kind()) {
1053 PrintIndentedVisit("KEY", node->properties()->at(i)->key());
1054 PrintIndentedVisit("VALUE", node->properties()->at(i)->value());
1059 void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
1061 if (node->values()->length() > 0) {
1063 for (int i = 0; i < node->values()->length(); i++) {
1064 Visit(node->values()->at(i));
1071 void AstPrinter::VisitVariableProxy(VariableProxy* node) {
1072 Variable* var = node->var();
1091 PrintLiteralWithModeIndented(buf.start(), var, node->name());
1095 void AstPrinter::VisitAssignment(Assignment* node) {
1096 IndentedScope indent(this, Token::Name(node->op()));
1097 Visit(node->target());
1098 Visit(node->value());
1102 void AstPrinter::VisitYield(Yield* node) {
1104 Visit(node->expression());
1108 void AstPrinter::VisitThrow(Throw* node) {
1110 Visit(node->exception());
1114 void AstPrinter::VisitProperty(Property* node) {
1116 Visit(node->obj());
1117 Literal* literal = node->key()->AsLiteral();
1121 PrintIndentedVisit("KEY", node->key());
1126 void AstPrinter::VisitCall(Call* node) {
1128 Visit(node->expression());
1129 PrintArguments(node->arguments());
1133 void AstPrinter::VisitCallNew(CallNew* node) {
1135 Visit(node->expression());
1136 PrintArguments(node->arguments());
1140 void AstPrinter::VisitCallRuntime(CallRuntime* node) {
1142 PrintLiteralIndented("NAME", node->name(), false);
1143 PrintArguments(node->arguments());
1147 void AstPrinter::VisitUnaryOperation(UnaryOperation* node) {
1148 IndentedScope indent(this, Token::Name(node->op()));
1149 Visit(node->expression());
1153 void AstPrinter::VisitCountOperation(CountOperation* node) {
1155 SNPrintF(buf, "%s %s", (node->is_prefix() ? "PRE" : "POST"),
1156 Token::Name(node->op()));
1158 Visit(node->expression());
1162 void AstPrinter::VisitBinaryOperation(BinaryOperation* node) {
1163 IndentedScope indent(this, Token::Name(node->op()));
1164 Visit(node->left());
1165 Visit(node->right());
1169 void AstPrinter::VisitCompareOperation(CompareOperation* node) {
1170 IndentedScope indent(this, Token::Name(node->op()));
1171 Visit(node->left());
1172 Visit(node->right());
1176 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1181 void AstPrinter::VisitSuperReference(SuperReference* node) {