37 class SourceElementsNode;
38 class ObjectLiteralNode;
41 class PropertyValueNode;
44 enum Operator { OpEqual,
81 virtual Type type()
const {
return UnspecifiedType; }
86 virtual Reference evaluateReference(ExecState *exec)
const;
90 virtual Value evaluate(ExecState *exec)
const;
91 virtual bool toBoolean(ExecState *exec)
const;
92 virtual double toNumber(ExecState *exec)
const;
93 virtual UString toString(ExecState *exec)
const;
95 UString toCode()
const;
96 virtual void streamTo(SourceStream &s)
const = 0;
97 virtual void processVarDecls(ExecState* ) {}
98 int lineNo()
const {
return line; }
102 virtual void ref() { refcount++; }
104 virtual bool deref() { assert( refcount > 0 );
return (!--refcount); }
106 virtual bool deref() {
return (!--refcount); }
111 static void finalCheck();
114 Value throwError(ExecState *exec, ErrorType e,
const char *msg)
const;
115 Value throwError(ExecState *exec, ErrorType e,
const char *msg,
116 const Value &v,
const Node *expr)
const;
117 Value throwError(ExecState *exec, ErrorType e,
const char *msg, Identifier label)
const;
118 void setExceptionDetailsIfNeeded(ExecState *exec)
const;
120 unsigned int refcount;
121 virtual int sourceId()
const {
return -1; }
125 static std::list<Node *> *s_nodes;
128 Node& operator=(
const Node&);
129 Node(
const Node &other);
132 class StatementNode :
public Node {
135 virtual ~StatementNode();
136 void setLoc(
int line0,
int line1, SourceCode *src);
137 int firstLine()
const {
return l0; }
138 int lastLine()
const {
return l1; }
139 int sourceId()
const {
return sourceCode->sid; }
140 SourceCode *code()
const {
return sourceCode; }
141 bool hitStatement(ExecState *exec);
142 bool abortStatement(ExecState *exec);
143 virtual Completion execute(ExecState *exec) = 0;
144 void pushLabel(
const Identifier &
id) { ls.push(
id); }
145 virtual void processFuncDecl(ExecState *exec);
149 Reference evaluateReference(ExecState* )
const {
return Reference(0,
Identifier::null()); }
151 SourceCode *sourceCode;
155 class NullNode :
public Node {
158 virtual Value evaluate(ExecState *exec)
const;
159 virtual bool toBoolean(ExecState *exec)
const;
160 virtual double toNumber(ExecState *exec)
const;
161 virtual UString toString(ExecState *exec)
const;
162 virtual void streamTo(SourceStream &s)
const;
165 class BooleanNode :
public Node {
167 BooleanNode(
bool v) : val(v) {}
168 virtual Type type()
const {
return BooleanType; }
169 virtual Value evaluate(ExecState *exec)
const;
170 virtual bool toBoolean(ExecState *exec)
const;
171 virtual double toNumber(ExecState *exec)
const;
172 virtual UString toString(ExecState *exec)
const;
173 virtual void streamTo(SourceStream &s)
const;
178 class NumberNode :
public Node {
180 NumberNode(
double v) : val(v) { }
181 virtual Type type()
const {
return NumberType; }
182 virtual Value evaluate(ExecState *exec)
const;
183 virtual bool toBoolean(ExecState *exec)
const;
184 virtual double toNumber(ExecState *exec)
const;
185 virtual UString toString(ExecState *exec)
const;
186 virtual void streamTo(SourceStream &s)
const;
191 class StringNode :
public Node {
193 StringNode(
const UString *v) : val(*v) { }
194 virtual Type type()
const {
return StringType; }
195 virtual Value evaluate(ExecState *exec)
const;
196 virtual bool toBoolean(ExecState *exec)
const;
197 virtual double toNumber(ExecState *exec)
const;
198 virtual UString toString(ExecState *exec)
const;
199 virtual void streamTo(SourceStream &s)
const;
204 class RegExpNode :
public Node {
206 RegExpNode(
const UString &p,
const UString &f)
207 : pattern(p), flags(f) { }
208 virtual Value evaluate(ExecState *exec)
const;
209 virtual bool toBoolean(ExecState *exec)
const;
210 virtual void streamTo(SourceStream &s)
const;
212 UString pattern, flags;
215 class ThisNode :
public Node {
218 virtual Value evaluate(ExecState *exec)
const;
219 virtual void streamTo(SourceStream &s)
const;
222 class ResolveNode :
public Node {
224 ResolveNode(
const Identifier &s) : ident(s) { }
225 Reference evaluateReference(ExecState *exec)
const;
226 virtual Value evaluate(ExecState *exec)
const;
227 virtual void streamTo(SourceStream &s)
const;
232 class GroupNode :
public Node {
234 GroupNode(Node *g) : group(g) { }
236 virtual bool deref();
237 Reference evaluateReference(ExecState *exec)
const;
238 virtual Value evaluate(ExecState *exec)
const;
239 virtual void streamTo(SourceStream &s)
const;
244 class ElementNode :
public Node {
247 ElementNode(
int e, Node *n) : list(this), elision(e), node(n) { }
248 ElementNode(ElementNode *l,
int e, Node *n)
249 : list(l->list), elision(e), node(n) { l->list =
this; }
251 virtual bool deref();
252 virtual Value evaluate(ExecState *exec)
const;
253 virtual void streamTo(SourceStream &s)
const;
255 friend class ArrayNode;
261 class ArrayNode :
public Node {
263 ArrayNode(
int e) : element(0L), elision(e), opt(true) { }
264 ArrayNode(ElementNode *ele)
265 : element(ele->list), elision(0), opt(false) { ele->list = 0; }
266 ArrayNode(
int eli, ElementNode *ele)
267 : element(ele->list), elision(eli), opt(true) { ele->list = 0; }
269 virtual bool deref();
270 virtual Value evaluate(ExecState *exec)
const;
271 virtual void streamTo(SourceStream &s)
const;
273 ElementNode *element;
278 class PropertyValueNode :
public Node {
281 PropertyValueNode(PropertyNode *n, Node *a)
282 :
name(n), assign(a), list(this) { }
283 PropertyValueNode(PropertyNode *n, Node *a, PropertyValueNode *l)
284 :
name(n), assign(a), list(l->list) { l->list =
this; }
286 virtual bool deref();
287 virtual Value evaluate(ExecState *exec)
const;
288 virtual void streamTo(SourceStream &s)
const;
290 friend class ObjectLiteralNode;
293 PropertyValueNode *list;
296 class PropertyNode :
public Node {
298 PropertyNode(
double d) : numeric(d) { }
299 PropertyNode(
const Identifier &s) : str(s) { }
300 virtual Value evaluate(ExecState *exec)
const;
301 virtual void streamTo(SourceStream &s)
const;
307 class ObjectLiteralNode :
public Node {
310 ObjectLiteralNode() : list(0) { }
312 ObjectLiteralNode(PropertyValueNode *l) : list(l->list) { l->list = 0; }
314 virtual bool deref();
315 virtual Value evaluate(ExecState *exec)
const;
316 virtual void streamTo(SourceStream &s)
const;
318 PropertyValueNode *list;
321 class AccessorNode1 :
public Node {
323 AccessorNode1(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}
325 virtual bool deref();
326 Reference evaluateReference(ExecState *exec)
const;
327 virtual void streamTo(SourceStream &s)
const;
333 class AccessorNode2 :
public Node {
335 AccessorNode2(Node *e,
const Identifier &s) : expr(e), ident(s) { }
337 virtual bool deref();
338 Reference evaluateReference(ExecState *exec)
const;
339 virtual void streamTo(SourceStream &s)
const;
345 class ArgumentListNode :
public Node {
348 ArgumentListNode(Node *e) : list(this), expr(e) {}
349 ArgumentListNode(ArgumentListNode *l, Node *e)
350 : list(l->list), expr(e) { l->list =
this; }
352 virtual bool deref();
353 virtual Value evaluate(ExecState *exec)
const;
354 List evaluateList(ExecState *exec)
const;
355 virtual void streamTo(SourceStream &s)
const;
357 friend class ArgumentsNode;
358 ArgumentListNode *list;
362 class ArgumentsNode :
public Node {
364 ArgumentsNode() : list(0) {}
365 ArgumentsNode(ArgumentListNode *l) : list(l->list) { l->list = 0; }
367 virtual bool deref();
368 virtual Value evaluate(ExecState *exec)
const;
369 List evaluateList(ExecState *exec)
const;
370 virtual void streamTo(SourceStream &s)
const;
372 ArgumentListNode *list;
375 class NewExprNode :
public Node {
377 NewExprNode(Node *e) : expr(e), args(0L) {}
378 NewExprNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}
380 virtual bool deref();
381 virtual Value evaluate(ExecState *exec)
const;
382 virtual void streamTo(SourceStream &s)
const;
388 class FunctionCallNode :
public Node {
390 FunctionCallNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}
392 virtual bool deref();
393 virtual Value evaluate(ExecState *exec)
const;
394 virtual void streamTo(SourceStream &s)
const;
400 class PostfixNode :
public Node {
402 PostfixNode(Node *e, Operator o) : expr(e), oper(o) {}
404 virtual bool deref();
405 virtual Value evaluate(ExecState *exec)
const;
406 virtual void streamTo(SourceStream &s)
const;
412 class DeleteNode :
public Node {
414 DeleteNode(Node *e) : expr(e) {}
416 virtual bool deref();
417 virtual Value evaluate(ExecState *exec)
const;
418 virtual void streamTo(SourceStream &s)
const;
423 class VoidNode :
public Node {
425 VoidNode(Node *e) : expr(e) {}
427 virtual bool deref();
428 virtual Value evaluate(ExecState *exec)
const;
429 virtual void streamTo(SourceStream &s)
const;
434 class TypeOfNode :
public Node {
436 TypeOfNode(Node *e) : expr(e) {}
438 virtual bool deref();
439 virtual Value evaluate(ExecState *exec)
const;
440 virtual void streamTo(SourceStream &s)
const;
445 class PrefixNode :
public Node {
447 PrefixNode(Operator o, Node *e) : oper(o), expr(e) {}
449 virtual bool deref();
450 virtual Value evaluate(ExecState *exec)
const;
451 virtual void streamTo(SourceStream &s)
const;
457 class UnaryPlusNode :
public Node {
459 UnaryPlusNode(Node *e) : expr(e) {}
461 virtual bool deref();
462 virtual Value evaluate(ExecState *exec)
const;
463 virtual double toNumber(ExecState *exec)
const;
464 virtual void streamTo(SourceStream &s)
const;
469 class NegateNode :
public Node {
471 NegateNode(Node *e) : expr(e) {}
473 virtual bool deref();
474 virtual Value evaluate(ExecState *exec)
const;
475 virtual double toNumber(ExecState *exec)
const;
476 virtual void streamTo(SourceStream &s)
const;
481 class BitwiseNotNode :
public Node {
483 BitwiseNotNode(Node *e) : expr(e) {}
485 virtual bool deref();
486 virtual Value evaluate(ExecState *exec)
const;
487 virtual void streamTo(SourceStream &s)
const;
492 class LogicalNotNode :
public Node {
494 LogicalNotNode(Node *e) : expr(e) {}
496 virtual bool deref();
497 virtual Value evaluate(ExecState *exec)
const;
498 virtual bool toBoolean(ExecState *exec)
const;
499 virtual void streamTo(SourceStream &s)
const;
504 class MultNode :
public Node {
506 MultNode(Node *t1, Node *t2,
char op) : term1(t1), term2(t2), oper(op) {}
508 virtual bool deref();
509 virtual Value evaluate(ExecState *exec)
const;
510 virtual void streamTo(SourceStream &s)
const;
516 class AddNode :
public Node {
518 AddNode(Node *t1, Node *t2,
char op) : term1(t1), term2(t2), oper(op) {}
520 static Node* create(Node *t1, Node *t2,
char op);
523 virtual bool deref();
524 virtual Value evaluate(ExecState *exec)
const;
525 virtual void streamTo(SourceStream &s)
const;
531 class AppendStringNode :
public Node {
533 AppendStringNode(Node *t,
const UString &s) : term(t), str(s) { }
535 virtual bool deref();
536 virtual Value evaluate(ExecState *exec)
const;
537 virtual void streamTo(SourceStream &s)
const;
543 class ShiftNode :
public Node {
545 ShiftNode(Node *t1, Operator o, Node *t2)
546 : term1(t1), term2(t2), oper(o) {}
548 virtual bool deref();
549 virtual Value evaluate(ExecState *exec)
const;
550 virtual void streamTo(SourceStream &s)
const;
556 class RelationalNode :
public Node {
558 RelationalNode(Node *e1, Operator o, Node *e2) :
559 expr1(e1), expr2(e2), oper(o) {}
561 virtual bool deref();
562 virtual Value evaluate(ExecState *exec)
const;
563 virtual void streamTo(SourceStream &s)
const;
569 class EqualNode :
public Node {
571 EqualNode(Node *e1, Operator o, Node *e2)
572 : expr1(e1), expr2(e2), oper(o) {}
574 virtual bool deref();
575 virtual Value evaluate(ExecState *exec)
const;
576 virtual void streamTo(SourceStream &s)
const;
582 class BitOperNode :
public Node {
584 BitOperNode(Node *e1, Operator o, Node *e2) :
585 expr1(e1), expr2(e2), oper(o) {}
587 virtual bool deref();
588 virtual Value evaluate(ExecState *exec)
const;
589 virtual void streamTo(SourceStream &s)
const;
601 expr1(e1), expr2(e2), oper(o) {}
603 virtual bool deref();
605 virtual void streamTo(SourceStream &s)
const;
617 logical(l), expr1(e1), expr2(e2) {}
619 virtual bool deref();
621 virtual void streamTo(SourceStream &s)
const;
623 Node *logical, *expr1, *expr2;
626 class AssignNode :
public Node {
628 AssignNode(Node *l, Operator o, Node *e) : left(l), oper(o), expr(e) {}
630 virtual bool deref();
631 virtual Value evaluate(ExecState *exec)
const;
632 virtual void streamTo(SourceStream &s)
const;
639 class CommaNode :
public Node {
641 CommaNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}
643 virtual bool deref();
644 virtual Value evaluate(ExecState *exec)
const;
645 virtual void streamTo(SourceStream &s)
const;
650 class StatListNode :
public StatementNode {
653 StatListNode(StatementNode *s);
654 StatListNode(StatListNode *l, StatementNode *s);
656 virtual bool deref();
657 virtual Completion execute(ExecState *exec);
658 virtual void processVarDecls(ExecState *exec);
659 virtual void streamTo(SourceStream &s)
const;
661 friend class CaseClauseNode;
662 StatementNode *statement;
666 class AssignExprNode :
public Node {
668 AssignExprNode(Node *e) : expr(e) {}
670 virtual bool deref();
671 virtual Value evaluate(ExecState *exec)
const;
672 virtual void streamTo(SourceStream &s)
const;
677 class VarDeclNode :
public Node {
679 enum Type { Variable, Constant };
680 VarDeclNode(
const Identifier &
id, AssignExprNode *in, Type t);
682 virtual bool deref();
683 virtual Value evaluate(ExecState *exec)
const;
684 virtual void processVarDecls(ExecState *exec);
685 virtual void streamTo(SourceStream &s)
const;
689 AssignExprNode *init;
692 class VarDeclListNode :
public Node {
695 VarDeclListNode(VarDeclNode *v) : list(this), var(v) {}
696 VarDeclListNode(VarDeclListNode *l, VarDeclNode *v)
697 : list(l->list), var(v) { l->list =
this; }
699 virtual bool deref();
700 virtual Value evaluate(ExecState *exec)
const;
701 virtual void processVarDecls(ExecState *exec);
702 virtual void streamTo(SourceStream &s)
const;
704 friend class ForNode;
705 friend class VarStatementNode;
706 VarDeclListNode *list;
710 class VarStatementNode :
public StatementNode {
712 VarStatementNode(VarDeclListNode *l) : list(l->list) { l->list = 0; }
714 virtual bool deref();
715 virtual Completion execute(ExecState *exec);
716 virtual void processVarDecls(ExecState *exec);
717 virtual void streamTo(SourceStream &s)
const;
719 VarDeclListNode *list;
722 class BlockNode :
public StatementNode {
724 BlockNode(SourceElementsNode *s);
726 virtual bool deref();
727 virtual Completion execute(ExecState *exec);
728 virtual void processVarDecls(ExecState *exec);
729 virtual void streamTo(SourceStream &s)
const;
731 SourceElementsNode *source;
734 class EmptyStatementNode :
public StatementNode {
736 EmptyStatementNode() { }
737 virtual Completion execute(ExecState *exec);
738 virtual void streamTo(SourceStream &s)
const;
741 class ExprStatementNode :
public StatementNode {
743 ExprStatementNode(Node *e) : expr(e) { }
745 virtual bool deref();
746 virtual Completion execute(ExecState *exec);
747 virtual void streamTo(SourceStream &s)
const;
752 class IfNode :
public StatementNode {
754 IfNode(Node *e, StatementNode *s1, StatementNode *s2)
755 : expr(e), statement1(s1), statement2(s2) {}
757 virtual bool deref();
758 virtual Completion execute(ExecState *exec);
759 virtual void processVarDecls(ExecState *exec);
760 virtual void streamTo(SourceStream &s)
const;
763 StatementNode *statement1, *statement2;
766 class DoWhileNode :
public StatementNode {
768 DoWhileNode(StatementNode *s, Node *e) : statement(s), expr(e) {}
770 virtual bool deref();
771 virtual Completion execute(ExecState *exec);
772 virtual void processVarDecls(ExecState *exec);
773 virtual void streamTo(SourceStream &s)
const;
775 StatementNode *statement;
779 class WhileNode :
public StatementNode {
781 WhileNode(Node *e, StatementNode *s) : expr(e), statement(s) {}
783 virtual bool deref();
784 virtual Completion execute(ExecState *exec);
785 virtual void processVarDecls(ExecState *exec);
786 virtual void streamTo(SourceStream &s)
const;
789 StatementNode *statement;
792 class ForNode :
public StatementNode {
794 ForNode(Node *e1, Node *e2, Node *e3, StatementNode *s) :
795 expr1(e1), expr2(e2), expr3(e3), statement(s) {}
796 ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) :
797 expr1(e1->list), expr2(e2), expr3(e3), statement(s) { e1->list = 0; }
799 virtual bool deref();
800 virtual Completion execute(ExecState *exec);
801 virtual void processVarDecls(ExecState *exec);
802 virtual void streamTo(SourceStream &s)
const;
804 Node *expr1, *expr2, *expr3;
805 StatementNode *statement;
808 class ForInNode :
public StatementNode {
810 ForInNode(Node *l, Node *e, StatementNode *s);
811 ForInNode(
const Identifier &i, AssignExprNode *in, Node *e, StatementNode *s);
813 virtual bool deref();
814 virtual Completion execute(ExecState *exec);
815 virtual void processVarDecls(ExecState *exec);
816 virtual void streamTo(SourceStream &s)
const;
819 AssignExprNode *init;
821 VarDeclNode *varDecl;
822 StatementNode *statement;
825 class ContinueNode :
public StatementNode {
828 ContinueNode(
const Identifier &i) : ident(i) { }
829 virtual Completion execute(ExecState *exec);
830 virtual void streamTo(SourceStream &s)
const;
835 class BreakNode :
public StatementNode {
838 BreakNode(
const Identifier &i) : ident(i) { }
839 virtual Completion execute(ExecState *exec);
840 virtual void streamTo(SourceStream &s)
const;
845 class ReturnNode :
public StatementNode {
847 ReturnNode(Node *v) : value(v) {}
849 virtual bool deref();
850 virtual Completion execute(ExecState *exec);
851 virtual void streamTo(SourceStream &s)
const;
856 class WithNode :
public StatementNode {
858 WithNode(Node *e, StatementNode *s) : expr(e), statement(s) {}
860 virtual bool deref();
861 virtual Completion execute(ExecState *exec);
862 virtual void processVarDecls(ExecState *exec);
863 virtual void streamTo(SourceStream &s)
const;
866 StatementNode *statement;
869 class CaseClauseNode :
public Node {
871 CaseClauseNode(Node *e) : expr(e), list(0) { }
872 CaseClauseNode(Node *e, StatListNode *l)
873 : expr(e), list(l->list) { l->list = 0; }
875 virtual bool deref();
876 virtual Value evaluate(ExecState *exec)
const;
877 Completion evalStatements(ExecState *exec)
const;
878 virtual void processVarDecls(ExecState *exec);
879 virtual void streamTo(SourceStream &s)
const;
885 class ClauseListNode :
public Node {
888 ClauseListNode(CaseClauseNode *c) : cl(c), nx(this) { }
889 ClauseListNode(ClauseListNode *n, CaseClauseNode *c)
890 : cl(c), nx(n->nx) { n->nx =
this; }
892 virtual bool deref();
893 virtual Value evaluate(ExecState *exec)
const;
894 CaseClauseNode *clause()
const {
return cl; }
895 ClauseListNode *
next()
const {
return nx; }
896 virtual void processVarDecls(ExecState *exec);
897 virtual void streamTo(SourceStream &s)
const;
899 friend class CaseBlockNode;
904 class CaseBlockNode:
public Node {
906 CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2);
908 virtual bool deref();
909 virtual Value evaluate(ExecState *exec)
const;
910 Completion evalBlock(ExecState *exec,
const Value& input)
const;
911 virtual void processVarDecls(ExecState *exec);
912 virtual void streamTo(SourceStream &s)
const;
914 ClauseListNode *list1;
916 ClauseListNode *list2;
919 class SwitchNode :
public StatementNode {
921 SwitchNode(Node *e, CaseBlockNode *b) : expr(e), block(b) { }
923 virtual bool deref();
924 virtual Completion execute(ExecState *exec);
925 virtual void processVarDecls(ExecState *exec);
926 virtual void streamTo(SourceStream &s)
const;
929 CaseBlockNode *block;
932 class LabelNode :
public StatementNode {
934 LabelNode(
const Identifier &l, StatementNode *s) :
label(l), statement(s) { }
936 virtual bool deref();
937 virtual Completion execute(ExecState *exec);
938 virtual void processVarDecls(ExecState *exec);
939 virtual void streamTo(SourceStream &s)
const;
942 StatementNode *statement;
945 class ThrowNode :
public StatementNode {
947 ThrowNode(Node *e) : expr(e) {}
949 virtual bool deref();
950 virtual Completion execute(ExecState *exec);
951 virtual void streamTo(SourceStream &s)
const;
956 class CatchNode :
public StatementNode {
958 CatchNode(
const Identifier &i, StatementNode *b) : ident(i), block(b) {}
960 virtual bool deref();
961 virtual Completion execute(ExecState *exec);
962 Completion execute(ExecState *exec,
const Value &arg);
963 virtual void processVarDecls(ExecState *exec);
964 virtual void streamTo(SourceStream &s)
const;
967 StatementNode *block;
970 class FinallyNode :
public StatementNode {
972 FinallyNode(StatementNode *b) : block(b) {}
974 virtual bool deref();
975 virtual Completion execute(ExecState *exec);
976 virtual void processVarDecls(ExecState *exec);
977 virtual void streamTo(SourceStream &s)
const;
979 StatementNode *block;
982 class TryNode :
public StatementNode {
984 TryNode(StatementNode *b, CatchNode *c)
985 : block(b), _catch(c), _final(0) {}
986 TryNode(StatementNode *b, FinallyNode *f)
987 : block(b), _catch(0), _final(f) {}
988 TryNode(StatementNode *b, CatchNode *c, FinallyNode *f)
989 : block(b), _catch(c), _final(f) {}
991 virtual bool deref();
992 virtual Completion execute(ExecState *exec);
993 virtual void processVarDecls(ExecState *exec);
994 virtual void streamTo(SourceStream &s)
const;
996 StatementNode *block;
1001 class ParameterNode :
public Node {
1004 ParameterNode(
const Identifier &i) : id(i),
next(this) { }
1005 ParameterNode(ParameterNode *list,
const Identifier &i)
1006 : id(i),
next(list->
next) { list->next =
this; }
1008 virtual bool deref();
1009 virtual Value evaluate(ExecState *exec)
const;
1010 Identifier ident()
const {
return id; }
1011 ParameterNode *nextParam()
const {
return next; }
1012 virtual void streamTo(SourceStream &s)
const;
1014 friend class FuncDeclNode;
1015 friend class FuncExprNode;
1017 ParameterNode *
next;
1021 class FunctionBodyNode :
public BlockNode {
1023 FunctionBodyNode(SourceElementsNode *s);
1024 virtual void processFuncDecl(ExecState *exec);
1027 class FuncDeclNode :
public StatementNode {
1029 FuncDeclNode(
const Identifier &i, FunctionBodyNode *b)
1030 : ident(i), param(0), body(b) { }
1031 FuncDeclNode(
const Identifier &i, ParameterNode *p, FunctionBodyNode *b)
1032 : ident(i), param(p->
next), body(b) { p->next = 0; }
1034 virtual bool deref();
1035 Completion execute(ExecState* )
1036 {
return Completion(); }
1037 void processFuncDecl(ExecState *exec);
1038 virtual void streamTo(SourceStream &s)
const;
1041 ParameterNode *param;
1042 FunctionBodyNode *body;
1045 class FuncExprNode :
public Node {
1047 FuncExprNode(
const Identifier &i, FunctionBodyNode *b)
1048 : ident(i), param(0), body(b) { }
1049 FuncExprNode(
const Identifier &i, ParameterNode *p, FunctionBodyNode *b)
1050 : ident(i), param(p->
next), body(b) { p->next = 0; }
1052 virtual bool deref();
1053 virtual Value evaluate(ExecState *exec)
const;
1054 virtual void streamTo(SourceStream &s)
const;
1057 ParameterNode *param;
1058 FunctionBodyNode *body;
1062 class SourceElementsNode :
public StatementNode {
1065 SourceElementsNode(StatementNode *s1);
1066 SourceElementsNode(SourceElementsNode *s1, StatementNode *s2);
1068 virtual bool deref();
1069 Completion execute(ExecState *exec);
1070 virtual void processFuncDecl(ExecState *exec);
1071 virtual void processVarDecls(ExecState *exec);
1072 virtual void streamTo(SourceStream &s)
const;
1074 friend class BlockNode;
1075 StatementNode *element;
1076 SourceElementsNode *elements;
expr1 && expr2, expr1 || expr2
The ternary operator, "logical ? expr1 : expr2".
Represents the current state of script execution.
static const Identifier & null()
Creates an empty Identifier.
Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents.
const TDEShortcut & next()
TQString name(StdAccel id)
TQString label(StdAccel id)