|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.QScintilla.Lexers.Lexer</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.QScintilla.Lexers.Lexer</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the lexer mixin class. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#Lexer">Lexer</a></td> |
|
25 <td>Class to implement the lexer mixin class.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="Lexer" ID="Lexer"></a> |
|
36 <h2>Lexer</h2> |
|
37 |
|
38 <p> |
|
39 Class to implement the lexer mixin class. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 None |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#Lexer.__init__">Lexer</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#Lexer.alwaysKeepTabs">alwaysKeepTabs</a></td> |
|
63 <td>Public method to check, if tab conversion is allowed.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#Lexer.autoCompletionWordSeparators">autoCompletionWordSeparators</a></td> |
|
67 <td>Public method to return the list of separators for autocompletion.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#Lexer.boxCommentStr">boxCommentStr</a></td> |
|
71 <td>Public method to return the box comment strings.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#Lexer.canBlockComment">canBlockComment</a></td> |
|
75 <td>Public method to determine, whether the lexer language supports a block comment.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#Lexer.canBoxComment">canBoxComment</a></td> |
|
79 <td>Public method to determine, whether the lexer language supports a box comment.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#Lexer.canStreamComment">canStreamComment</a></td> |
|
83 <td>Public method to determine, whether the lexer language supports a stream comment.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#Lexer.commentStr">commentStr</a></td> |
|
87 <td>Public method to return the comment string.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#Lexer.defaultKeywords">defaultKeywords</a></td> |
|
91 <td>Public method to get the default keywords.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#Lexer.hasSmartIndent">hasSmartIndent</a></td> |
|
95 <td>Public method indicating whether lexer can do smart indentation.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#Lexer.hasSubstyles">hasSubstyles</a></td> |
|
99 <td>Public method to indicate the support of sub-styles.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#Lexer.initProperties">initProperties</a></td> |
|
103 <td>Public slot to initialize the properties.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#Lexer.isCommentStyle">isCommentStyle</a></td> |
|
107 <td>Public method to check, if a style is a comment style.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#Lexer.isStringStyle">isStringStyle</a></td> |
|
111 <td>Public method to check, if a style is a string style.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#Lexer.keywords">keywords</a></td> |
|
115 <td>Public method to get the keywords.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#Lexer.keywordsDescription">keywordsDescription</a></td> |
|
119 <td>Public method to get the description for a keywords set.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#Lexer.lexerName">lexerName</a></td> |
|
123 <td>Public method to return the lexer name.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#Lexer.maximumKeywordSet">maximumKeywordSet</a></td> |
|
127 <td>Public method to get the maximum keyword set.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#Lexer.smartIndentLine">smartIndentLine</a></td> |
|
131 <td>Public method to handle smart indentation for a line.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#Lexer.smartIndentSelection">smartIndentSelection</a></td> |
|
135 <td>Public method to handle smart indentation for a selection of lines.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#Lexer.streamCommentStr">streamCommentStr</a></td> |
|
139 <td>Public method to return the stream comment strings.</td> |
|
140 </tr> |
|
141 </table> |
|
142 <h3>Static Methods</h3> |
|
143 |
|
144 <table> |
|
145 <tr><td>None</td></tr> |
|
146 </table> |
|
147 |
|
148 <a NAME="Lexer.__init__" ID="Lexer.__init__"></a> |
|
149 <h4>Lexer (Constructor)</h4> |
|
150 <b>Lexer</b>(<i></i>) |
|
151 |
|
152 <p> |
|
153 Constructor |
|
154 </p> |
|
155 <a NAME="Lexer.alwaysKeepTabs" ID="Lexer.alwaysKeepTabs"></a> |
|
156 <h4>Lexer.alwaysKeepTabs</h4> |
|
157 <b>alwaysKeepTabs</b>(<i></i>) |
|
158 |
|
159 <p> |
|
160 Public method to check, if tab conversion is allowed. |
|
161 </p> |
|
162 <dl> |
|
163 <dt>Return:</dt> |
|
164 <dd> |
|
165 flag indicating to keep tabs (boolean) |
|
166 </dd> |
|
167 </dl> |
|
168 <a NAME="Lexer.autoCompletionWordSeparators" ID="Lexer.autoCompletionWordSeparators"></a> |
|
169 <h4>Lexer.autoCompletionWordSeparators</h4> |
|
170 <b>autoCompletionWordSeparators</b>(<i></i>) |
|
171 |
|
172 <p> |
|
173 Public method to return the list of separators for autocompletion. |
|
174 </p> |
|
175 <dl> |
|
176 <dt>Return:</dt> |
|
177 <dd> |
|
178 list of separators (list of strings) |
|
179 </dd> |
|
180 </dl> |
|
181 <a NAME="Lexer.boxCommentStr" ID="Lexer.boxCommentStr"></a> |
|
182 <h4>Lexer.boxCommentStr</h4> |
|
183 <b>boxCommentStr</b>(<i></i>) |
|
184 |
|
185 <p> |
|
186 Public method to return the box comment strings. |
|
187 </p> |
|
188 <dl> |
|
189 <dt>Return:</dt> |
|
190 <dd> |
|
191 box comment strings (dictionary with three QStrings) |
|
192 </dd> |
|
193 </dl> |
|
194 <a NAME="Lexer.canBlockComment" ID="Lexer.canBlockComment"></a> |
|
195 <h4>Lexer.canBlockComment</h4> |
|
196 <b>canBlockComment</b>(<i></i>) |
|
197 |
|
198 <p> |
|
199 Public method to determine, whether the lexer language supports a |
|
200 block comment. |
|
201 </p> |
|
202 <dl> |
|
203 <dt>Return:</dt> |
|
204 <dd> |
|
205 flag (boolean) |
|
206 </dd> |
|
207 </dl> |
|
208 <a NAME="Lexer.canBoxComment" ID="Lexer.canBoxComment"></a> |
|
209 <h4>Lexer.canBoxComment</h4> |
|
210 <b>canBoxComment</b>(<i></i>) |
|
211 |
|
212 <p> |
|
213 Public method to determine, whether the lexer language supports a |
|
214 box comment. |
|
215 </p> |
|
216 <dl> |
|
217 <dt>Return:</dt> |
|
218 <dd> |
|
219 flag (boolean) |
|
220 </dd> |
|
221 </dl> |
|
222 <a NAME="Lexer.canStreamComment" ID="Lexer.canStreamComment"></a> |
|
223 <h4>Lexer.canStreamComment</h4> |
|
224 <b>canStreamComment</b>(<i></i>) |
|
225 |
|
226 <p> |
|
227 Public method to determine, whether the lexer language supports a |
|
228 stream comment. |
|
229 </p> |
|
230 <dl> |
|
231 <dt>Return:</dt> |
|
232 <dd> |
|
233 flag (boolean) |
|
234 </dd> |
|
235 </dl> |
|
236 <a NAME="Lexer.commentStr" ID="Lexer.commentStr"></a> |
|
237 <h4>Lexer.commentStr</h4> |
|
238 <b>commentStr</b>(<i></i>) |
|
239 |
|
240 <p> |
|
241 Public method to return the comment string. |
|
242 </p> |
|
243 <dl> |
|
244 <dt>Return:</dt> |
|
245 <dd> |
|
246 comment string (string) |
|
247 </dd> |
|
248 </dl> |
|
249 <a NAME="Lexer.defaultKeywords" ID="Lexer.defaultKeywords"></a> |
|
250 <h4>Lexer.defaultKeywords</h4> |
|
251 <b>defaultKeywords</b>(<i>kwSet</i>) |
|
252 |
|
253 <p> |
|
254 Public method to get the default keywords. |
|
255 </p> |
|
256 <dl> |
|
257 |
|
258 <dt><i>kwSet</i> (int)</dt> |
|
259 <dd> |
|
260 number of the keyword set |
|
261 </dd> |
|
262 </dl> |
|
263 <dl> |
|
264 <dt>Return:</dt> |
|
265 <dd> |
|
266 space separated list of keywords |
|
267 </dd> |
|
268 </dl> |
|
269 <dl> |
|
270 <dt>Return Type:</dt> |
|
271 <dd> |
|
272 str or None |
|
273 </dd> |
|
274 </dl> |
|
275 <a NAME="Lexer.hasSmartIndent" ID="Lexer.hasSmartIndent"></a> |
|
276 <h4>Lexer.hasSmartIndent</h4> |
|
277 <b>hasSmartIndent</b>(<i></i>) |
|
278 |
|
279 <p> |
|
280 Public method indicating whether lexer can do smart indentation. |
|
281 </p> |
|
282 <dl> |
|
283 <dt>Return:</dt> |
|
284 <dd> |
|
285 flag indicating availability of smartIndentLine and |
|
286 smartIndentSelection methods (boolean) |
|
287 </dd> |
|
288 </dl> |
|
289 <a NAME="Lexer.hasSubstyles" ID="Lexer.hasSubstyles"></a> |
|
290 <h4>Lexer.hasSubstyles</h4> |
|
291 <b>hasSubstyles</b>(<i></i>) |
|
292 |
|
293 <p> |
|
294 Public method to indicate the support of sub-styles. |
|
295 </p> |
|
296 <dl> |
|
297 <dt>Return:</dt> |
|
298 <dd> |
|
299 flag indicating sub-styling support |
|
300 </dd> |
|
301 </dl> |
|
302 <dl> |
|
303 <dt>Return Type:</dt> |
|
304 <dd> |
|
305 bool |
|
306 </dd> |
|
307 </dl> |
|
308 <a NAME="Lexer.initProperties" ID="Lexer.initProperties"></a> |
|
309 <h4>Lexer.initProperties</h4> |
|
310 <b>initProperties</b>(<i></i>) |
|
311 |
|
312 <p> |
|
313 Public slot to initialize the properties. |
|
314 </p> |
|
315 <a NAME="Lexer.isCommentStyle" ID="Lexer.isCommentStyle"></a> |
|
316 <h4>Lexer.isCommentStyle</h4> |
|
317 <b>isCommentStyle</b>(<i>style</i>) |
|
318 |
|
319 <p> |
|
320 Public method to check, if a style is a comment style. |
|
321 </p> |
|
322 <dl> |
|
323 |
|
324 <dt><i>style</i></dt> |
|
325 <dd> |
|
326 style to check (integer) |
|
327 </dd> |
|
328 </dl> |
|
329 <dl> |
|
330 <dt>Return:</dt> |
|
331 <dd> |
|
332 flag indicating a comment style (boolean) |
|
333 </dd> |
|
334 </dl> |
|
335 <a NAME="Lexer.isStringStyle" ID="Lexer.isStringStyle"></a> |
|
336 <h4>Lexer.isStringStyle</h4> |
|
337 <b>isStringStyle</b>(<i>style</i>) |
|
338 |
|
339 <p> |
|
340 Public method to check, if a style is a string style. |
|
341 </p> |
|
342 <dl> |
|
343 |
|
344 <dt><i>style</i></dt> |
|
345 <dd> |
|
346 style to check (integer) |
|
347 </dd> |
|
348 </dl> |
|
349 <dl> |
|
350 <dt>Return:</dt> |
|
351 <dd> |
|
352 flag indicating a string style (boolean) |
|
353 </dd> |
|
354 </dl> |
|
355 <a NAME="Lexer.keywords" ID="Lexer.keywords"></a> |
|
356 <h4>Lexer.keywords</h4> |
|
357 <b>keywords</b>(<i>kwSet</i>) |
|
358 |
|
359 <p> |
|
360 Public method to get the keywords. |
|
361 </p> |
|
362 <dl> |
|
363 |
|
364 <dt><i>kwSet</i> (int)</dt> |
|
365 <dd> |
|
366 number of the keyword set |
|
367 </dd> |
|
368 </dl> |
|
369 <dl> |
|
370 <dt>Return:</dt> |
|
371 <dd> |
|
372 space separated list of keywords |
|
373 </dd> |
|
374 </dl> |
|
375 <dl> |
|
376 <dt>Return Type:</dt> |
|
377 <dd> |
|
378 str or None |
|
379 </dd> |
|
380 </dl> |
|
381 <a NAME="Lexer.keywordsDescription" ID="Lexer.keywordsDescription"></a> |
|
382 <h4>Lexer.keywordsDescription</h4> |
|
383 <b>keywordsDescription</b>(<i>kwSet</i>) |
|
384 |
|
385 <p> |
|
386 Public method to get the description for a keywords set. |
|
387 </p> |
|
388 <dl> |
|
389 |
|
390 <dt><i>kwSet</i> (int)</dt> |
|
391 <dd> |
|
392 number of the keyword set |
|
393 </dd> |
|
394 </dl> |
|
395 <dl> |
|
396 <dt>Return:</dt> |
|
397 <dd> |
|
398 description of the keyword set |
|
399 </dd> |
|
400 </dl> |
|
401 <dl> |
|
402 <dt>Return Type:</dt> |
|
403 <dd> |
|
404 str |
|
405 </dd> |
|
406 </dl> |
|
407 <a NAME="Lexer.lexerName" ID="Lexer.lexerName"></a> |
|
408 <h4>Lexer.lexerName</h4> |
|
409 <b>lexerName</b>(<i></i>) |
|
410 |
|
411 <p> |
|
412 Public method to return the lexer name. |
|
413 </p> |
|
414 <dl> |
|
415 <dt>Return:</dt> |
|
416 <dd> |
|
417 lexer name (string) |
|
418 </dd> |
|
419 </dl> |
|
420 <a NAME="Lexer.maximumKeywordSet" ID="Lexer.maximumKeywordSet"></a> |
|
421 <h4>Lexer.maximumKeywordSet</h4> |
|
422 <b>maximumKeywordSet</b>(<i></i>) |
|
423 |
|
424 <p> |
|
425 Public method to get the maximum keyword set. |
|
426 </p> |
|
427 <p> |
|
428 Note: A return value of 0 indicates to determine this dynamically. |
|
429 </p> |
|
430 <dl> |
|
431 <dt>Return:</dt> |
|
432 <dd> |
|
433 maximum keyword set |
|
434 </dd> |
|
435 </dl> |
|
436 <dl> |
|
437 <dt>Return Type:</dt> |
|
438 <dd> |
|
439 int |
|
440 </dd> |
|
441 </dl> |
|
442 <a NAME="Lexer.smartIndentLine" ID="Lexer.smartIndentLine"></a> |
|
443 <h4>Lexer.smartIndentLine</h4> |
|
444 <b>smartIndentLine</b>(<i>editor</i>) |
|
445 |
|
446 <p> |
|
447 Public method to handle smart indentation for a line. |
|
448 </p> |
|
449 <dl> |
|
450 |
|
451 <dt><i>editor</i></dt> |
|
452 <dd> |
|
453 reference to the QScintilla editor object |
|
454 </dd> |
|
455 </dl> |
|
456 <a NAME="Lexer.smartIndentSelection" ID="Lexer.smartIndentSelection"></a> |
|
457 <h4>Lexer.smartIndentSelection</h4> |
|
458 <b>smartIndentSelection</b>(<i>editor</i>) |
|
459 |
|
460 <p> |
|
461 Public method to handle smart indentation for a selection of lines. |
|
462 </p> |
|
463 <p> |
|
464 Note: The assumption is, that the first line determines the new |
|
465 indentation level. |
|
466 </p> |
|
467 <dl> |
|
468 |
|
469 <dt><i>editor</i></dt> |
|
470 <dd> |
|
471 reference to the QScintilla editor object |
|
472 </dd> |
|
473 </dl> |
|
474 <a NAME="Lexer.streamCommentStr" ID="Lexer.streamCommentStr"></a> |
|
475 <h4>Lexer.streamCommentStr</h4> |
|
476 <b>streamCommentStr</b>(<i></i>) |
|
477 |
|
478 <p> |
|
479 Public method to return the stream comment strings. |
|
480 </p> |
|
481 <dl> |
|
482 <dt>Return:</dt> |
|
483 <dd> |
|
484 stream comment strings (dictionary with two strings) |
|
485 </dd> |
|
486 </dl> |
|
487 <div align="right"><a href="#top">Up</a></div> |
|
488 <hr /> |
|
489 </body></html> |