3 Extension module for the rfxswf library.
4 Part of the swftools package.
6 Copyright (c) 2009 Matthias Kramm <kramm@quiss.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
40 #define NODE_HAS_CHILDREN 1
45 typedcode_t (*write)(node_t*n);
46 typedcode_t (*read)(node_t*n);
47 code_t* (*exec)(node_t*n);
48 constant_t (*eval)(node_t*n);
51 extern nodetype_t node_plus;
52 extern nodetype_t node_minus;
53 extern nodetype_t node_lplusplus; //++x
54 extern nodetype_t node_lminusminus; //--x
55 extern nodetype_t node_rplusplus; //x++
56 extern nodetype_t node_rminusminus; //x--
57 extern nodetype_t node_multiply;
58 extern nodetype_t node_div;
59 extern nodetype_t node_mod;
60 extern nodetype_t node_dot;
61 extern nodetype_t node_lt;
62 extern nodetype_t node_gt;
63 extern nodetype_t node_le; //<=
64 extern nodetype_t node_ge; //>=
65 extern nodetype_t node_eqeq; //==
66 extern nodetype_t node_eqeqeq; //===
67 extern nodetype_t node_noteqeq; //!==
68 extern nodetype_t node_noteq; //!=
69 extern nodetype_t node_oror; //||
70 extern nodetype_t node_andand; //&&
71 extern nodetype_t node_not;
72 extern nodetype_t node_bitnot;
73 extern nodetype_t node_bitand;
74 extern nodetype_t node_bitxor;
75 extern nodetype_t node_bitor;
76 extern nodetype_t node_shr; //>>
77 extern nodetype_t node_shl; //<<
78 extern nodetype_t node_ushr; //>>>
79 extern nodetype_t node_in; //in
80 extern nodetype_t node_as; //as
81 extern nodetype_t node_instanceof; //instanceof
82 extern nodetype_t node_is; //is
83 extern nodetype_t node_typeof; //typeof
84 extern nodetype_t node_void; //void
85 extern nodetype_t node_neg; //-
86 extern nodetype_t node_muleq; //*=
87 extern nodetype_t node_modeq; //%=
88 extern nodetype_t node_shleq; //<<=
89 extern nodetype_t node_shreq; //>>=
90 extern nodetype_t node_ushreq; //>>>=
91 extern nodetype_t node_diveq; ///=
92 extern nodetype_t node_bitoreq; //|=
93 extern nodetype_t node_bitxoreq; //^=
94 extern nodetype_t node_bitandeq; //&=
95 extern nodetype_t node_pluseq; //+=
96 extern nodetype_t node_minuseq; //-=
97 extern nodetype_t node_assign; //-=
98 extern nodetype_t node_tenary; //?:
99 extern nodetype_t node_arraylookup; //x[y]
100 extern nodetype_t node_comma; //(y1,y2,...,yn)
102 extern nodetype_t node_const;
103 extern nodetype_t node_code;
106 extern nodetype_t node_dotdot; //..
107 extern nodetype_t node_dotat; //.@
108 extern nodetype_t node_dotstar; //.*
109 extern nodetype_t node_filter; //.(
110 extern nodetype_t node_new; //new
111 extern nodetype_t node_delete; //delete
112 extern nodetype_t node_call; //functioncall
113 extern nodetype_t node_at; //@
114 extern nodetype_t node_dotns; //.::
117 node_t* multinode_extend(node_t*n, node_t*add);
133 node_t* mkdummynode();
134 node_t* mkconstnode(constant_t*c);
135 node_t* mkcodenode(typedcode_t c);
136 node_t* mkstringnode(const char*s);
137 node_t* mkaddnode(node_t*n1, node_t*n2);
138 node_t* mkmultinode(nodetype_t*t, node_t*one);
139 node_t* mknode1(nodetype_t*t, node_t*node);
140 node_t* mknode2(nodetype_t*t, node_t*left, node_t*right);
141 node_t* mknode3(nodetype_t*t, node_t*one, node_t*two, node_t*three);
142 void node_free(node_t*n);
143 typedcode_t node_read(node_t*n); //read and free
144 code_t* node_exec(node_t*n); //exec and free
145 constant_t node_eval(node_t*n); //eval and free
146 void node_dump(node_t*n);