Documentation/Source/eric5.Utilities.ClassBrowsers.jsclbr.html

changeset 2779
4d433896b6d6
child 2966
f85f686981ad
equal deleted inserted replaced
2776:43b8060a4b44 2779:4d433896b6d6
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric5.Utilities.ClassBrowsers.jsclbr</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric5.Utilities.ClassBrowsers.jsclbr</h1>
23 <p>
24 Parse a JavaScript file and retrieve variables and functions.
25 </p><p>
26 It uses the JavaScript parser contained in the jasy web framework.
27 </p>
28 <h3>Global Attributes</h3>
29 <table>
30 <tr><td>SUPPORTED_TYPES</td></tr><tr><td>_modules</td></tr>
31 </table>
32 <h3>Classes</h3>
33 <table>
34 <tr>
35 <td><a href="#Attribute">Attribute</a></td>
36 <td>Class to represent a class attribute.</td>
37 </tr><tr>
38 <td><a href="#Function">Function</a></td>
39 <td>Class to represent a Python function.</td>
40 </tr><tr>
41 <td><a href="#VisibilityMixin">VisibilityMixin</a></td>
42 <td>Mixin class implementing the notion of visibility.</td>
43 </tr><tr>
44 <td><a href="#Visitor">Visitor</a></td>
45 <td>Class implementing a visitor going through the parsed tree.</td>
46 </tr>
47 </table>
48 <h3>Functions</h3>
49 <table>
50 <tr>
51 <td><a href="#readmodule_ex">readmodule_ex</a></td>
52 <td>Read a JavaScript file and return a dictionary of functions and variables.</td>
53 </tr>
54 </table>
55 <hr /><hr />
56 <a NAME="Attribute" ID="Attribute"></a>
57 <h2>Attribute</h2>
58 <p>
59 Class to represent a class attribute.
60 </p>
61 <h3>Derived from</h3>
62 ClbrBaseClasses.Attribute, VisibilityMixin
63 <h3>Class Attributes</h3>
64 <table>
65 <tr><td>None</td></tr>
66 </table>
67 <h3>Class Methods</h3>
68 <table>
69 <tr><td>None</td></tr>
70 </table>
71 <h3>Methods</h3>
72 <table>
73 <tr>
74 <td><a href="#Attribute.__init__">Attribute</a></td>
75 <td>Constructor</td>
76 </tr>
77 </table>
78 <h3>Static Methods</h3>
79 <table>
80 <tr><td>None</td></tr>
81 </table>
82 <a NAME="Attribute.__init__" ID="Attribute.__init__"></a>
83 <h4>Attribute (Constructor)</h4>
84 <b>Attribute</b>(<i>module, name, file, lineno</i>)
85 <p>
86 Constructor
87 </p><dl>
88 <dt><i>module</i></dt>
89 <dd>
90 name of the module containing this class
91 </dd><dt><i>name</i></dt>
92 <dd>
93 name of this class
94 </dd><dt><i>file</i></dt>
95 <dd>
96 filename containing this attribute
97 </dd><dt><i>lineno</i></dt>
98 <dd>
99 linenumber of the class definition
100 </dd>
101 </dl>
102 <div align="right"><a href="#top">Up</a></div>
103 <hr /><hr />
104 <a NAME="Function" ID="Function"></a>
105 <h2>Function</h2>
106 <p>
107 Class to represent a Python function.
108 </p>
109 <h3>Derived from</h3>
110 ClbrBaseClasses.Function, VisibilityMixin
111 <h3>Class Attributes</h3>
112 <table>
113 <tr><td>None</td></tr>
114 </table>
115 <h3>Class Methods</h3>
116 <table>
117 <tr><td>None</td></tr>
118 </table>
119 <h3>Methods</h3>
120 <table>
121 <tr>
122 <td><a href="#Function.__init__">Function</a></td>
123 <td>Constructor</td>
124 </tr>
125 </table>
126 <h3>Static Methods</h3>
127 <table>
128 <tr><td>None</td></tr>
129 </table>
130 <a NAME="Function.__init__" ID="Function.__init__"></a>
131 <h4>Function (Constructor)</h4>
132 <b>Function</b>(<i>module, name, file, lineno, signature='', separator=', '</i>)
133 <p>
134 Constructor
135 </p><dl>
136 <dt><i>module</i></dt>
137 <dd>
138 name of the module containing this function
139 </dd><dt><i>name</i></dt>
140 <dd>
141 name of this function
142 </dd><dt><i>file</i></dt>
143 <dd>
144 filename containing this class
145 </dd><dt><i>lineno</i></dt>
146 <dd>
147 linenumber of the class definition
148 </dd><dt><i>signature</i></dt>
149 <dd>
150 parameterlist of the method
151 </dd><dt><i>separator</i></dt>
152 <dd>
153 string separating the parameters
154 </dd>
155 </dl>
156 <div align="right"><a href="#top">Up</a></div>
157 <hr /><hr />
158 <a NAME="VisibilityMixin" ID="VisibilityMixin"></a>
159 <h2>VisibilityMixin</h2>
160 <p>
161 Mixin class implementing the notion of visibility.
162 </p>
163 <h3>Derived from</h3>
164 ClbrBaseClasses.ClbrVisibilityMixinBase
165 <h3>Class Attributes</h3>
166 <table>
167 <tr><td>None</td></tr>
168 </table>
169 <h3>Class Methods</h3>
170 <table>
171 <tr><td>None</td></tr>
172 </table>
173 <h3>Methods</h3>
174 <table>
175 <tr>
176 <td><a href="#VisibilityMixin.__init__">VisibilityMixin</a></td>
177 <td>Method to initialize the visibility.</td>
178 </tr>
179 </table>
180 <h3>Static Methods</h3>
181 <table>
182 <tr><td>None</td></tr>
183 </table>
184 <a NAME="VisibilityMixin.__init__" ID="VisibilityMixin.__init__"></a>
185 <h4>VisibilityMixin (Constructor)</h4>
186 <b>VisibilityMixin</b>(<i></i>)
187 <p>
188 Method to initialize the visibility.
189 </p>
190 <div align="right"><a href="#top">Up</a></div>
191 <hr /><hr />
192 <a NAME="Visitor" ID="Visitor"></a>
193 <h2>Visitor</h2>
194 <p>
195 Class implementing a visitor going through the parsed tree.
196 </p>
197 <h3>Derived from</h3>
198 object
199 <h3>Class Attributes</h3>
200 <table>
201 <tr><td>None</td></tr>
202 </table>
203 <h3>Class Methods</h3>
204 <table>
205 <tr><td>None</td></tr>
206 </table>
207 <h3>Methods</h3>
208 <table>
209 <tr>
210 <td><a href="#Visitor.__init__">Visitor</a></td>
211 <td>Constructor</td>
212 </tr><tr>
213 <td><a href="#Visitor.__visit">__visit</a></td>
214 <td>Private method implementing the visit logic delegating to interesting methods.</td>
215 </tr><tr>
216 <td><a href="#Visitor.parse">parse</a></td>
217 <td>Public method to parse the source.</td>
218 </tr><tr>
219 <td><a href="#Visitor.visit_const">visit_const</a></td>
220 <td>Public method to treat a constant node.</td>
221 </tr><tr>
222 <td><a href="#Visitor.visit_function">visit_function</a></td>
223 <td>Public method to treat a function node.</td>
224 </tr><tr>
225 <td><a href="#Visitor.visit_noop">visit_noop</a></td>
226 <td>Public method to ignore the given node.</td>
227 </tr><tr>
228 <td><a href="#Visitor.visit_property_init">visit_property_init</a></td>
229 <td>Public method to treat a property_init node.</td>
230 </tr><tr>
231 <td><a href="#Visitor.visit_var">visit_var</a></td>
232 <td>Public method to treat a variable node.</td>
233 </tr>
234 </table>
235 <h3>Static Methods</h3>
236 <table>
237 <tr><td>None</td></tr>
238 </table>
239 <a NAME="Visitor.__init__" ID="Visitor.__init__"></a>
240 <h4>Visitor (Constructor)</h4>
241 <b>Visitor</b>(<i>src, module, filename</i>)
242 <p>
243 Constructor
244 </p><dl>
245 <dt><i>src</i></dt>
246 <dd>
247 source to be parsed (string)
248 </dd><dt><i>module</i></dt>
249 <dd>
250 name of the module (string)
251 </dd><dt><i>filename</i></dt>
252 <dd>
253 file name (string)
254 </dd>
255 </dl><a NAME="Visitor.__visit" ID="Visitor.__visit"></a>
256 <h4>Visitor.__visit</h4>
257 <b>__visit</b>(<i>root</i>)
258 <p>
259 Private method implementing the visit logic delegating to interesting methods.
260 </p><a NAME="Visitor.parse" ID="Visitor.parse"></a>
261 <h4>Visitor.parse</h4>
262 <b>parse</b>(<i></i>)
263 <p>
264 Public method to parse the source.
265 </p><dl>
266 <dt>Returns:</dt>
267 <dd>
268 dictionary containing the parsed information
269 </dd>
270 </dl><a NAME="Visitor.visit_const" ID="Visitor.visit_const"></a>
271 <h4>Visitor.visit_const</h4>
272 <b>visit_const</b>(<i>node</i>)
273 <p>
274 Public method to treat a constant node.
275 </p><dl>
276 <dt><i>node</i></dt>
277 <dd>
278 reference to the node (jasy.js.parse.Node.Node)
279 </dd>
280 </dl><a NAME="Visitor.visit_function" ID="Visitor.visit_function"></a>
281 <h4>Visitor.visit_function</h4>
282 <b>visit_function</b>(<i>node</i>)
283 <p>
284 Public method to treat a function node.
285 </p><dl>
286 <dt><i>node</i></dt>
287 <dd>
288 reference to the node (jasy.js.parse.Node.Node)
289 </dd>
290 </dl><a NAME="Visitor.visit_noop" ID="Visitor.visit_noop"></a>
291 <h4>Visitor.visit_noop</h4>
292 <b>visit_noop</b>(<i>node</i>)
293 <p>
294 Public method to ignore the given node.
295 </p><dl>
296 <dt><i>node</i></dt>
297 <dd>
298 reference to the node (jasy.js.parse.Node.Node)
299 </dd>
300 </dl><a NAME="Visitor.visit_property_init" ID="Visitor.visit_property_init"></a>
301 <h4>Visitor.visit_property_init</h4>
302 <b>visit_property_init</b>(<i>node</i>)
303 <p>
304 Public method to treat a property_init node.
305 </p><dl>
306 <dt><i>node</i></dt>
307 <dd>
308 reference to the node (jasy.js.parse.Node.Node)
309 </dd>
310 </dl><a NAME="Visitor.visit_var" ID="Visitor.visit_var"></a>
311 <h4>Visitor.visit_var</h4>
312 <b>visit_var</b>(<i>node</i>)
313 <p>
314 Public method to treat a variable node.
315 </p><dl>
316 <dt><i>node</i></dt>
317 <dd>
318 reference to the node (jasy.js.parse.Node.Node)
319 </dd>
320 </dl>
321 <div align="right"><a href="#top">Up</a></div>
322 <hr /><hr />
323 <a NAME="readmodule_ex" ID="readmodule_ex"></a>
324 <h2>readmodule_ex</h2>
325 <b>readmodule_ex</b>(<i>module, path=[]</i>)
326 <p>
327 Read a JavaScript file and return a dictionary of functions and variables.
328 </p><dl>
329 <dt><i>module</i></dt>
330 <dd>
331 name of the JavaScript file (string)
332 </dd><dt><i>path</i></dt>
333 <dd>
334 path the file should be searched in (list of strings)
335 </dd>
336 </dl><dl>
337 <dt>Returns:</dt>
338 <dd>
339 the resulting dictionary
340 </dd>
341 </dl>
342 <div align="right"><a href="#top">Up</a></div>
343 <hr />
344 </body></html>

eric ide

mercurial