Changeset 11527 in webkit for trunk/JavaScriptCore/kjs/nodes.h
- Timestamp:
- Dec 10, 2005, 6:06:17 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.h
r11525 r11527 76 76 virtual ~Node(); 77 77 78 virtual ValueImp*evaluate(ExecState *exec) = 0;78 virtual JSValue *evaluate(ExecState *exec) = 0; 79 79 UString toString() const; 80 80 virtual void streamTo(SourceStream &s) const = 0; … … 99 99 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &); 100 100 101 ValueImp*throwError(ExecState *, ErrorType, const char *msg);102 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp*, Node *);103 ValueImp*throwError(ExecState *, ErrorType, const char *msg, const Identifier &);104 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp*, const Identifier &);105 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp*, Node *, Node *);106 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp*, Node *, const Identifier &);107 108 ValueImp*throwUndefinedVariableError(ExecState *, const Identifier &);101 JSValue *throwError(ExecState *, ErrorType, const char *msg); 102 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *); 103 JSValue *throwError(ExecState *, ErrorType, const char *msg, const Identifier &); 104 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, const Identifier &); 105 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, Node *); 106 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, const Identifier &); 107 108 JSValue *throwUndefinedVariableError(ExecState *, const Identifier &); 109 109 110 110 void setExceptionDetailsIfNeeded(ExecState *); … … 135 135 LabelStack ls; 136 136 private: 137 ValueImp*evaluate(ExecState */*exec*/) { return jsUndefined(); }137 JSValue *evaluate(ExecState */*exec*/) { return jsUndefined(); } 138 138 int l0, l1; 139 139 int sid; … … 144 144 public: 145 145 NullNode() {} 146 ValueImp*evaluate(ExecState *exec);146 JSValue *evaluate(ExecState *exec); 147 147 virtual void streamTo(SourceStream &s) const; 148 148 }; … … 151 151 public: 152 152 BooleanNode(bool v) : value(v) {} 153 ValueImp*evaluate(ExecState *exec);153 JSValue *evaluate(ExecState *exec); 154 154 virtual void streamTo(SourceStream &s) const; 155 155 private: … … 160 160 public: 161 161 NumberNode(double v) : value(v) {} 162 ValueImp*evaluate(ExecState *exec);162 JSValue *evaluate(ExecState *exec); 163 163 virtual void streamTo(SourceStream &s) const; 164 164 private: … … 169 169 public: 170 170 StringNode(const UString *v) { value = *v; } 171 ValueImp*evaluate(ExecState *exec);171 JSValue *evaluate(ExecState *exec); 172 172 virtual void streamTo(SourceStream &s) const; 173 173 private: … … 179 179 RegExpNode(const UString &p, const UString &f) 180 180 : pattern(p), flags(f) { } 181 ValueImp*evaluate(ExecState *exec);181 JSValue *evaluate(ExecState *exec); 182 182 virtual void streamTo(SourceStream &s) const; 183 183 private: … … 188 188 public: 189 189 ThisNode() {} 190 ValueImp*evaluate(ExecState *exec);190 JSValue *evaluate(ExecState *exec); 191 191 virtual void streamTo(SourceStream &s) const; 192 192 }; … … 195 195 public: 196 196 ResolveNode(const Identifier &s) : ident(s) { } 197 ValueImp*evaluate(ExecState *exec);197 JSValue *evaluate(ExecState *exec); 198 198 virtual void streamTo(SourceStream &s) const; 199 199 … … 209 209 public: 210 210 GroupNode(Node *g) : group(g) { } 211 virtual ValueImp*evaluate(ExecState *exec);211 virtual JSValue *evaluate(ExecState *exec); 212 212 virtual Node *nodeInsideAllParens(); 213 213 virtual void streamTo(SourceStream &s) const; … … 223 223 ElementNode(ElementNode *l, int e, Node *n) 224 224 : list(l->list), elision(e), node(n) { l->list = this; } 225 ValueImp*evaluate(ExecState *exec);225 JSValue *evaluate(ExecState *exec); 226 226 virtual void streamTo(SourceStream &s) const; 227 227 private: … … 239 239 ArrayNode(int eli, ElementNode *ele) 240 240 : element(ele->list), elision(eli), opt(true) { ele->list = 0; } 241 ValueImp*evaluate(ExecState *exec);241 JSValue *evaluate(ExecState *exec); 242 242 virtual void streamTo(SourceStream &s) const; 243 243 private: … … 254 254 PropertyValueNode(PropertyNode *n, Node *a, PropertyValueNode *l) 255 255 : name(n), assign(a), list(l->list) { l->list = this; } 256 ValueImp*evaluate(ExecState *exec);256 JSValue *evaluate(ExecState *exec); 257 257 virtual void streamTo(SourceStream &s) const; 258 258 private: … … 267 267 ObjectLiteralNode() : list(0) { } 268 268 ObjectLiteralNode(PropertyValueNode *l) : list(l->list) { l->list = 0; } 269 ValueImp*evaluate(ExecState *exec);269 JSValue *evaluate(ExecState *exec); 270 270 virtual void streamTo(SourceStream &s) const; 271 271 private: … … 277 277 PropertyNode(double d) : numeric(d) { } 278 278 PropertyNode(const Identifier &s) : str(s) { } 279 ValueImp*evaluate(ExecState *exec);279 JSValue *evaluate(ExecState *exec); 280 280 virtual void streamTo(SourceStream &s) const; 281 281 private: … … 287 287 public: 288 288 BracketAccessorNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {} 289 ValueImp*evaluate(ExecState *exec);289 JSValue *evaluate(ExecState *exec); 290 290 virtual void streamTo(SourceStream &s) const; 291 291 … … 303 303 public: 304 304 DotAccessorNode(Node *e, const Identifier &s) : expr(e), ident(s) { } 305 ValueImp*evaluate(ExecState *exec);305 JSValue *evaluate(ExecState *exec); 306 306 virtual void streamTo(SourceStream &s) const; 307 307 … … 322 322 ArgumentListNode(ArgumentListNode *l, Node *e) 323 323 : list(l->list), expr(e) { l->list = this; } 324 ValueImp*evaluate(ExecState *exec);324 JSValue *evaluate(ExecState *exec); 325 325 List evaluateList(ExecState *exec); 326 326 virtual void streamTo(SourceStream &s) const; … … 336 336 ArgumentsNode(ArgumentListNode *l) 337 337 : list(l->list) { l->list = 0; } 338 ValueImp*evaluate(ExecState *exec);338 JSValue *evaluate(ExecState *exec); 339 339 List evaluateList(ExecState *exec); 340 340 virtual void streamTo(SourceStream &s) const; … … 347 347 NewExprNode(Node *e) : expr(e), args(0) {} 348 348 NewExprNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {} 349 ValueImp*evaluate(ExecState *exec);349 JSValue *evaluate(ExecState *exec); 350 350 virtual void streamTo(SourceStream &s) const; 351 351 private: … … 357 357 public: 358 358 FunctionCallValueNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {} 359 ValueImp*evaluate(ExecState *exec);359 JSValue *evaluate(ExecState *exec); 360 360 virtual void streamTo(SourceStream &s) const; 361 361 private: … … 367 367 public: 368 368 FunctionCallResolveNode(const Identifier& i, ArgumentsNode *a) : ident(i), args(a) {} 369 ValueImp*evaluate(ExecState *exec);369 JSValue *evaluate(ExecState *exec); 370 370 virtual void streamTo(SourceStream &s) const; 371 371 private: … … 377 377 public: 378 378 FunctionCallBracketNode(Node *b, Node *s, ArgumentsNode *a) : base(b), subscript(s), args(a) {} 379 ValueImp*evaluate(ExecState *exec);379 JSValue *evaluate(ExecState *exec); 380 380 virtual void streamTo(SourceStream &s) const; 381 381 protected: … … 394 394 public: 395 395 FunctionCallDotNode(Node *b, const Identifier &i, ArgumentsNode *a) : base(b), ident(i), args(a) {} 396 ValueImp*evaluate(ExecState *exec);396 JSValue *evaluate(ExecState *exec); 397 397 virtual void streamTo(SourceStream &s) const; 398 398 protected: … … 411 411 public: 412 412 PostfixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {} 413 ValueImp*evaluate(ExecState *exec);413 JSValue *evaluate(ExecState *exec); 414 414 virtual void streamTo(SourceStream &s) const; 415 415 private: … … 421 421 public: 422 422 PostfixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {} 423 ValueImp*evaluate(ExecState *exec);423 JSValue *evaluate(ExecState *exec); 424 424 virtual void streamTo(SourceStream &s) const; 425 425 private: … … 432 432 public: 433 433 PostfixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {} 434 ValueImp*evaluate(ExecState *exec);434 JSValue *evaluate(ExecState *exec); 435 435 virtual void streamTo(SourceStream &s) const; 436 436 private: … … 443 443 public: 444 444 DeleteResolveNode(const Identifier& i) : m_ident(i) {} 445 ValueImp*evaluate(ExecState *exec);445 JSValue *evaluate(ExecState *exec); 446 446 virtual void streamTo(SourceStream &s) const; 447 447 private: … … 452 452 public: 453 453 DeleteBracketNode(Node *base, Node *subscript) : m_base(base), m_subscript(subscript) {} 454 ValueImp*evaluate(ExecState *exec);454 JSValue *evaluate(ExecState *exec); 455 455 virtual void streamTo(SourceStream &s) const; 456 456 private: … … 462 462 public: 463 463 DeleteDotNode(Node *base, const Identifier& i) : m_base(base), m_ident(i) {} 464 ValueImp*evaluate(ExecState *exec);464 JSValue *evaluate(ExecState *exec); 465 465 virtual void streamTo(SourceStream &s) const; 466 466 private: … … 472 472 public: 473 473 DeleteValueNode(Node *e) : m_expr(e) {} 474 ValueImp*evaluate(ExecState *exec);474 JSValue *evaluate(ExecState *exec); 475 475 virtual void streamTo(SourceStream &s) const; 476 476 private: … … 481 481 public: 482 482 VoidNode(Node *e) : expr(e) {} 483 ValueImp*evaluate(ExecState *exec);483 JSValue *evaluate(ExecState *exec); 484 484 virtual void streamTo(SourceStream &s) const; 485 485 private: … … 490 490 public: 491 491 TypeOfResolveNode(const Identifier& i) : m_ident(i) {} 492 ValueImp*evaluate(ExecState *exec);492 JSValue *evaluate(ExecState *exec); 493 493 virtual void streamTo(SourceStream &s) const; 494 494 private: … … 499 499 public: 500 500 TypeOfValueNode(Node *e) : m_expr(e) {} 501 ValueImp*evaluate(ExecState *exec);501 JSValue *evaluate(ExecState *exec); 502 502 virtual void streamTo(SourceStream &s) const; 503 503 private: … … 508 508 public: 509 509 PrefixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {} 510 ValueImp*evaluate(ExecState *exec);510 JSValue *evaluate(ExecState *exec); 511 511 virtual void streamTo(SourceStream &s) const; 512 512 private: … … 518 518 public: 519 519 PrefixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {} 520 ValueImp*evaluate(ExecState *exec);520 JSValue *evaluate(ExecState *exec); 521 521 virtual void streamTo(SourceStream &s) const; 522 522 private: … … 529 529 public: 530 530 PrefixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {} 531 ValueImp*evaluate(ExecState *exec);531 JSValue *evaluate(ExecState *exec); 532 532 virtual void streamTo(SourceStream &s) const; 533 533 private: … … 540 540 public: 541 541 UnaryPlusNode(Node *e) : expr(e) {} 542 ValueImp*evaluate(ExecState *exec);542 JSValue *evaluate(ExecState *exec); 543 543 virtual void streamTo(SourceStream &s) const; 544 544 private: … … 549 549 public: 550 550 NegateNode(Node *e) : expr(e) {} 551 ValueImp*evaluate(ExecState *exec);551 JSValue *evaluate(ExecState *exec); 552 552 virtual void streamTo(SourceStream &s) const; 553 553 private: … … 558 558 public: 559 559 BitwiseNotNode(Node *e) : expr(e) {} 560 ValueImp*evaluate(ExecState *exec);560 JSValue *evaluate(ExecState *exec); 561 561 virtual void streamTo(SourceStream &s) const; 562 562 private: … … 567 567 public: 568 568 LogicalNotNode(Node *e) : expr(e) {} 569 ValueImp*evaluate(ExecState *exec);569 JSValue *evaluate(ExecState *exec); 570 570 virtual void streamTo(SourceStream &s) const; 571 571 private: … … 576 576 public: 577 577 MultNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {} 578 ValueImp*evaluate(ExecState *exec);578 JSValue *evaluate(ExecState *exec); 579 579 virtual void streamTo(SourceStream &s) const; 580 580 private: … … 587 587 public: 588 588 AddNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {} 589 ValueImp*evaluate(ExecState *exec);589 JSValue *evaluate(ExecState *exec); 590 590 virtual void streamTo(SourceStream &s) const; 591 591 private: … … 599 599 ShiftNode(Node *t1, Operator o, Node *t2) 600 600 : term1(t1), term2(t2), oper(o) {} 601 ValueImp*evaluate(ExecState *exec);601 JSValue *evaluate(ExecState *exec); 602 602 virtual void streamTo(SourceStream &s) const; 603 603 private: … … 611 611 RelationalNode(Node *e1, Operator o, Node *e2) : 612 612 expr1(e1), expr2(e2), oper(o) {} 613 ValueImp*evaluate(ExecState *exec);613 JSValue *evaluate(ExecState *exec); 614 614 virtual void streamTo(SourceStream &s) const; 615 615 private: … … 623 623 EqualNode(Node *e1, Operator o, Node *e2) 624 624 : expr1(e1), expr2(e2), oper(o) {} 625 ValueImp*evaluate(ExecState *exec);625 JSValue *evaluate(ExecState *exec); 626 626 virtual void streamTo(SourceStream &s) const; 627 627 private: … … 635 635 BitOperNode(Node *e1, Operator o, Node *e2) : 636 636 expr1(e1), expr2(e2), oper(o) {} 637 ValueImp*evaluate(ExecState *exec);637 JSValue *evaluate(ExecState *exec); 638 638 virtual void streamTo(SourceStream &s) const; 639 639 private: … … 650 650 BinaryLogicalNode(Node *e1, Operator o, Node *e2) : 651 651 expr1(e1), expr2(e2), oper(o) {} 652 ValueImp*evaluate(ExecState *exec);652 JSValue *evaluate(ExecState *exec); 653 653 virtual void streamTo(SourceStream &s) const; 654 654 private: … … 665 665 ConditionalNode(Node *l, Node *e1, Node *e2) : 666 666 logical(l), expr1(e1), expr2(e2) {} 667 ValueImp*evaluate(ExecState *exec);667 JSValue *evaluate(ExecState *exec); 668 668 virtual void streamTo(SourceStream &s) const; 669 669 private: … … 677 677 AssignResolveNode(const Identifier &ident, Operator oper, Node *right) 678 678 : m_ident(ident), m_oper(oper), m_right(right) {} 679 ValueImp*evaluate(ExecState *exec);679 JSValue *evaluate(ExecState *exec); 680 680 virtual void streamTo(SourceStream &s) const; 681 681 protected: … … 689 689 AssignBracketNode(Node *base, Node *subscript, Operator oper, Node *right) 690 690 : m_base(base), m_subscript(subscript), m_oper(oper), m_right(right) {} 691 ValueImp*evaluate(ExecState *exec);691 JSValue *evaluate(ExecState *exec); 692 692 virtual void streamTo(SourceStream &s) const; 693 693 protected: … … 702 702 AssignDotNode(Node *base, const Identifier& ident, Operator oper, Node *right) 703 703 : m_base(base), m_ident(ident), m_oper(oper), m_right(right) {} 704 ValueImp*evaluate(ExecState *exec);704 JSValue *evaluate(ExecState *exec); 705 705 virtual void streamTo(SourceStream &s) const; 706 706 protected: … … 714 714 public: 715 715 CommaNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {} 716 ValueImp*evaluate(ExecState *exec);716 JSValue *evaluate(ExecState *exec); 717 717 virtual void streamTo(SourceStream &s) const; 718 718 private: … … 738 738 public: 739 739 AssignExprNode(Node *e) : expr(e) {} 740 ValueImp*evaluate(ExecState *exec);740 JSValue *evaluate(ExecState *exec); 741 741 virtual void streamTo(SourceStream &s) const; 742 742 private: … … 748 748 enum Type { Variable, Constant }; 749 749 VarDeclNode(const Identifier &id, AssignExprNode *in, Type t); 750 ValueImp*evaluate(ExecState *exec);750 JSValue *evaluate(ExecState *exec); 751 751 virtual void processVarDecls(ExecState *exec); 752 752 virtual void streamTo(SourceStream &s) const; … … 763 763 VarDeclListNode(VarDeclListNode *l, VarDeclNode *v) 764 764 : list(l->list), var(v) { l->list = this; } 765 ValueImp*evaluate(ExecState *exec);765 JSValue *evaluate(ExecState *exec); 766 766 virtual void processVarDecls(ExecState *exec); 767 767 virtual void streamTo(SourceStream &s) const; … … 921 921 CaseClauseNode(Node *e, StatListNode *l) 922 922 : expr(e), list(l->list) { l->list = 0; } 923 ValueImp*evaluate(ExecState *exec);923 JSValue *evaluate(ExecState *exec); 924 924 Completion evalStatements(ExecState *exec); 925 925 virtual void processVarDecls(ExecState *exec); … … 936 936 ClauseListNode(ClauseListNode *n, CaseClauseNode *c) 937 937 : cl(c), nx(n->nx) { n->nx = this; } 938 ValueImp*evaluate(ExecState *exec);938 JSValue *evaluate(ExecState *exec); 939 939 CaseClauseNode *clause() const { return cl.get(); } 940 940 ClauseListNode *next() const { return nx.get(); } … … 950 950 public: 951 951 CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2); 952 ValueImp*evaluate(ExecState *exec);953 Completion evalBlock(ExecState *exec, ValueImp*input);952 JSValue *evaluate(ExecState *exec); 953 Completion evalBlock(ExecState *exec, JSValue *input); 954 954 virtual void processVarDecls(ExecState *exec); 955 955 virtual void streamTo(SourceStream &s) const; … … 1011 1011 ParameterNode(ParameterNode *list, const Identifier &i) 1012 1012 : id(i), next(list->next) { list->next = this; } 1013 ValueImp*evaluate(ExecState *exec);1013 JSValue *evaluate(ExecState *exec); 1014 1014 Identifier ident() { return id; } 1015 1015 ParameterNode *nextParam() { return next.get(); } … … 1035 1035 FuncExprNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1036 1036 : ident(i), param(p->next), body(b) { p->next = 0; } 1037 virtual ValueImp*evaluate(ExecState *);1037 virtual JSValue *evaluate(ExecState *); 1038 1038 virtual void streamTo(SourceStream &) const; 1039 1039 private:
Note:
See TracChangeset
for help on using the changeset viewer.