Changeset 29825 in webkit for trunk/JavaScriptCore/kjs/nodes2string.cpp
- Timestamp:
- Jan 27, 2008, 4:14:24 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes2string.cpp
r29815 r29825 326 326 void ResolveNode::streamTo(SourceStream& s) const 327 327 { 328 s << ident;328 s << m_ident; 329 329 } 330 330 331 331 void ElementNode::streamTo(SourceStream& s) const 332 332 { 333 for (const ElementNode* n = this; n; n = n-> next.get()) {334 for (int i = 0; i < n-> elision; i++)333 for (const ElementNode* n = this; n; n = n->m_next.get()) { 334 for (int i = 0; i < n->m_elision; i++) 335 335 s << ','; 336 s << PrecAssignment << n-> node;337 if (n-> next)336 s << PrecAssignment << n->m_node; 337 if (n->m_next) 338 338 s << ','; 339 339 } … … 342 342 void ArrayNode::streamTo(SourceStream& s) const 343 343 { 344 s << '[' << element;345 for (int i = 0; i < elision; i++)344 s << '[' << m_element; 345 for (int i = 0; i < m_elision; i++) 346 346 s << ','; 347 347 // Parser consumes one elision comma if there's array elements 348 348 // present in the expression. 349 if ( opt &&element)349 if (m_opt && m_element) 350 350 s << ','; 351 351 s << ']'; … … 354 354 void ObjectLiteralNode::streamTo(SourceStream& s) const 355 355 { 356 if ( list)357 s << "{ " << list << " }";356 if (m_list) 357 s << "{ " << m_list << " }"; 358 358 else 359 359 s << "{ }"; … … 362 362 void PropertyListNode::streamTo(SourceStream& s) const 363 363 { 364 s << node;365 for (const PropertyListNode* n = next.get(); n; n = n->next.get())366 s << ", " << n-> node;364 s << m_node; 365 for (const PropertyListNode* n = m_next.get(); n; n = n->m_next.get()) 366 s << ", " << n->m_node; 367 367 } 368 368 369 369 void PropertyNode::streamTo(SourceStream& s) const 370 370 { 371 switch ( type) {371 switch (m_type) { 372 372 case Constant: { 373 373 UString propertyName = name().ustring(); … … 376 376 else 377 377 s << '"' << escapeStringForPrettyPrinting(propertyName) << '"'; 378 s << ": " << PrecAssignment << assign;378 s << ": " << PrecAssignment << m_assign; 379 379 break; 380 380 } 381 381 case Getter: 382 382 case Setter: { 383 const FuncExprNode* func = static_cast<const FuncExprNode*>( assign.get());384 if ( type == Getter)383 const FuncExprNode* func = static_cast<const FuncExprNode*>(m_assign.get()); 384 if (m_type == Getter) 385 385 s << "get "; 386 386 else 387 387 s << "set "; 388 388 s << escapeStringForPrettyPrinting(name().ustring()) 389 << "(" << func-> param << ')' << func->body;389 << "(" << func->m_parameter << ')' << func->m_body; 390 390 break; 391 391 } … … 395 395 void BracketAccessorNode::streamTo(SourceStream& s) const 396 396 { 397 bracketNodeStreamTo(s, expr1, expr2);397 bracketNodeStreamTo(s, m_base, m_subscript); 398 398 } 399 399 400 400 void DotAccessorNode::streamTo(SourceStream& s) const 401 401 { 402 dotNodeStreamTo(s, expr,ident);402 dotNodeStreamTo(s, m_base, m_ident); 403 403 } 404 404 405 405 void ArgumentListNode::streamTo(SourceStream& s) const 406 406 { 407 s << PrecAssignment << expr;408 for (ArgumentListNode* n = next.get(); n; n = n->next.get())409 s << ", " << PrecAssignment << n-> expr;407 s << PrecAssignment << m_expr; 408 for (ArgumentListNode* n = m_next.get(); n; n = n->m_next.get()) 409 s << ", " << PrecAssignment << n->m_expr; 410 410 } 411 411 412 412 void ArgumentsNode::streamTo(SourceStream& s) const 413 413 { 414 s << '(' << listNode << ')';414 s << '(' << m_listNode << ')'; 415 415 } 416 416 417 417 void NewExprNode::streamTo(SourceStream& s) const 418 418 { 419 s << "new " << PrecMember << expr <<args;419 s << "new " << PrecMember << m_expr << m_args; 420 420 } 421 421 422 422 void FunctionCallValueNode::streamTo(SourceStream& s) const 423 423 { 424 s << PrecCall << expr <<args;424 s << PrecCall << m_expr << m_args; 425 425 } 426 426 427 427 void FunctionCallResolveNode::streamTo(SourceStream& s) const 428 428 { 429 s << ident <<args;429 s << m_ident << m_args; 430 430 } 431 431 432 432 void FunctionCallBracketNode::streamTo(SourceStream& s) const 433 433 { 434 bracketNodeStreamTo(s, base,subscript);435 s << args;434 bracketNodeStreamTo(s, m_base, m_subscript); 435 s << m_args; 436 436 } 437 437 438 438 void FunctionCallDotNode::streamTo(SourceStream& s) const 439 439 { 440 dotNodeStreamTo(s, base,ident);441 s << args;440 dotNodeStreamTo(s, m_base, m_ident); 441 s << m_args; 442 442 } 443 443 … … 509 509 void VoidNode::streamTo(SourceStream& s) const 510 510 { 511 s << "void " << PrecUnary << expr;511 s << "void " << PrecUnary << m_expr; 512 512 } 513 513 … … 571 571 void NegateNode::streamTo(SourceStream& s) const 572 572 { 573 s << "- " << PrecUnary << expr;573 s << "- " << PrecUnary << m_expr; 574 574 } 575 575 576 576 void BitwiseNotNode::streamTo(SourceStream& s) const 577 577 { 578 s << "~" << PrecUnary << expr;578 s << "~" << PrecUnary << m_expr; 579 579 } 580 580 581 581 void LogicalNotNode::streamTo(SourceStream& s) const 582 582 { 583 s << "!" << PrecUnary << expr;583 s << "!" << PrecUnary << m_expr; 584 584 } 585 585 586 586 void MultNode::streamTo(SourceStream& s) const 587 587 { 588 streamLeftAssociativeBinaryOperator(s, precedence(), "*", term1,term2);588 streamLeftAssociativeBinaryOperator(s, precedence(), "*", m_term1, m_term2); 589 589 } 590 590 591 591 void DivNode::streamTo(SourceStream& s) const 592 592 { 593 streamLeftAssociativeBinaryOperator(s, precedence(), "/", term1,term2);593 streamLeftAssociativeBinaryOperator(s, precedence(), "/", m_term1, m_term2); 594 594 } 595 595 596 596 void ModNode::streamTo(SourceStream& s) const 597 597 { 598 streamLeftAssociativeBinaryOperator(s, precedence(), "%", term1,term2);598 streamLeftAssociativeBinaryOperator(s, precedence(), "%", m_term1, m_term2); 599 599 } 600 600 601 601 void AddNode::streamTo(SourceStream& s) const 602 602 { 603 streamLeftAssociativeBinaryOperator(s, precedence(), "+", term1,term2);603 streamLeftAssociativeBinaryOperator(s, precedence(), "+", m_term1, m_term2); 604 604 } 605 605 606 606 void SubNode::streamTo(SourceStream& s) const 607 607 { 608 streamLeftAssociativeBinaryOperator(s, precedence(), "-", term1,term2);608 streamLeftAssociativeBinaryOperator(s, precedence(), "-", m_term1, m_term2); 609 609 } 610 610 611 611 void LeftShiftNode::streamTo(SourceStream& s) const 612 612 { 613 streamLeftAssociativeBinaryOperator(s, precedence(), "<<", term1,term2);613 streamLeftAssociativeBinaryOperator(s, precedence(), "<<", m_term1, m_term2); 614 614 } 615 615 616 616 void RightShiftNode::streamTo(SourceStream& s) const 617 617 { 618 streamLeftAssociativeBinaryOperator(s, precedence(), ">>", term1,term2);618 streamLeftAssociativeBinaryOperator(s, precedence(), ">>", m_term1, m_term2); 619 619 } 620 620 621 621 void UnsignedRightShiftNode::streamTo(SourceStream& s) const 622 622 { 623 streamLeftAssociativeBinaryOperator(s, precedence(), ">>>", term1,term2);623 streamLeftAssociativeBinaryOperator(s, precedence(), ">>>", m_term1, m_term2); 624 624 } 625 625 626 626 void LessNode::streamTo(SourceStream& s) const 627 627 { 628 streamLeftAssociativeBinaryOperator(s, precedence(), "<", expr1,expr2);628 streamLeftAssociativeBinaryOperator(s, precedence(), "<", m_expr1, m_expr2); 629 629 } 630 630 631 631 void GreaterNode::streamTo(SourceStream& s) const 632 632 { 633 streamLeftAssociativeBinaryOperator(s, precedence(), ">", expr1,expr2);633 streamLeftAssociativeBinaryOperator(s, precedence(), ">", m_expr1, m_expr2); 634 634 } 635 635 636 636 void LessEqNode::streamTo(SourceStream& s) const 637 637 { 638 streamLeftAssociativeBinaryOperator(s, precedence(), "<=", expr1,expr2);638 streamLeftAssociativeBinaryOperator(s, precedence(), "<=", m_expr1, m_expr2); 639 639 } 640 640 641 641 void GreaterEqNode::streamTo(SourceStream& s) const 642 642 { 643 streamLeftAssociativeBinaryOperator(s, precedence(), ">=", expr1,expr2);643 streamLeftAssociativeBinaryOperator(s, precedence(), ">=", m_expr1, m_expr2); 644 644 } 645 645 646 646 void InstanceOfNode::streamTo(SourceStream& s) const 647 647 { 648 streamLeftAssociativeBinaryOperator(s, precedence(), "instanceof", expr1,expr2);648 streamLeftAssociativeBinaryOperator(s, precedence(), "instanceof", m_expr1, m_expr2); 649 649 } 650 650 651 651 void InNode::streamTo(SourceStream& s) const 652 652 { 653 streamLeftAssociativeBinaryOperator(s, precedence(), "in", expr1,expr2);653 streamLeftAssociativeBinaryOperator(s, precedence(), "in", m_expr1, m_expr2); 654 654 } 655 655 656 656 void EqualNode::streamTo(SourceStream& s) const 657 657 { 658 streamLeftAssociativeBinaryOperator(s, precedence(), "==", expr1,expr2);658 streamLeftAssociativeBinaryOperator(s, precedence(), "==", m_expr1, m_expr2); 659 659 } 660 660 661 661 void NotEqualNode::streamTo(SourceStream& s) const 662 662 { 663 streamLeftAssociativeBinaryOperator(s, precedence(), "!=", expr1,expr2);663 streamLeftAssociativeBinaryOperator(s, precedence(), "!=", m_expr1, m_expr2); 664 664 } 665 665 666 666 void StrictEqualNode::streamTo(SourceStream& s) const 667 667 { 668 streamLeftAssociativeBinaryOperator(s, precedence(), "===", expr1,expr2);668 streamLeftAssociativeBinaryOperator(s, precedence(), "===", m_expr1, m_expr2); 669 669 } 670 670 671 671 void NotStrictEqualNode::streamTo(SourceStream& s) const 672 672 { 673 streamLeftAssociativeBinaryOperator(s, precedence(), "!==", expr1,expr2);673 streamLeftAssociativeBinaryOperator(s, precedence(), "!==", m_expr1, m_expr2); 674 674 } 675 675 676 676 void BitAndNode::streamTo(SourceStream& s) const 677 677 { 678 streamLeftAssociativeBinaryOperator(s, precedence(), "&", expr1,expr2);678 streamLeftAssociativeBinaryOperator(s, precedence(), "&", m_expr1, m_expr2); 679 679 } 680 680 681 681 void BitXOrNode::streamTo(SourceStream& s) const 682 682 { 683 streamLeftAssociativeBinaryOperator(s, precedence(), "^", expr1,expr2);683 streamLeftAssociativeBinaryOperator(s, precedence(), "^", m_expr1, m_expr2); 684 684 } 685 685 686 686 void BitOrNode::streamTo(SourceStream& s) const 687 687 { 688 streamLeftAssociativeBinaryOperator(s, precedence(), "|", expr1,expr2);688 streamLeftAssociativeBinaryOperator(s, precedence(), "|", m_expr1, m_expr2); 689 689 } 690 690 691 691 void LogicalAndNode::streamTo(SourceStream& s) const 692 692 { 693 streamLeftAssociativeBinaryOperator(s, precedence(), "&&", expr1,expr2);693 streamLeftAssociativeBinaryOperator(s, precedence(), "&&", m_expr1, m_expr2); 694 694 } 695 695 696 696 void LogicalOrNode::streamTo(SourceStream& s) const 697 697 { 698 streamLeftAssociativeBinaryOperator(s, precedence(), "||", expr1,expr2);698 streamLeftAssociativeBinaryOperator(s, precedence(), "||", m_expr1, m_expr2); 699 699 } 700 700 701 701 void ConditionalNode::streamTo(SourceStream& s) const 702 702 { 703 s << PrecLogicalOr << logical704 << " ? " << PrecAssignment << expr1705 << " : " << PrecAssignment << expr2;703 s << PrecLogicalOr << m_logical 704 << " ? " << PrecAssignment << m_expr1 705 << " : " << PrecAssignment << m_expr2; 706 706 } 707 707 … … 748 748 void CommaNode::streamTo(SourceStream& s) const 749 749 { 750 s << PrecAssignment << expr1 << ", " << PrecAssignment <<expr2;750 s << PrecAssignment << m_expr1 << ", " << PrecAssignment << m_expr2; 751 751 } 752 752 753 753 void ConstDeclNode::streamTo(SourceStream& s) const 754 754 { 755 s << ident;756 if ( init)757 s << " = " << init;758 for (ConstDeclNode* n = next.get(); n; n = n->next.get()) {759 s << ", " << ident;760 if ( init)761 s << " = " << init;755 s << m_ident; 756 if (m_init) 757 s << " = " << m_init; 758 for (ConstDeclNode* n = m_next.get(); n; n = n->m_next.get()) { 759 s << ", " << m_ident; 760 if (m_init) 761 s << " = " << m_init; 762 762 } 763 763 } … … 765 765 void ConstStatementNode::streamTo(SourceStream& s) const 766 766 { 767 s << Endl << "const " << next << ';';767 s << Endl << "const " << m_next << ';'; 768 768 } 769 769 … … 810 810 void ExprStatementNode::streamTo(SourceStream& s) const 811 811 { 812 s << Endl << expr << ';';812 s << Endl << m_expr << ';'; 813 813 } 814 814 815 815 void VarStatementNode::streamTo(SourceStream& s) const 816 816 { 817 s << Endl << "var " << expr << ';';817 s << Endl << "var " << m_expr << ';'; 818 818 } 819 819 … … 831 831 void DoWhileNode::streamTo(SourceStream& s) const 832 832 { 833 s << Endl << "do " << Indent << statement << Unindent << Endl834 << "while (" << expr << ");";833 s << Endl << "do " << Indent << m_statement << Unindent << Endl 834 << "while (" << m_expr << ");"; 835 835 } 836 836 837 837 void WhileNode::streamTo(SourceStream& s) const 838 838 { 839 s << Endl << "while (" << expr << ')' << Indent <<statement << Unindent;839 s << Endl << "while (" << m_expr << ')' << Indent << m_statement << Unindent; 840 840 } 841 841 … … 843 843 { 844 844 s << Endl << "for (" 845 << ( expr1WasVarDecl ? "var " : "")846 << expr1847 << "; " << expr2848 << "; " << expr3849 << ')' << Indent << statement << Unindent;845 << (m_expr1WasVarDecl ? "var " : "") 846 << m_expr1 847 << "; " << m_expr2 848 << "; " << m_expr3 849 << ')' << Indent << m_statement << Unindent; 850 850 } 851 851 … … 853 853 { 854 854 s << Endl << "for ("; 855 if ( identIsVarDecl) {855 if (m_identIsVarDecl) { 856 856 s << "var "; 857 if ( init)858 s << init;857 if (m_init) 858 s << m_init; 859 859 else 860 s << PrecLeftHandSide << lexpr;860 s << PrecLeftHandSide << m_lexpr; 861 861 } else 862 s << PrecLeftHandSide << lexpr;863 864 s << " in " << expr << ')' << Indent <<statement << Unindent;862 s << PrecLeftHandSide << m_lexpr; 863 864 s << " in " << m_expr << ')' << Indent << m_statement << Unindent; 865 865 } 866 866 … … 868 868 { 869 869 s << Endl << "continue"; 870 if (! ident.isNull())871 s << ' ' << ident;870 if (!m_ident.isNull()) 871 s << ' ' << m_ident; 872 872 s << ';'; 873 873 } … … 876 876 { 877 877 s << Endl << "break"; 878 if (! ident.isNull())879 s << ' ' << ident;878 if (!m_ident.isNull()) 879 s << ' ' << m_ident; 880 880 s << ';'; 881 881 } … … 884 884 { 885 885 s << Endl << "return"; 886 if ( value)887 s << ' ' << value;886 if (m_value) 887 s << ' ' << m_value; 888 888 s << ';'; 889 889 } … … 891 891 void WithNode::streamTo(SourceStream& s) const 892 892 { 893 s << Endl << "with (" << expr << ") " <<statement;893 s << Endl << "with (" << m_expr << ") " << m_statement; 894 894 } 895 895 … … 897 897 { 898 898 s << Endl; 899 if ( expr)900 s << "case " << expr;899 if (m_expr) 900 s << "case " << m_expr; 901 901 else 902 902 s << "default"; … … 914 914 void CaseBlockNode::streamTo(SourceStream& s) const 915 915 { 916 for (const ClauseListNode* n = list1.get(); n; n = n->getNext())916 for (const ClauseListNode* n = m_list1.get(); n; n = n->getNext()) 917 917 s << n->getClause(); 918 s << def;919 for (const ClauseListNode* n = list2.get(); n; n = n->getNext())918 s << m_defaultClause; 919 for (const ClauseListNode* n = m_list2.get(); n; n = n->getNext()) 920 920 s << n->getClause(); 921 921 } … … 923 923 void SwitchNode::streamTo(SourceStream& s) const 924 924 { 925 s << Endl << "switch (" << expr << ") {"926 << Indent << block << Unindent925 s << Endl << "switch (" << m_expr << ") {" 926 << Indent << m_block << Unindent 927 927 << Endl << "}"; 928 928 } … … 930 930 void LabelNode::streamTo(SourceStream& s) const 931 931 { 932 s << Endl << label << ":" << Indent <<statement << Unindent;932 s << Endl << m_label << ":" << Indent << m_statement << Unindent; 933 933 } 934 934 935 935 void ThrowNode::streamTo(SourceStream& s) const 936 936 { 937 s << Endl << "throw " << expr << ';';937 s << Endl << "throw " << m_expr << ';'; 938 938 } 939 939 940 940 void TryNode::streamTo(SourceStream& s) const 941 941 { 942 s << Endl << "try " << tryBlock;943 if ( catchBlock)944 s << Endl << "catch (" << exceptionIdent << ')' <<catchBlock;945 if ( finallyBlock)946 s << Endl << "finally " << finallyBlock;942 s << Endl << "try " << m_tryBlock; 943 if (m_catchBlock) 944 s << Endl << "catch (" << m_exceptionIdent << ')' << m_catchBlock; 945 if (m_finallyBlock) 946 s << Endl << "finally " << m_finallyBlock; 947 947 } 948 948 949 949 void ParameterNode::streamTo(SourceStream& s) const 950 950 { 951 s << id;952 for (ParameterNode* n = next.get(); n; n = n->next.get())953 s << ", " << n-> id;951 s << m_ident; 952 for (ParameterNode* n = m_next.get(); n; n = n->m_next.get()) 953 s << ", " << n->m_ident; 954 954 } 955 955 956 956 void FuncDeclNode::streamTo(SourceStream& s) const 957 957 { 958 s << Endl << "function " << ident << '(' << param << ')' <<body;958 s << Endl << "function " << m_ident << '(' << m_parameter << ')' << m_body; 959 959 } 960 960 961 961 void FuncExprNode::streamTo(SourceStream& s) const 962 962 { 963 s << "function " << ident << '(' << param << ')' <<body;963 s << "function " << m_ident << '(' << m_parameter << ')' << m_body; 964 964 } 965 965
Note:
See TracChangeset
for help on using the changeset viewer.