author | convert-repo |
Fri, 06 Jul 2018 03:31:58 +0000 | |
changeset 18262 | 18e456b91b31 |
parent 18166 | 20d62f930706 |
child 18492 | 56d86f63cd35 |
permissions | -rw-r--r-- |
17988 | 1 |
"{ Encoding: utf8 }" |
2 |
||
9891 | 3 |
" |
4 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libtool' }" |
|
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
List subclass:#TagList |
|
13342 | 19 |
instanceVariableNames:'rawList filteredList filter tagsValidForFile sortCriteria groupBy |
14346 | 20 |
showOnly flags tagTypesPresent usingDefaultCTags ctagsCommand |
21 |
ctagsIsExCtags ctagsIsExCtags5x remoteTarget' |
|
9891 | 22 |
classVariableNames:'Sorted CachedTagListsPerFile DefaultSortCriteria DefaultShowOnly |
23 |
TagsSuffixes DefaultGroupBy' |
|
24 |
poolDictionaries:'' |
|
25 |
category:'Interface-Tools-File-Tags' |
|
26 |
! |
|
27 |
||
28 |
!TagList class methodsFor:'documentation'! |
|
29 |
||
30 |
copyright |
|
31 |
" |
|
32 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
33 |
All Rights Reserved |
|
34 |
||
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
||
42 |
||
43 |
" |
|
10054 | 44 |
! |
45 |
||
46 |
documentation |
|
47 |
" |
|
48 |
a list of tags as read & generated from parsing a source file. |
|
49 |
For some languages, naive parsing is supported right here; |
|
50 |
for other languages, external tools (ctags) are used. |
|
51 |
The tags are used bz the tagList or to navigate quickly to some |
|
52 |
function in the C-browser. |
|
53 |
" |
|
9891 | 54 |
! ! |
55 |
||
14482 | 56 |
!TagList class methodsFor:'accessing - suffixes'! |
9891 | 57 |
|
58 |
tagsSuffixes |
|
59 |
"flush with: |
|
60 |
TagsSuffixes := nil |
|
61 |
" |
|
62 |
TagsSuffixes notNil ifTrue:[ |
|
63 |
^ TagsSuffixes |
|
64 |
]. |
|
65 |
TagsSuffixes := IdentityDictionary new. |
|
66 |
||
67 |
TagsSuffixes at:#'text/asm' put:#( 's' 'asm' ). |
|
14482 | 68 |
TagsSuffixes at:#'text/c' put:#( 'c' 'h' 'ci' 'hi' 'sc' 'sth'). |
9891 | 69 |
TagsSuffixes at:#'text/cpp' put:#( 'cc' 'cpp' 'cxx' 'c++' 'hxx' 'hpp' 'h++'). |
16280 | 70 |
TagsSuffixes at:#'text/x-objcsrc' put:#( 'm'). |
9891 | 71 |
TagsSuffixes at:#'text/eiffel' put:#( 'e' 'eif' ). |
72 |
TagsSuffixes at:#'text/fortran' put:#( 'f' 'for' 'ftn' 'f77' 'f90' ). |
|
73 |
TagsSuffixes at:#'text/html' put:#( 'htm' 'html'). |
|
14482 | 74 |
TagsSuffixes at:#'text/java' put:#( 'java' 'jav' 'j'). |
9891 | 75 |
TagsSuffixes at:#'text/javaScript' put:#( 'js' ). |
76 |
TagsSuffixes at:#'text/javascript' put:#( 'js' ). |
|
77 |
TagsSuffixes at:#'application/x-javascript' put:#( 'js' ). |
|
11766 | 78 |
TagsSuffixes at:#'text/dart' put:#( 'dart' ). |
79 |
TagsSuffixes at:#'application/x-dart' put:#( 'dart' ). |
|
9891 | 80 |
TagsSuffixes at:#'text/make' put:#( 'makefile' 'make.proto' 'makefile.*' '*.mak' '*.bpr'). |
81 |
TagsSuffixes at:#'text/prolog' put:#( 'pl' ). |
|
82 |
TagsSuffixes at:#'text/python' put:#( 'py' ). |
|
83 |
TagsSuffixes at:#'text/php' put:#( 'php' ). |
|
84 |
TagsSuffixes at:#'text/lisp' put:#( 'lisp' 'el' 'lsp' 'cl'). |
|
85 |
TagsSuffixes at:#'text/lisp-arc' put:#( 'arc' ). |
|
17988 | 86 |
TagsSuffixes at:#'text/scheme' put:#( 'scm' 'ss' 'brg' 'sch'). |
9891 | 87 |
TagsSuffixes at:#'text/oz' put:#( 'oz'). |
14345 | 88 |
TagsSuffixes at:#'text/lua' put:#( 'lua'). |
16181 | 89 |
TagsSuffixes at:#'text/smalltalk' put:#( 'st' 'ST' 'St' 'Prj'). |
9891 | 90 |
TagsSuffixes at:#'text/tcl' put:#( 'tcl' ). |
91 |
TagsSuffixes at:#'text/ruby' put:#( 'rb' ). |
|
92 |
TagsSuffixes at:#'text/yacc' put:#( 'y' ). |
|
11825 | 93 |
TagsSuffixes at:#'text/batch' put:#( 'bat' ). |
15685 | 94 |
TagsSuffixes at:#'text/xml-xsd' put:#( 'xsd' ). |
9891 | 95 |
^ TagsSuffixes |
96 |
||
11825 | 97 |
"Modified: / 28-09-2012 / 14:48:25 / cg" |
9891 | 98 |
! ! |
99 |
||
100 |
!TagList class methodsFor:'defaults'! |
|
101 |
||
102 |
arcLispSuffixes |
|
103 |
"returns a list of supported arc-lisp-suffixes" |
|
104 |
||
105 |
^ self tagsSuffixes at:#'text/lisp-arc' |
|
106 |
! |
|
107 |
||
108 |
assemblerSuffixes |
|
109 |
"returns a list of supported assembler-suffixes" |
|
110 |
||
111 |
^ self tagsSuffixes at:#'text/asm' |
|
112 |
! |
|
113 |
||
11825 | 114 |
batchSuffixes |
115 |
"returns a list of supported batchfile-suffixes |
|
116 |
" |
|
117 |
^ self tagsSuffixes at:#'text/batch' |
|
118 |
||
119 |
"Created: / 28-09-2012 / 14:48:41 / cg" |
|
120 |
! |
|
121 |
||
9891 | 122 |
cPlusPlusSuffixes |
123 |
"returns a list of supported c-suffixes" |
|
124 |
||
125 |
^ self tagsSuffixes at:#'text/cpp' |
|
126 |
! |
|
127 |
||
128 |
cSuffixes |
|
129 |
"returns a list of supported c-suffixes" |
|
130 |
||
131 |
^ self tagsSuffixes at:#'text/c' |
|
132 |
! |
|
133 |
||
134 |
commonLispSuffixes |
|
135 |
"returns a list of supported common-lisp-suffixes" |
|
136 |
||
137 |
^ self tagsSuffixes at:#'text/lisp' |
|
138 |
! |
|
139 |
||
11766 | 140 |
dartSuffixes |
141 |
"returns a list of supported dart-suffixes" |
|
142 |
||
143 |
^ self tagsSuffixes at:#'text/dart' |
|
144 |
||
145 |
"Created: / 22-08-2012 / 21:01:32 / cg" |
|
146 |
! |
|
147 |
||
9891 | 148 |
eiffelSuffixes |
149 |
"returns a list of supported eiffel-suffixes |
|
150 |
" |
|
151 |
^ self tagsSuffixes at:#'text/eiffel' |
|
152 |
! |
|
153 |
||
154 |
fortranSuffixes |
|
155 |
"returns a list of supported fortran-suffixes |
|
156 |
" |
|
157 |
^ self tagsSuffixes at:#'text/fortran' |
|
158 |
! |
|
159 |
||
160 |
htmlSuffixes |
|
161 |
"returns a list of supported html-suffixes |
|
162 |
" |
|
163 |
^ self tagsSuffixes at:#'text/html' |
|
164 |
||
165 |
"Created: / 20-04-2011 / 19:03:39 / cg" |
|
166 |
! |
|
167 |
||
168 |
isTagSearchableSuffix:aSuffix |
|
169 |
"returns true, if aSuffix looks ok for ctags |
|
170 |
" |
|
171 |
self tagsSuffixes keysAndValuesDo:[:tag :suffixes | |
|
172 |
(suffixes includes:aSuffix) ifTrue:[^ true]. |
|
173 |
]. |
|
174 |
"/ (self cSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
175 |
"/ (self javaSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
176 |
"/ (self fortranSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
177 |
"/ (self eiffelSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
178 |
"/ (self commonLispSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
179 |
"/ (self schemeSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
180 |
^ false |
|
181 |
! |
|
182 |
||
183 |
javaScriptSuffixes |
|
184 |
"returns a list of supported javaScript-suffixes" |
|
185 |
||
186 |
^ self tagsSuffixes at:#'text/javaScript' |
|
187 |
||
188 |
"Created: / 28-06-2010 / 12:44:58 / cg" |
|
189 |
! |
|
190 |
||
191 |
javaSuffixes |
|
192 |
"returns a list of supported java-suffixes |
|
193 |
" |
|
194 |
^ self tagsSuffixes at:#'text/java' |
|
195 |
! |
|
196 |
||
14345 | 197 |
luaSuffixes |
198 |
"returns a list of supported lua-suffixes |
|
199 |
" |
|
200 |
^ self tagsSuffixes at:#'text/lua' |
|
201 |
! |
|
202 |
||
9891 | 203 |
makeFilePatterns |
204 |
"returns a list of makefile match patterns |
|
205 |
" |
|
206 |
^ self tagsSuffixes at:#'text/make' |
|
207 |
! |
|
208 |
||
16280 | 209 |
objcSuffixes |
210 |
"returns a list of supported c-suffixes" |
|
211 |
||
212 |
^ self tagsSuffixes at:#'text/x-objcsrc' |
|
213 |
! |
|
214 |
||
9891 | 215 |
ozSuffixes |
216 |
"returns a list of supported oz-suffixes |
|
217 |
" |
|
218 |
^ self tagsSuffixes at:#'text/oz' |
|
219 |
! |
|
220 |
||
221 |
phpSuffixes |
|
222 |
"returns a list of supported php-suffixes" |
|
223 |
||
224 |
^ self tagsSuffixes at:#'text/php' |
|
225 |
! |
|
226 |
||
10840 | 227 |
pltSchemeLispSuffixes |
228 |
^ #('plt') |
|
229 |
||
230 |
"Created: / 21-10-2011 / 09:32:20 / cg" |
|
231 |
! |
|
232 |
||
9891 | 233 |
prologSuffixes |
234 |
"returns a list of supported prolog-suffixes |
|
235 |
" |
|
236 |
^ self tagsSuffixes at:#'text/prolog' |
|
237 |
! |
|
238 |
||
239 |
pythonSuffixes |
|
240 |
"returns a list of supported python-suffixes |
|
241 |
" |
|
242 |
^ self tagsSuffixes at:#'text/python' |
|
243 |
! |
|
244 |
||
10840 | 245 |
racketSchemeLispSuffixes |
246 |
^ #('rkt') |
|
247 |
||
248 |
"Created: / 21-10-2011 / 09:32:27 / cg" |
|
249 |
! |
|
250 |
||
9891 | 251 |
rubySuffixes |
252 |
"returns a list of supported ruby-suffixes |
|
253 |
" |
|
254 |
^ self tagsSuffixes at:#'text/ruby' |
|
255 |
! |
|
256 |
||
257 |
schemeSuffixes |
|
258 |
"returns a list of supported scheme-lisp-suffixes |
|
259 |
" |
|
260 |
^ self tagsSuffixes at:#'text/scheme' |
|
261 |
! |
|
262 |
||
263 |
smalltalkSuffixes |
|
264 |
"returns a list of supported smalltalk-suffixes |
|
265 |
" |
|
266 |
^ self tagsSuffixes at:#'text/smalltalk' |
|
267 |
! |
|
268 |
||
269 |
tclSuffixes |
|
270 |
"returns a list of supported tcl-suffixes |
|
271 |
" |
|
272 |
^ self tagsSuffixes at:#'text/tcl' |
|
273 |
! |
|
274 |
||
15685 | 275 |
xsdSuffixes |
276 |
"returns a list of supported xsd-suffixes |
|
277 |
" |
|
278 |
^ self tagsSuffixes at:#'text/xml-xsd' |
|
279 |
! |
|
280 |
||
9891 | 281 |
yaccSuffixes |
282 |
"returns a list of supported yacc-suffixes |
|
283 |
" |
|
284 |
^ self tagsSuffixes at:#'text/yacc' |
|
285 |
! ! |
|
286 |
||
287 |
!TagList class methodsFor:'queries'! |
|
288 |
||
289 |
isArcLispSuffix:suffix |
|
290 |
^ self isSuffix:suffix in:self arcLispSuffixes |
|
291 |
! |
|
292 |
||
293 |
isAssemblerSuffix:suffix |
|
294 |
^ self isSuffix:suffix in:self assemblerSuffixes |
|
295 |
! |
|
296 |
||
11825 | 297 |
isBatchSuffix:suffix |
298 |
^ self isSuffix:suffix in:self batchSuffixes |
|
299 |
||
300 |
"Created: / 28-09-2012 / 14:47:43 / cg" |
|
301 |
! |
|
302 |
||
14481 | 303 |
isCOrCPlusPlusSuffix:suffix |
304 |
^ (self isCSuffix:suffix) or:[self isCPlusPlusSuffix:suffix] |
|
305 |
! |
|
306 |
||
9891 | 307 |
isCPlusPlusSuffix:suffix |
308 |
^ self isSuffix:suffix in:self cPlusPlusSuffixes |
|
309 |
! |
|
310 |
||
311 |
isCSuffix:suffix |
|
312 |
^ self isSuffix:suffix in:self cSuffixes |
|
313 |
! |
|
314 |
||
315 |
isCommonLispSuffix:suffix |
|
316 |
^ self isSuffix:suffix in:self commonLispSuffixes |
|
317 |
! |
|
318 |
||
11766 | 319 |
isDartSuffix:suffix |
320 |
^ self isSuffix:suffix in:self dartSuffixes |
|
321 |
||
322 |
"Created: / 22-08-2012 / 21:01:10 / cg" |
|
323 |
! |
|
324 |
||
9891 | 325 |
isEiffelSuffix:suffix |
326 |
^ self isSuffix:suffix in:self eiffelSuffixes |
|
327 |
! |
|
328 |
||
329 |
isFortranSuffix:suffix |
|
330 |
^ self isSuffix:suffix in:self fortranSuffixes |
|
331 |
! |
|
332 |
||
333 |
isHTMLSuffix:suffix |
|
334 |
^ self isSuffix:suffix in:self htmlSuffixes |
|
335 |
||
336 |
"Created: / 20-04-2011 / 19:03:26 / cg" |
|
337 |
! |
|
338 |
||
339 |
isJavaScriptSuffix:suffix |
|
340 |
^ self isSuffix:suffix in:self javaScriptSuffixes |
|
341 |
||
342 |
"Created: / 28-06-2010 / 12:44:47 / cg" |
|
343 |
! |
|
344 |
||
345 |
isJavaSuffix:suffix |
|
346 |
^ self isSuffix:suffix in:self javaSuffixes |
|
347 |
! |
|
348 |
||
349 |
isLispSuffix:suffix |
|
350 |
^ (self isCommonLispSuffix:suffix) |
|
351 |
or:[(self isSchemeSuffix:suffix) |
|
10840 | 352 |
or:[(self isArcLispSuffix:suffix) |
353 |
or:[(self isPltSchemeLispSuffix:suffix) |
|
354 |
or:[(self isRacketSchemeLispSuffix:suffix)]]]] |
|
355 |
||
356 |
"Modified: / 21-10-2011 / 09:31:30 / cg" |
|
9891 | 357 |
! |
358 |
||
14345 | 359 |
isLuaSuffix:suffix |
360 |
^ self isSuffix:suffix in:self luaSuffixes |
|
361 |
! |
|
362 |
||
9891 | 363 |
isMakefileName:fileName |
364 |
|lcName| |
|
365 |
||
366 |
lcName := fileName asFilename baseName asLowercase. |
|
367 |
self makeFilePatterns do:[:aPattern | |
|
368 |
(aPattern match:lcName) ifTrue:[ ^ true ]. |
|
369 |
]. |
|
370 |
^ false |
|
371 |
! |
|
372 |
||
16280 | 373 |
isObjcSuffix:suffix |
374 |
^ self isSuffix:suffix in:self objcSuffixes |
|
375 |
! |
|
376 |
||
9891 | 377 |
isOzSuffix:suffix |
378 |
^ self isSuffix:suffix in:self ozSuffixes |
|
379 |
! |
|
380 |
||
381 |
isPhpSuffix:suffix |
|
382 |
^ self isSuffix:suffix in:self phpSuffixes |
|
383 |
! |
|
384 |
||
10840 | 385 |
isPltSchemeLispSuffix:suffix |
386 |
^ self isSuffix:suffix in:self pltSchemeLispSuffixes |
|
387 |
||
388 |
"Created: / 21-10-2011 / 09:30:56 / cg" |
|
389 |
! |
|
390 |
||
9891 | 391 |
isPrologSuffix:suffix |
392 |
^ self isSuffix:suffix in:self prologSuffixes |
|
393 |
! |
|
394 |
||
395 |
isPythonSuffix:suffix |
|
396 |
^ self isSuffix:suffix in:self pythonSuffixes |
|
397 |
! |
|
398 |
||
10840 | 399 |
isRacketSchemeLispSuffix:suffix |
400 |
^ self isSuffix:suffix in:self racketSchemeLispSuffixes |
|
401 |
||
402 |
"Created: / 21-10-2011 / 09:31:04 / cg" |
|
403 |
! |
|
404 |
||
9891 | 405 |
isRubySuffix:suffix |
406 |
^ self isSuffix:suffix in:self rubySuffixes |
|
407 |
! |
|
408 |
||
409 |
isSchemeSuffix:suffix |
|
410 |
^ self isSuffix:suffix in:self schemeSuffixes |
|
411 |
! |
|
412 |
||
413 |
isSmalltalkSuffix:suffix |
|
414 |
^ self isSuffix:suffix in:self smalltalkSuffixes |
|
415 |
! |
|
416 |
||
417 |
isTCLSuffix:suffix |
|
418 |
^ self isSuffix:suffix in:self tclSuffixes |
|
419 |
! |
|
420 |
||
15685 | 421 |
isXSDSuffix:suffix |
422 |
^ self isSuffix:suffix in:self xsdSuffixes |
|
423 |
! |
|
424 |
||
9891 | 425 |
isYaccSuffix:suffix |
426 |
^ self isSuffix:suffix in:self yaccSuffixes |
|
427 |
! ! |
|
428 |
||
429 |
!TagList class methodsFor:'queries basic'! |
|
430 |
||
431 |
isSuffix:suffix in:patterns |
|
432 |
|lcSuffix| |
|
433 |
||
434 |
lcSuffix := suffix asLowercase. |
|
435 |
^ patterns contains:[:pattern | pattern match:lcSuffix]. |
|
436 |
! |
|
437 |
||
438 |
tagMimeTypeForFile:aFile |
|
17378 | 439 |
"returns the tag-mimetype for a file or nil" |
440 |
||
441 |
|suff file list name| |
|
9891 | 442 |
|
443 |
aFile isNil ifTrue:[^ nil]. |
|
444 |
||
445 |
file := aFile asFilename. |
|
17378 | 446 |
suff := file asNonBackupFilename suffix asLowercase. |
447 |
||
448 |
(suff = 'bak' or:[suff = 'sav']) ifTrue:[ |
|
449 |
file := file asFilename withoutSuffix. |
|
450 |
suff := file suffix asLowercase. |
|
9891 | 451 |
]. |
17378 | 452 |
|
9891 | 453 |
list := self tagsSuffixes. |
454 |
||
455 |
" hack to test for make-file patterns " |
|
456 |
name := file baseName asLowercase. |
|
17378 | 457 |
|
458 |
((list at:#'text/make') contains:[:pattern | pattern match:name]) ifTrue:[ |
|
459 |
^ #'text/make' |
|
9891 | 460 |
]. |
461 |
||
462 |
self tagsSuffixes keysAndValuesDo:[:mimeType :suffixes| |
|
14365 | 463 |
(suffixes includes:suff) ifTrue:[ |
464 |
^ mimeType |
|
465 |
] |
|
9891 | 466 |
]. |
14365 | 467 |
^ aFile asFilename mimeTypeOfContents |
468 |
"/ ^ nil |
|
17378 | 469 |
|
470 |
"Modified (comment): / 09-02-2017 / 14:10:51 / stefan" |
|
9891 | 471 |
! ! |
472 |
||
473 |
!TagList class methodsFor:'tag generation'! |
|
474 |
||
475 |
cachedTagsFromFile:aFilename in:aTempDirectory |
|
476 |
"retrieve a cached tagList for a file" |
|
477 |
||
478 |
|tagList cached fileTime suffix| |
|
479 |
||
480 |
fileTime := aFilename modificationTime. |
|
481 |
||
482 |
CachedTagListsPerFile isNil ifTrue:[ |
|
483 |
CachedTagListsPerFile := Dictionary new. |
|
484 |
]. |
|
485 |
cached := CachedTagListsPerFile at:aFilename ifAbsent:nil. |
|
486 |
cached notNil ifTrue:[ |
|
487 |
fileTime > cached tagTimestamp ifFalse:[ |
|
488 |
^ cached tagList |
|
489 |
] |
|
490 |
]. |
|
491 |
suffix := aFilename suffix. |
|
492 |
||
493 |
"/ ((self isCSuffix:suffix) |
|
494 |
"/ or:[(self isJavaSuffix:suffix) |
|
495 |
"/ or:[(self isFortranSuffix:suffix) |
|
496 |
"/ or:[(self isEiffelSuffix:suffix)]]]) |
|
497 |
"/ ifFalse:[ |
|
498 |
"/ ^ #() |
|
499 |
"/ ]. |
|
500 |
tagList := self new. |
|
501 |
tagList showOnly:nil. |
|
502 |
tagList fromFile:aFilename in:aTempDirectory. |
|
14442 | 503 |
tagList do:[:eachTag | eachTag fileName:aFilename]. |
9891 | 504 |
|
505 |
CachedTagListsPerFile at:aFilename put:(CachedTags new tagList:tagList; tagTimestamp:fileTime; yourself). |
|
506 |
^ tagList |
|
507 |
||
508 |
"Modified: / 07-06-2010 / 12:13:25 / cg" |
|
509 |
! |
|
510 |
||
511 |
cachedTagsFromFile:aFilename in:aTempDirectory buildTargetHandler:aTargetHandler remote:aBoolean |
|
512 |
"retrieve a cached tagList for a file" |
|
513 |
||
514 |
^ self cachedTagsFromFile:aFilename in:aTempDirectory. |
|
515 |
! |
|
516 |
||
517 |
flushCachedTags |
|
518 |
CachedTagListsPerFile := nil |
|
519 |
||
520 |
" |
|
521 |
self flushCachedTags |
|
522 |
" |
|
523 |
! |
|
524 |
||
525 |
makeTargetTagsInFile:aMakefilePath |
|
526 |
"makefile tags: |
|
527 |
naive, q&d scan for lines ending with a colon |
|
528 |
" |
|
529 |
^ self makeTargetTagsInFile:aMakefilePath filter:nil |
|
530 |
! |
|
531 |
||
532 |
makeTargetTagsInFile:aMakefilePath filter:showOnly |
|
533 |
"makefile tags: |
|
534 |
naive, q&d scan for lines ending with a colon |
|
535 |
" |
|
536 |
|targets| |
|
537 |
||
538 |
Tag autoload. |
|
539 |
||
540 |
targets := OrderedCollection new. |
|
541 |
aMakefilePath asFilename contents keysAndValuesDo:[:lnr :line | |
|
542 |
|idxColon idxAssign varName target| |
|
543 |
||
544 |
line size > 0 ifTrue:[ |
|
545 |
line first isSeparator ifFalse:[ |
|
546 |
(line startsWith:$#) ifFalse:[ |
|
547 |
idxAssign := line indexOf:$=. |
|
548 |
idxAssign ~~ 0 ifTrue:[ |
|
549 |
showOnly ~~ #targets ifTrue:[ |
|
550 |
varName := line copyFrom:1 to:idxAssign - 1. |
|
551 |
targets add:(Tag::TVariable |
|
552 |
label:varName |
|
553 |
pattern:('/^',varName,'=') |
|
554 |
type:nil |
|
555 |
lineNumber:lnr) |
|
556 |
] |
|
557 |
] ifFalse:[ |
|
558 |
idxColon := line indexOf:$:. |
|
559 |
idxColon ~~ 0 ifTrue:[ |
|
560 |
target := line copyFrom:1 to:idxColon - 1. |
|
561 |
"/ ignore macro-targets |
|
562 |
||
563 |
(target includes:$$) ifFalse:[ |
|
564 |
(target startsWith:$.) ifFalse:[ |
|
565 |
"/ normal targets |
|
566 |
targets add:(Tag::TMakeTarget |
|
567 |
label:target |
|
568 |
pattern:('/^',target,':') |
|
569 |
type:nil |
|
570 |
lineNumber:lnr) |
|
571 |
] ifTrue:[ |
|
572 |
"/ rule-targets |
|
573 |
targets add:(Tag::TMakeRule |
|
574 |
label:target |
|
575 |
pattern:('/^',target,':') |
|
576 |
type:nil |
|
577 |
lineNumber:lnr) |
|
578 |
] |
|
579 |
] ifTrue:[ |
|
580 |
"/ rule-targets |
|
581 |
targets add:(Tag::TMakeTarget |
|
582 |
label:target |
|
583 |
pattern:('/^',target,':') |
|
584 |
type:nil |
|
585 |
lineNumber:lnr) |
|
586 |
]. |
|
587 |
] |
|
588 |
] |
|
589 |
] |
|
590 |
] |
|
591 |
] |
|
592 |
]. |
|
593 |
^ targets |
|
594 |
! ! |
|
595 |
||
13631 | 596 |
!TagList methodsFor:'accessing'! |
597 |
||
598 |
tagTypesPresent:aBoolean |
|
599 |
tagTypesPresent := aBoolean. |
|
600 |
! ! |
|
601 |
||
9891 | 602 |
!TagList methodsFor:'accessing-filters'! |
603 |
||
14579 | 604 |
anchorsOnly |
605 |
^ showOnly == #anchors |
|
606 |
! |
|
607 |
||
608 |
anchorsOnly:aBoolean |
|
609 |
showOnly := DefaultShowOnly := nil. |
|
610 |
aBoolean ifTrue:[ |
|
611 |
showOnly := "DefaultShowOnly :=" #anchors |
|
612 |
]. |
|
613 |
||
614 |
"Created: / 08-05-2011 / 10:11:39 / cg" |
|
615 |
! |
|
616 |
||
17552 | 617 |
classesAndFunctionsOnly |
618 |
^ showOnly == #classesAndFunctions |
|
619 |
||
620 |
"Created: / 22-06-2017 / 10:34:41 / cg" |
|
621 |
! |
|
622 |
||
623 |
classesAndFunctionsOnly:aBoolean |
|
624 |
showOnly := nil. |
|
625 |
aBoolean ifTrue:[ |
|
626 |
showOnly := DefaultShowOnly := #classesAndFunctions |
|
627 |
]. |
|
628 |
||
629 |
"Created: / 22-06-2017 / 10:34:48 / cg" |
|
630 |
! |
|
631 |
||
632 |
classesAndMethodsOnly |
|
633 |
^ showOnly == #classesAndMethods |
|
634 |
||
635 |
"Created: / 22-06-2017 / 10:23:33 / cg" |
|
636 |
! |
|
637 |
||
638 |
classesAndMethodsOnly:aBoolean |
|
639 |
showOnly := nil. |
|
640 |
aBoolean ifTrue:[ |
|
641 |
showOnly := DefaultShowOnly := #classesAndMethods |
|
642 |
]. |
|
643 |
||
644 |
"Created: / 22-06-2017 / 10:23:48 / cg" |
|
645 |
! |
|
646 |
||
9891 | 647 |
classesFunctionsAndVariablesOnly |
648 |
^ showOnly == #classesFunctionsAndVariables |
|
649 |
||
650 |
"Modified: / 07-06-2010 / 14:18:09 / cg" |
|
651 |
! |
|
652 |
||
653 |
classesFunctionsAndVariablesOnly:aBoolean |
|
654 |
showOnly := nil. |
|
655 |
aBoolean ifTrue:[ |
|
656 |
showOnly := DefaultShowOnly := #classesFunctionsAndVariables |
|
657 |
]. |
|
658 |
||
659 |
"Modified: / 05-05-2011 / 15:21:53 / cg" |
|
660 |
! |
|
661 |
||
662 |
classesOnly |
|
663 |
^ showOnly == #classes |
|
664 |
||
665 |
"Modified: / 07-06-2010 / 14:18:12 / cg" |
|
666 |
! |
|
667 |
||
668 |
classesOnly:aBoolean |
|
669 |
showOnly := nil. |
|
670 |
aBoolean ifTrue:[ |
|
671 |
showOnly := DefaultShowOnly := #classes |
|
672 |
]. |
|
673 |
||
674 |
"Modified: / 05-05-2011 / 15:21:56 / cg" |
|
675 |
! |
|
676 |
||
11762 | 677 |
dartClassesAndMethodsOnly |
17555 | 678 |
<resource: #obsolete> |
17552 | 679 |
^ self classesAndMethodsOnly |
680 |
"/ ^ showOnly == #dartClassesAndMethods |
|
681 |
||
682 |
"Modified: / 22-06-2017 / 10:23:59 / cg" |
|
11762 | 683 |
! |
684 |
||
685 |
dartClassesAndMethodsOnly:aBoolean |
|
17555 | 686 |
<resource: #obsolete> |
17552 | 687 |
self classesAndMethodsOnly:aBoolean |
688 |
"/ showOnly := nil. |
|
689 |
"/ aBoolean ifTrue:[ |
|
690 |
"/ showOnly := DefaultShowOnly := #dartClassesAndMethods |
|
691 |
"/ ]. |
|
692 |
||
693 |
"Modified: / 22-06-2017 / 10:24:11 / cg" |
|
11762 | 694 |
! |
695 |
||
696 |
dartClassesOnly |
|
17555 | 697 |
<resource: #obsolete> |
17552 | 698 |
^ self classesOnly |
699 |
"/ ^ showOnly == #dartClasses |
|
700 |
||
701 |
"Modified: / 22-06-2017 / 10:36:58 / cg" |
|
11762 | 702 |
! |
703 |
||
704 |
dartClassesOnly:aBoolean |
|
17555 | 705 |
<resource: #obsolete> |
17552 | 706 |
self classesOnly:aBoolean |
707 |
"/ showOnly := nil. |
|
708 |
"/ aBoolean ifTrue:[ |
|
709 |
"/ showOnly := DefaultShowOnly := #dartClasses |
|
710 |
"/ ]. |
|
711 |
||
712 |
"Modified: / 22-06-2017 / 10:35:23 / cg" |
|
11762 | 713 |
! |
714 |
||
715 |
dartMethodsOnly |
|
17555 | 716 |
<resource: #obsolete> |
17552 | 717 |
^ self methodsOnly |
718 |
"/ ^ showOnly == #dartMethods |
|
719 |
||
720 |
"Modified: / 22-06-2017 / 10:37:27 / cg" |
|
11762 | 721 |
! |
722 |
||
723 |
dartMethodsOnly:aBoolean |
|
17555 | 724 |
<resource: #obsolete> |
17552 | 725 |
self methodsOnly:aBoolean |
726 |
"/ showOnly := nil. |
|
727 |
"/ aBoolean ifTrue:[ |
|
728 |
"/ showOnly := DefaultShowOnly := #dartMethods |
|
729 |
"/ ]. |
|
730 |
||
731 |
"Modified: / 22-06-2017 / 10:37:19 / cg" |
|
11762 | 732 |
! |
733 |
||
9891 | 734 |
definesOnly |
735 |
^ showOnly == #defines |
|
736 |
||
737 |
"Modified: / 07-06-2010 / 14:18:15 / cg" |
|
738 |
! |
|
739 |
||
740 |
definesOnly:aBoolean |
|
741 |
showOnly := nil. |
|
742 |
aBoolean ifTrue:[ |
|
743 |
showOnly := DefaultShowOnly := #defines |
|
744 |
]. |
|
745 |
||
746 |
"Modified: / 05-05-2011 / 15:21:58 / cg" |
|
747 |
! |
|
748 |
||
9921 | 749 |
documentationOnly |
750 |
^ showOnly == #documentation |
|
751 |
||
752 |
"Created: / 08-05-2011 / 10:11:47 / cg" |
|
753 |
! |
|
754 |
||
755 |
documentationOnly:aBoolean |
|
756 |
showOnly := DefaultShowOnly := nil. |
|
757 |
aBoolean ifTrue:[ |
|
758 |
showOnly := "DefaultShowOnly :=" #documentation |
|
759 |
]. |
|
760 |
||
761 |
"Created: / 08-05-2011 / 10:11:39 / cg" |
|
762 |
! |
|
763 |
||
13311 | 764 |
filter:aStringOrNil |
765 |
(filter ? '') ~= (aStringOrNil ? '') ifTrue:[ |
|
766 |
filter := aStringOrNil. |
|
9891 | 767 |
rawList notNil ifTrue:[ |
768 |
self updateContentsFromRawList |
|
769 |
]. |
|
770 |
]. |
|
771 |
||
772 |
"Modified: / 05-05-2011 / 14:43:04 / cg" |
|
773 |
! |
|
774 |
||
14346 | 775 |
flagNamed:aSymbol |
776 |
^ flags at:aSymbol ifAbsent:false |
|
777 |
! |
|
778 |
||
779 |
flagNamed:aSymbol put:aBoolean |
|
780 |
flags at:aSymbol put:aBoolean |
|
781 |
! |
|
782 |
||
9891 | 783 |
functionsAndVariablesOnly |
784 |
^ showOnly == #functionsAndVariables |
|
785 |
||
786 |
"Modified: / 07-06-2010 / 14:18:05 / cg" |
|
787 |
! |
|
788 |
||
789 |
functionsAndVariablesOnly:aBoolean |
|
790 |
showOnly := nil. |
|
791 |
aBoolean ifTrue:[ |
|
792 |
showOnly := DefaultShowOnly := #functionsAndVariables |
|
793 |
]. |
|
794 |
||
795 |
"Modified: / 05-05-2011 / 15:22:01 / cg" |
|
796 |
! |
|
797 |
||
798 |
functionsOnly |
|
799 |
^ showOnly == #functions |
|
800 |
||
801 |
"Modified: / 07-06-2010 / 14:17:54 / cg" |
|
802 |
! |
|
803 |
||
804 |
functionsOnly:aBoolean |
|
805 |
showOnly := nil. |
|
806 |
aBoolean ifTrue:[ |
|
807 |
showOnly := DefaultShowOnly := #functions |
|
808 |
]. |
|
809 |
||
810 |
"Modified: / 05-05-2011 / 15:22:03 / cg" |
|
811 |
! |
|
812 |
||
14579 | 813 |
headlinesOnly |
814 |
^ showOnly == #headlines |
|
815 |
! |
|
816 |
||
817 |
headlinesOnly:aBoolean |
|
818 |
showOnly := DefaultShowOnly := nil. |
|
819 |
aBoolean ifTrue:[ |
|
820 |
showOnly := "DefaultShowOnly :=" #headlines |
|
821 |
]. |
|
822 |
! |
|
823 |
||
9891 | 824 |
hideClasses |
14346 | 825 |
^ self flagNamed:#hideClasses |
9891 | 826 |
! |
827 |
||
828 |
hideClasses:aBoolean |
|
14346 | 829 |
self flagNamed:#hideClasses put:aBoolean |
9891 | 830 |
|
831 |
"Modified: / 05-05-2011 / 15:22:08 / cg" |
|
832 |
! |
|
833 |
||
11762 | 834 |
hideDartClasses |
17555 | 835 |
<resource: #obsolete> |
17552 | 836 |
^ self hideClasses |
837 |
"/ ^ self flagNamed:#hideDartClasses |
|
838 |
||
839 |
"Modified: / 22-06-2017 / 10:42:35 / cg" |
|
11762 | 840 |
! |
841 |
||
842 |
hideDartClasses:aBoolean |
|
17555 | 843 |
<resource: #obsolete> |
17552 | 844 |
self hideClasses:aBoolean |
845 |
"/ self flagNamed:#hideDartClasses put:aBoolean |
|
846 |
||
847 |
"Modified: / 22-06-2017 / 10:42:46 / cg" |
|
11762 | 848 |
! |
849 |
||
850 |
hideDartFields |
|
17555 | 851 |
<resource: #obsolete> |
17552 | 852 |
^ self hideFields |
853 |
"/ ^ self flagNamed:#hideDartFields |
|
854 |
||
855 |
"Modified: / 22-06-2017 / 10:58:54 / cg" |
|
11762 | 856 |
! |
857 |
||
858 |
hideDartFields:aBoolean |
|
17555 | 859 |
<resource: #obsolete> |
17552 | 860 |
self hideFields:aBoolean |
861 |
"/ self flagNamed:#hideDartFields put:aBoolean |
|
862 |
||
863 |
"Modified: / 22-06-2017 / 10:59:02 / cg" |
|
11762 | 864 |
! |
865 |
||
866 |
hideDartInterfaces |
|
17555 | 867 |
<resource: #obsolete> |
17552 | 868 |
^ self hideInterfaces |
869 |
"/ ^ self flagNamed:#hideDartInterfaces |
|
870 |
||
871 |
"Modified: / 22-06-2017 / 10:43:12 / cg" |
|
11762 | 872 |
! |
873 |
||
874 |
hideDartInterfaces:aBoolean |
|
17555 | 875 |
<resource: #obsolete> |
17552 | 876 |
self hideInterfaces:aBoolean |
877 |
"/ self flagNamed:#hideDartInterfaces put:aBoolean |
|
878 |
||
879 |
"Modified: / 22-06-2017 / 10:43:04 / cg" |
|
11762 | 880 |
! |
881 |
||
882 |
hideDartMethods |
|
17555 | 883 |
<resource: #obsolete> |
17552 | 884 |
^ self hideMethods |
885 |
"/ ^ self flagNamed:#hideDartMethods |
|
886 |
||
887 |
"Modified: / 22-06-2017 / 10:43:22 / cg" |
|
11762 | 888 |
! |
889 |
||
890 |
hideDartMethods:aBoolean |
|
17555 | 891 |
<resource: #obsolete> |
17552 | 892 |
self hideMethods:aBoolean |
893 |
"/ self flagNamed:#hideDartMethods put:aBoolean. |
|
894 |
||
895 |
"Modified: / 22-06-2017 / 10:43:31 / cg" |
|
11762 | 896 |
! |
897 |
||
898 |
hideDartPackages |
|
17555 | 899 |
<resource: #obsolete> |
17552 | 900 |
^ self hidePackages |
901 |
"/ ^ self flagNamed:#hideDartPackages |
|
902 |
||
903 |
"Modified: / 22-06-2017 / 10:44:16 / cg" |
|
11762 | 904 |
! |
905 |
||
906 |
hideDartPackages:aBoolean |
|
17555 | 907 |
<resource: #obsolete> |
17552 | 908 |
self hidePackages:aBoolean |
909 |
"/ self flagNamed:#hideDartPackages put:aBoolean. |
|
910 |
||
911 |
"Modified: / 22-06-2017 / 10:44:26 / cg" |
|
11762 | 912 |
! |
913 |
||
9891 | 914 |
hideDataLabels |
14346 | 915 |
^ self flagNamed:#hideDataLabels |
9891 | 916 |
! |
917 |
||
918 |
hideDataLabels:aBoolean |
|
14346 | 919 |
self flagNamed:#hideDataLabels put:aBoolean. |
9891 | 920 |
|
921 |
"Modified: / 05-05-2011 / 15:22:10 / cg" |
|
922 |
! |
|
923 |
||
924 |
hideDefines |
|
14346 | 925 |
^ self flagNamed:#hideDefines |
9891 | 926 |
! |
927 |
||
928 |
hideDefines:aBoolean |
|
14346 | 929 |
self flagNamed:#hideDefines put:aBoolean. |
9891 | 930 |
|
931 |
"Modified: / 05-05-2011 / 15:22:12 / cg" |
|
932 |
! |
|
933 |
||
9921 | 934 |
hideDocumentation |
14346 | 935 |
^ self flagNamed:#hideDocumentation |
9921 | 936 |
|
937 |
"Created: / 08-05-2011 / 10:11:02 / cg" |
|
938 |
! |
|
939 |
||
940 |
hideDocumentation:aBoolean |
|
14346 | 941 |
self flagNamed:#hideDocumentation put:aBoolean. |
9921 | 942 |
|
943 |
"Created: / 08-05-2011 / 10:11:06 / cg" |
|
944 |
! |
|
945 |
||
17552 | 946 |
hideFields |
947 |
^ self flagNamed:#hideFields |
|
948 |
||
949 |
"Created: / 22-06-2017 / 10:57:40 / cg" |
|
950 |
! |
|
951 |
||
952 |
hideFields:aBoolean |
|
953 |
self flagNamed:#hideFields put:aBoolean. |
|
954 |
||
955 |
"Created: / 22-06-2017 / 10:57:50 / cg" |
|
956 |
! |
|
957 |
||
9891 | 958 |
hideFunctionProtoTypes |
14346 | 959 |
^ self flagNamed:#hideFunctionProtoTypes |
9891 | 960 |
! |
961 |
||
962 |
hideFunctionProtoTypes:aBoolean |
|
14346 | 963 |
self flagNamed:#hideFunctionProtoTypes put:aBoolean. |
9891 | 964 |
|
965 |
"Modified: / 05-05-2011 / 15:22:14 / cg" |
|
966 |
! |
|
967 |
||
968 |
hideFunctions |
|
14346 | 969 |
^ self flagNamed:#hideFunctions |
9891 | 970 |
! |
971 |
||
972 |
hideFunctions:aBoolean |
|
14346 | 973 |
self flagNamed:#hideFunctions put:aBoolean. |
9891 | 974 |
|
975 |
"Modified: / 05-05-2011 / 15:22:18 / cg" |
|
976 |
! |
|
977 |
||
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
978 |
hideHTMLHeaders |
14346 | 979 |
^ self flagNamed:#hideHTMLHeaders |
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
980 |
|
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
981 |
"Created: / 12-09-2012 / 12:29:45 / cg" |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
982 |
! |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
983 |
|
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
984 |
hideHTMLHeaders:aBoolean |
14346 | 985 |
self flagNamed:#hideHTMLHeaders put:aBoolean. |
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
986 |
|
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
987 |
"Created: / 12-09-2012 / 12:29:52 / cg" |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
988 |
! |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
989 |
|
9891 | 990 |
hideHTMLInput |
14346 | 991 |
^ self flagNamed:#hideHTMLInput |
9891 | 992 |
|
993 |
"Created: / 20-04-2011 / 19:01:04 / cg" |
|
994 |
! |
|
995 |
||
996 |
hideHTMLInput:aBoolean |
|
14346 | 997 |
self flagNamed:#hideHTMLInput put:aBoolean. |
9891 | 998 |
|
999 |
"Created: / 20-04-2011 / 19:01:32 / cg" |
|
1000 |
"Modified: / 05-05-2011 / 15:22:21 / cg" |
|
1001 |
! |
|
1002 |
||
1003 |
hideHTMLScript |
|
14346 | 1004 |
^ self flagNamed:#hideHTMLScript |
9891 | 1005 |
|
1006 |
"Created: / 20-04-2011 / 19:00:32 / cg" |
|
1007 |
! |
|
1008 |
||
1009 |
hideHTMLScript:aBoolean |
|
14346 | 1010 |
self flagNamed:#hideHTMLScript put:aBoolean. |
9891 | 1011 |
|
1012 |
"Created: / 20-04-2011 / 19:01:32 / cg" |
|
1013 |
"Modified: / 05-05-2011 / 15:22:23 / cg" |
|
1014 |
! |
|
1015 |
||
1016 |
hideHTMLTable |
|
14346 | 1017 |
^ self flagNamed:#hideHTMLTable |
9891 | 1018 |
|
1019 |
"Created: / 20-04-2011 / 19:01:23 / cg" |
|
1020 |
! |
|
1021 |
||
1022 |
hideHTMLTable:aBoolean |
|
14346 | 1023 |
self flagNamed:#hideHTMLTable put:aBoolean. |
9891 | 1024 |
|
1025 |
"Created: / 20-04-2011 / 19:01:48 / cg" |
|
1026 |
"Modified: / 05-05-2011 / 15:22:26 / cg" |
|
1027 |
! |
|
1028 |
||
1029 |
hideHTMLTextArea |
|
14346 | 1030 |
^ self flagNamed:#hideHTMLTextArea |
9891 | 1031 |
|
1032 |
"Created: / 20-04-2011 / 19:00:55 / cg" |
|
1033 |
! |
|
1034 |
||
1035 |
hideHTMLTextArea:aBoolean |
|
14346 | 1036 |
self flagNamed:#hideHTMLTextArea put:aBoolean. |
9891 | 1037 |
|
1038 |
"Created: / 20-04-2011 / 19:01:58 / cg" |
|
1039 |
"Modified: / 05-05-2011 / 15:22:28 / cg" |
|
1040 |
! |
|
1041 |
||
17552 | 1042 |
hideInterfaces |
1043 |
^ self flagNamed:#hideInterfaces |
|
1044 |
||
1045 |
"Created: / 22-06-2017 / 10:41:12 / cg" |
|
1046 |
! |
|
1047 |
||
1048 |
hideInterfaces:aBoolean |
|
1049 |
self flagNamed:#hideInterfaces put:aBoolean |
|
1050 |
||
1051 |
"Created: / 22-06-2017 / 10:41:22 / cg" |
|
1052 |
! |
|
1053 |
||
9891 | 1054 |
hideJavaClasses |
17555 | 1055 |
<resource: #obsolete> |
17552 | 1056 |
^ self hideClasses |
1057 |
"/ ^ self flagNamed:#hideJavaClasses |
|
1058 |
||
1059 |
"Modified: / 22-06-2017 / 10:42:12 / cg" |
|
9891 | 1060 |
! |
1061 |
||
1062 |
hideJavaClasses:aBoolean |
|
17555 | 1063 |
<resource: #obsolete> |
17552 | 1064 |
self hideClasses:aBoolean |
1065 |
"/ self flagNamed:#hideJavaClasses put:aBoolean |
|
1066 |
||
1067 |
"Modified: / 22-06-2017 / 10:44:50 / cg" |
|
9891 | 1068 |
! |
1069 |
||
1070 |
hideJavaFields |
|
17555 | 1071 |
<resource: #obsolete> |
17552 | 1072 |
^ self hideFields |
1073 |
"/ ^ self flagNamed:#hideJavaFields |
|
1074 |
||
1075 |
"Modified: / 22-06-2017 / 10:58:03 / cg" |
|
9891 | 1076 |
! |
1077 |
||
1078 |
hideJavaFields:aBoolean |
|
17555 | 1079 |
<resource: #obsolete> |
17552 | 1080 |
self hideFields:aBoolean |
1081 |
"/ self flagNamed:#hideJavaFields put:aBoolean. |
|
1082 |
||
1083 |
"Modified: / 22-06-2017 / 10:58:13 / cg" |
|
9891 | 1084 |
! |
1085 |
||
1086 |
hideJavaInterfaces |
|
17555 | 1087 |
<resource: #obsolete> |
17552 | 1088 |
^ self hideInterfaces |
1089 |
"/ ^ self flagNamed:#hideJavaInterfaces |
|
1090 |
||
1091 |
"Modified: / 22-06-2017 / 10:45:05 / cg" |
|
9891 | 1092 |
! |
1093 |
||
1094 |
hideJavaInterfaces:aBoolean |
|
17555 | 1095 |
<resource: #obsolete> |
17552 | 1096 |
self hideInterfaces:aBoolean |
1097 |
"/ self flagNamed:#hideJavaInterfaces put:aBoolean. |
|
1098 |
||
1099 |
"Modified: / 22-06-2017 / 10:45:20 / cg" |
|
9891 | 1100 |
! |
1101 |
||
1102 |
hideJavaMethods |
|
17555 | 1103 |
<resource: #obsolete> |
17552 | 1104 |
^ self hideMethods |
1105 |
"/ ^ self flagNamed:#hideJavaMethods |
|
1106 |
||
1107 |
"Modified: / 22-06-2017 / 10:45:38 / cg" |
|
9891 | 1108 |
! |
1109 |
||
1110 |
hideJavaMethods:aBoolean |
|
17555 | 1111 |
<resource: #obsolete> |
17552 | 1112 |
self hideMethods:aBoolean |
1113 |
"/ self flagNamed:#hideJavaMethods put:aBoolean. |
|
1114 |
||
1115 |
"Modified: / 22-06-2017 / 10:45:30 / cg" |
|
9891 | 1116 |
! |
1117 |
||
1118 |
hideJavaPackages |
|
17555 | 1119 |
<resource: #obsolete> |
17552 | 1120 |
^ self hidePackages |
1121 |
"/ ^ self flagNamed:#hideJavaPackages |
|
1122 |
||
1123 |
"Modified: / 22-06-2017 / 10:45:47 / cg" |
|
9891 | 1124 |
! |
1125 |
||
1126 |
hideJavaPackages:aBoolean |
|
17555 | 1127 |
<resource: #obsolete> |
17552 | 1128 |
self hidePackages:aBoolean |
1129 |
"/ self flagNamed:#hideJavaPackages put:aBoolean. |
|
1130 |
||
1131 |
"Modified: / 22-06-2017 / 10:46:00 / cg" |
|
9891 | 1132 |
! |
1133 |
||
14385 | 1134 |
hideLabels |
1135 |
^ self flagNamed:#hideLabels |
|
1136 |
! |
|
1137 |
||
1138 |
hideLabels:aBoolean |
|
1139 |
self flagNamed:#hideLabels put:aBoolean. |
|
1140 |
||
1141 |
"Modified: / 05-05-2011 / 15:22:46 / cg" |
|
1142 |
! |
|
1143 |
||
9891 | 1144 |
hideLispConstants |
14346 | 1145 |
^ self flagNamed:#hideLispConstants |
9891 | 1146 |
! |
1147 |
||
1148 |
hideLispConstants:aBoolean |
|
14346 | 1149 |
self flagNamed:#hideLispConstants put:aBoolean. |
9891 | 1150 |
|
1151 |
"Modified: / 05-05-2011 / 15:22:46 / cg" |
|
1152 |
! |
|
1153 |
||
1154 |
hideLispEvaluations |
|
14346 | 1155 |
^ self flagNamed:#hideLispEvaluations |
9891 | 1156 |
! |
1157 |
||
1158 |
hideLispEvaluations:aBoolean |
|
14346 | 1159 |
self flagNamed:#hideLispEvaluations put:aBoolean. |
9891 | 1160 |
|
1161 |
"Modified: / 05-05-2011 / 15:22:49 / cg" |
|
1162 |
! |
|
1163 |
||
1164 |
hideLispMacros |
|
14346 | 1165 |
^ self flagNamed:#hideLispMacros |
9891 | 1166 |
! |
1167 |
||
1168 |
hideLispMacros:aBoolean |
|
14346 | 1169 |
self flagNamed:#hideLispMacros put:aBoolean. |
9891 | 1170 |
|
1171 |
"Modified: / 05-05-2011 / 15:22:50 / cg" |
|
1172 |
! |
|
1173 |
||
1174 |
hideLispMethods |
|
14346 | 1175 |
^ self flagNamed:#hideLispMethods |
9891 | 1176 |
! |
1177 |
||
1178 |
hideLispMethods:aBoolean |
|
14346 | 1179 |
self flagNamed:#hideLispMethods put:aBoolean. |
9891 | 1180 |
|
1181 |
"Modified: / 05-05-2011 / 15:22:53 / cg" |
|
1182 |
! |
|
1183 |
||
1184 |
hideLocalLabels |
|
14346 | 1185 |
^ self flagNamed:#hideLocalLabels |
9891 | 1186 |
! |
1187 |
||
11466 | 1188 |
hideLocalLabels2 |
14346 | 1189 |
^ self flagNamed:#hideLocalLabels2 |
11466 | 1190 |
|
1191 |
"Created: / 24-03-2012 / 23:23:15 / cg" |
|
1192 |
! |
|
1193 |
||
1194 |
hideLocalLabels2:aBoolean |
|
14346 | 1195 |
self flagNamed:#hideLocalLabels2 put:aBoolean. |
11466 | 1196 |
|
1197 |
"Modified: / 05-05-2011 / 15:22:54 / cg" |
|
1198 |
"Created: / 24-03-2012 / 23:23:20 / cg" |
|
1199 |
! |
|
1200 |
||
11502 | 1201 |
hideLocalLabels3 |
14346 | 1202 |
^ self flagNamed:#hideLocalLabels3 |
11502 | 1203 |
|
1204 |
"Created: / 13-05-2012 / 11:12:37 / cg" |
|
1205 |
! |
|
1206 |
||
1207 |
hideLocalLabels3:aBoolean |
|
14346 | 1208 |
self flagNamed:#hideLocalLabels3 put:aBoolean. |
11502 | 1209 |
|
1210 |
"Modified: / 05-05-2011 / 15:22:54 / cg" |
|
1211 |
"Created: / 13-05-2012 / 11:12:42 / cg" |
|
1212 |
! |
|
1213 |
||
9891 | 1214 |
hideLocalLabels:aBoolean |
14346 | 1215 |
self flagNamed:#hideLocalLabels put:aBoolean. |
9891 | 1216 |
|
1217 |
"Modified: / 05-05-2011 / 15:22:54 / cg" |
|
1218 |
! |
|
1219 |
||
14346 | 1220 |
hideLuaFunctions |
17555 | 1221 |
<resource: #obsolete> |
17552 | 1222 |
^ self hideFunctions |
1223 |
"/ ^ self flagNamed:#hideLuaFunctions |
|
1224 |
||
1225 |
"Modified: / 22-06-2017 / 10:46:20 / cg" |
|
14346 | 1226 |
! |
1227 |
||
1228 |
hideLuaFunctions:aBoolean |
|
17555 | 1229 |
<resource: #obsolete> |
17552 | 1230 |
self hideFunctions:aBoolean |
1231 |
"/ self flagNamed:#hideLuaFunctions put:aBoolean |
|
1232 |
||
1233 |
"Modified: / 22-06-2017 / 10:46:30 / cg" |
|
14346 | 1234 |
! |
1235 |
||
11762 | 1236 |
hideMethods |
14346 | 1237 |
^ self flagNamed:#hideMethods |
11762 | 1238 |
|
1239 |
"Created: / 21-08-2012 / 21:02:24 / cg" |
|
1240 |
! |
|
1241 |
||
1242 |
hideMethods:aBoolean |
|
14346 | 1243 |
self flagNamed:#hideMethods put:aBoolean. |
11762 | 1244 |
|
1245 |
"Created: / 21-08-2012 / 21:01:38 / cg" |
|
1246 |
! |
|
1247 |
||
16280 | 1248 |
hideObjcClasses |
17555 | 1249 |
<resource: #obsolete> |
17552 | 1250 |
^ self hideClasses |
1251 |
"/ ^ self flagNamed:#hideObjcClasses |
|
1252 |
||
1253 |
"Modified: / 22-06-2017 / 10:46:40 / cg" |
|
16280 | 1254 |
! |
1255 |
||
1256 |
hideObjcClasses:aBoolean |
|
17555 | 1257 |
<resource: #obsolete> |
17552 | 1258 |
self hideClasses:aBoolean |
1259 |
"/ self flagNamed:#hideObjcClasses put:aBoolean. |
|
1260 |
||
1261 |
"Modified: / 22-06-2017 / 10:46:51 / cg" |
|
16280 | 1262 |
! |
1263 |
||
1264 |
hideObjcMethods |
|
17555 | 1265 |
<resource: #obsolete> |
17552 | 1266 |
^ self hideMethods |
1267 |
"/ ^ self flagNamed:#hideObjcMethods |
|
1268 |
||
1269 |
"Modified: / 22-06-2017 / 10:46:58 / cg" |
|
16280 | 1270 |
! |
1271 |
||
1272 |
hideObjcMethods:aBoolean |
|
17555 | 1273 |
<resource: #obsolete> |
17552 | 1274 |
self hideMethods:aBoolean |
1275 |
"/ self flagNamed:#hideObjcMethods put:aBoolean. |
|
1276 |
||
1277 |
"Modified: / 22-06-2017 / 10:47:09 / cg" |
|
16280 | 1278 |
! |
1279 |
||
9891 | 1280 |
hideOzClasses |
17555 | 1281 |
<resource: #obsolete> |
17552 | 1282 |
^ self hideClasses |
1283 |
"/ ^ self flagNamed:#hideOzClasses |
|
1284 |
||
1285 |
"Modified: / 22-06-2017 / 10:47:18 / cg" |
|
9891 | 1286 |
! |
1287 |
||
1288 |
hideOzClasses:aBoolean |
|
17555 | 1289 |
<resource: #obsolete> |
17552 | 1290 |
self hideClasses:aBoolean |
1291 |
"/ self flagNamed:#hideOzClasses put:aBoolean. |
|
1292 |
||
1293 |
"Modified: / 22-06-2017 / 10:47:28 / cg" |
|
9891 | 1294 |
! |
1295 |
||
1296 |
hideOzFunctions |
|
17555 | 1297 |
<resource: #obsolete> |
17552 | 1298 |
^ self hideFunctions |
1299 |
"/ ^ self flagNamed:#hideOzFunctions |
|
1300 |
||
1301 |
"Modified: / 22-06-2017 / 10:47:38 / cg" |
|
9891 | 1302 |
! |
1303 |
||
1304 |
hideOzFunctions:aBoolean |
|
17555 | 1305 |
<resource: #obsolete> |
17552 | 1306 |
self hideFunctions:aBoolean |
1307 |
"/ self flagNamed:#hideOzFunctions put:aBoolean. |
|
1308 |
||
1309 |
"Modified: / 22-06-2017 / 10:47:50 / cg" |
|
9891 | 1310 |
! |
1311 |
||
1312 |
hideOzMethods |
|
17555 | 1313 |
<resource: #obsolete> |
17552 | 1314 |
^ self hideMethods |
1315 |
"/ ^ self flagNamed:#hideOzMethods |
|
1316 |
||
1317 |
"Modified: / 22-06-2017 / 10:47:58 / cg" |
|
9891 | 1318 |
! |
1319 |
||
1320 |
hideOzMethods:aBoolean |
|
17555 | 1321 |
<resource: #obsolete> |
17552 | 1322 |
self hideMethods:aBoolean |
1323 |
"/ self flagNamed:#hideOzMethods put:aBoolean. |
|
1324 |
||
1325 |
"Modified: / 22-06-2017 / 10:48:11 / cg" |
|
1326 |
! |
|
1327 |
||
1328 |
hidePackages |
|
1329 |
^ self flagNamed:#hidePackages |
|
1330 |
||
1331 |
"Created: / 22-06-2017 / 10:43:49 / cg" |
|
1332 |
! |
|
1333 |
||
1334 |
hidePackages:aBoolean |
|
1335 |
self flagNamed:#hidePackages put:aBoolean. |
|
1336 |
||
1337 |
"Created: / 22-06-2017 / 10:43:59 / cg" |
|
9891 | 1338 |
! |
1339 |
||
1340 |
hidePythonClasses |
|
17555 | 1341 |
<resource: #obsolete> |
17552 | 1342 |
^ self hideClasses |
1343 |
"/ ^ self flagNamed:#hidePythonClasses |
|
1344 |
||
1345 |
"Modified: / 22-06-2017 / 10:48:25 / cg" |
|
9891 | 1346 |
! |
1347 |
||
1348 |
hidePythonClasses:aBoolean |
|
17555 | 1349 |
<resource: #obsolete> |
17552 | 1350 |
self hideClasses:aBoolean |
1351 |
"/ self flagNamed:#hidePythonClasses put:aBoolean. |
|
1352 |
||
1353 |
"Modified: / 22-06-2017 / 10:48:38 / cg" |
|
9891 | 1354 |
! |
1355 |
||
1356 |
hidePythonFunctions |
|
17555 | 1357 |
<resource: #obsolete> |
17552 | 1358 |
^ self hideFunctions |
1359 |
"/ ^ self flagNamed:#hidePythonFunctions |
|
1360 |
||
1361 |
"Modified: / 22-06-2017 / 10:48:46 / cg" |
|
9891 | 1362 |
! |
1363 |
||
1364 |
hidePythonFunctions:aBoolean |
|
17555 | 1365 |
<resource: #obsolete> |
17552 | 1366 |
self hideFunctions:aBoolean |
1367 |
"/ self flagNamed:#hidePythonFunctions put:aBoolean. |
|
1368 |
||
1369 |
"Modified: / 22-06-2017 / 10:48:55 / cg" |
|
9891 | 1370 |
! |
1371 |
||
1372 |
hidePythonMethods |
|
17555 | 1373 |
<resource: #obsolete> |
17552 | 1374 |
^ self hideMethods |
1375 |
"/ ^ self flagNamed:#hidePythonMethods |
|
1376 |
||
1377 |
"Modified: / 22-06-2017 / 10:49:04 / cg" |
|
9891 | 1378 |
! |
1379 |
||
1380 |
hidePythonMethods:aBoolean |
|
17555 | 1381 |
<resource: #obsolete> |
17552 | 1382 |
self hideMethods:aBoolean |
1383 |
"/ self flagNamed:#hidePythonMethods put:aBoolean. |
|
1384 |
||
1385 |
"Modified: / 22-06-2017 / 10:49:15 / cg" |
|
9891 | 1386 |
! |
1387 |
||
1388 |
hideStatic |
|
14346 | 1389 |
^ self flagNamed:#hideStatic |
9891 | 1390 |
! |
1391 |
||
1392 |
hideStatic:aBoolean |
|
14346 | 1393 |
self flagNamed:#hideStatic put:aBoolean. |
9891 | 1394 |
|
1395 |
"Modified: / 05-05-2011 / 15:23:11 / cg" |
|
1396 |
! |
|
1397 |
||
1398 |
hideStructMembers |
|
14346 | 1399 |
^ self flagNamed:#hideStructMembers |
9891 | 1400 |
! |
1401 |
||
1402 |
hideStructMembers:aBoolean |
|
14346 | 1403 |
self flagNamed:#hideStructMembers put:aBoolean. |
9891 | 1404 |
|
1405 |
"Modified: / 05-05-2011 / 15:23:15 / cg" |
|
1406 |
! |
|
1407 |
||
1408 |
hideStructures |
|
14346 | 1409 |
^ self flagNamed:#hideStructures |
9891 | 1410 |
! |
1411 |
||
1412 |
hideStructures:aBoolean |
|
14346 | 1413 |
self flagNamed:#hideStructures put:aBoolean. |
9891 | 1414 |
|
1415 |
"Modified: / 05-05-2011 / 15:23:17 / cg" |
|
1416 |
! |
|
1417 |
||
1418 |
hideTextLabels |
|
14346 | 1419 |
^ self flagNamed:#hideTextLabels |
9891 | 1420 |
! |
1421 |
||
1422 |
hideTextLabels:aBoolean |
|
14346 | 1423 |
self flagNamed:#hideTextLabels put:aBoolean. |
9891 | 1424 |
|
1425 |
"Modified: / 05-05-2011 / 15:23:19 / cg" |
|
1426 |
! |
|
1427 |
||
1428 |
hideTypedefs |
|
14346 | 1429 |
^ self flagNamed:#hideTypedefs |
9891 | 1430 |
! |
1431 |
||
1432 |
hideTypedefs:aBoolean |
|
14346 | 1433 |
self flagNamed:#hideTypedefs put:aBoolean. |
9891 | 1434 |
|
1435 |
"Modified: / 05-05-2011 / 15:23:21 / cg" |
|
1436 |
! |
|
1437 |
||
1438 |
hideVariables |
|
14346 | 1439 |
^ self flagNamed:#hideVariables |
9891 | 1440 |
! |
1441 |
||
1442 |
hideVariables:aBoolean |
|
14346 | 1443 |
self flagNamed:#hideVariables put:aBoolean. |
9891 | 1444 |
|
1445 |
"Modified: / 05-05-2011 / 15:23:23 / cg" |
|
1446 |
! |
|
1447 |
||
1448 |
javaClassesAndMethodsOnly |
|
17555 | 1449 |
<resource: #obsolete> |
17552 | 1450 |
^ self classesAndMethodsOnly |
1451 |
"/ ^ showOnly == #javaClassesAndMethods |
|
1452 |
||
1453 |
"Modified: / 22-06-2017 / 10:26:33 / cg" |
|
9891 | 1454 |
! |
1455 |
||
1456 |
javaClassesAndMethodsOnly:aBoolean |
|
17555 | 1457 |
<resource: #obsolete> |
17552 | 1458 |
self classesAndMethodsOnly:aBoolean |
1459 |
"/ showOnly := nil. |
|
1460 |
"/ aBoolean ifTrue:[ |
|
1461 |
"/ showOnly := DefaultShowOnly := #javaClassesAndMethods |
|
1462 |
"/ ]. |
|
1463 |
||
1464 |
"Modified: / 22-06-2017 / 10:26:43 / cg" |
|
9891 | 1465 |
! |
1466 |
||
1467 |
javaClassesOnly |
|
17555 | 1468 |
<resource: #obsolete> |
17552 | 1469 |
^ self classesOnly |
1470 |
"/ ^ showOnly == #javaClasses |
|
1471 |
||
1472 |
"Modified: / 22-06-2017 / 10:27:19 / cg" |
|
9891 | 1473 |
! |
1474 |
||
1475 |
javaClassesOnly:aBoolean |
|
17555 | 1476 |
<resource: #obsolete> |
17552 | 1477 |
self classesOnly:aBoolean |
1478 |
"/ showOnly := nil. |
|
1479 |
"/ aBoolean ifTrue:[ |
|
1480 |
"/ showOnly := DefaultShowOnly := #javaClasses |
|
1481 |
"/ ]. |
|
1482 |
||
1483 |
"Modified: / 22-06-2017 / 10:27:30 / cg" |
|
9891 | 1484 |
! |
1485 |
||
1486 |
javaMethodsOnly |
|
17555 | 1487 |
<resource: #obsolete> |
17552 | 1488 |
^ self methodsOnly |
1489 |
"/ ^ showOnly == #javaMethods |
|
1490 |
||
1491 |
"Modified: / 22-06-2017 / 10:37:52 / cg" |
|
9891 | 1492 |
! |
1493 |
||
1494 |
javaMethodsOnly:aBoolean |
|
17555 | 1495 |
<resource: #obsolete> |
17552 | 1496 |
self methodsOnly:aBoolean |
1497 |
"/ showOnly := nil. |
|
1498 |
"/ aBoolean ifTrue:[ |
|
1499 |
"/ showOnly := DefaultShowOnly := #javaMethods |
|
1500 |
"/ ]. |
|
1501 |
||
1502 |
"Modified: / 22-06-2017 / 10:38:36 / cg" |
|
9891 | 1503 |
! |
1504 |
||
1505 |
macrosOnly |
|
1506 |
^ showOnly == #macros |
|
1507 |
||
1508 |
"Created: / 07-06-2010 / 12:09:22 / cg" |
|
1509 |
"Modified: / 07-06-2010 / 14:18:33 / cg" |
|
1510 |
! |
|
1511 |
||
1512 |
macrosOnly:aBoolean |
|
1513 |
showOnly := nil. |
|
1514 |
aBoolean ifTrue:[ |
|
1515 |
showOnly := DefaultShowOnly := #macros |
|
1516 |
]. |
|
1517 |
||
1518 |
"Created: / 07-06-2010 / 12:09:34 / cg" |
|
1519 |
"Modified: / 05-05-2011 / 15:23:33 / cg" |
|
1520 |
! |
|
1521 |
||
1522 |
methodsOnly |
|
1523 |
^ showOnly == #methods |
|
1524 |
||
1525 |
"Created: / 07-06-2010 / 12:12:26 / cg" |
|
1526 |
"Modified: / 07-06-2010 / 14:18:38 / cg" |
|
1527 |
! |
|
1528 |
||
1529 |
methodsOnly:aBoolean |
|
1530 |
showOnly := nil. |
|
1531 |
aBoolean ifTrue:[ |
|
1532 |
showOnly := DefaultShowOnly := #methods |
|
1533 |
]. |
|
1534 |
||
1535 |
"Created: / 07-06-2010 / 12:12:30 / cg" |
|
1536 |
"Modified: / 05-05-2011 / 15:23:35 / cg" |
|
1537 |
! |
|
1538 |
||
1539 |
ozClassesOnly |
|
17555 | 1540 |
<resource: #obsolete> |
17552 | 1541 |
^ self classesOnly |
1542 |
"/ ^ showOnly == #ozClasses |
|
1543 |
||
1544 |
"Modified: / 22-06-2017 / 10:36:45 / cg" |
|
9891 | 1545 |
! |
1546 |
||
1547 |
ozClassesOnly:aBoolean |
|
17555 | 1548 |
<resource: #obsolete> |
17552 | 1549 |
self classesOnly:aBoolean |
1550 |
"/ showOnly := nil. |
|
1551 |
"/ aBoolean ifTrue:[ |
|
1552 |
"/ showOnly := DefaultShowOnly := #ozClasses |
|
1553 |
"/ ]. |
|
1554 |
||
1555 |
"Modified: / 22-06-2017 / 10:35:53 / cg" |
|
9891 | 1556 |
! |
1557 |
||
1558 |
ozFunctionsOnly |
|
17555 | 1559 |
<resource: #obsolete> |
17552 | 1560 |
^ self functionsOnly |
1561 |
"/ ^ showOnly == #ozFunctions |
|
1562 |
||
1563 |
"Modified: / 22-06-2017 / 10:39:06 / cg" |
|
9891 | 1564 |
! |
1565 |
||
1566 |
ozFunctionsOnly:aBoolean |
|
17555 | 1567 |
<resource: #obsolete> |
17552 | 1568 |
self functionsOnly:aBoolean |
1569 |
"/ showOnly := nil. |
|
1570 |
"/ aBoolean ifTrue:[ |
|
1571 |
"/ showOnly := DefaultShowOnly := #ozFunctions |
|
1572 |
"/ ]. |
|
1573 |
"/ self updateContentsFromRawList. |
|
1574 |
||
1575 |
"Modified: / 22-06-2017 / 10:39:55 / cg" |
|
9891 | 1576 |
! |
1577 |
||
1578 |
ozMethodsOnly |
|
17555 | 1579 |
<resource: #obsolete> |
17552 | 1580 |
^ self methodsOnly |
1581 |
"/ ^ showOnly == #ozMethods |
|
1582 |
||
1583 |
"Modified: / 22-06-2017 / 10:37:57 / cg" |
|
9891 | 1584 |
! |
1585 |
||
1586 |
ozMethodsOnly:aBoolean |
|
17555 | 1587 |
<resource: #obsolete> |
17552 | 1588 |
self methodsOnly:aBoolean |
1589 |
"/ showOnly := nil. |
|
1590 |
"/ aBoolean ifTrue:[ |
|
1591 |
"/ showOnly := DefaultShowOnly := #ozMethods |
|
1592 |
"/ ]. |
|
1593 |
||
1594 |
"Modified: / 22-06-2017 / 10:38:28 / cg" |
|
9891 | 1595 |
! |
1596 |
||
1597 |
pythonClassesOnly |
|
17555 | 1598 |
<resource: #obsolete> |
17552 | 1599 |
^ self classesOnly |
1600 |
"/ ^ showOnly == #pythonClasses |
|
1601 |
||
1602 |
"Modified: / 22-06-2017 / 10:36:37 / cg" |
|
9891 | 1603 |
! |
1604 |
||
1605 |
pythonClassesOnly:aBoolean |
|
17555 | 1606 |
<resource: #obsolete> |
17552 | 1607 |
self classesOnly:aBoolean |
1608 |
"/ showOnly := nil. |
|
1609 |
"/ aBoolean ifTrue:[ |
|
1610 |
"/ showOnly := DefaultShowOnly := #pythonClasses |
|
1611 |
"/ ]. |
|
1612 |
||
1613 |
"Modified: / 22-06-2017 / 10:36:01 / cg" |
|
9891 | 1614 |
! |
1615 |
||
1616 |
pythonFunctionsOnly |
|
17555 | 1617 |
<resource: #obsolete> |
17552 | 1618 |
^ self functionsOnly |
1619 |
"/ ^ showOnly == #pythonFunctions |
|
1620 |
||
1621 |
"Modified: / 22-06-2017 / 10:39:13 / cg" |
|
9891 | 1622 |
! |
1623 |
||
1624 |
pythonFunctionsOnly:aBoolean |
|
17555 | 1625 |
<resource: #obsolete> |
17552 | 1626 |
self functionsOnly:aBoolean |
1627 |
"/ showOnly := nil. |
|
1628 |
"/ aBoolean ifTrue:[ |
|
1629 |
"/ showOnly := DefaultShowOnly := #pythonFunctions |
|
1630 |
"/ ]. |
|
1631 |
||
1632 |
"Modified: / 22-06-2017 / 10:39:47 / cg" |
|
9891 | 1633 |
! |
1634 |
||
1635 |
pythonMethodsOnly |
|
17555 | 1636 |
<resource: #obsolete> |
17552 | 1637 |
^ self methodsOnly |
1638 |
"/ ^ showOnly == #pythonMethods |
|
1639 |
||
1640 |
"Modified: / 22-06-2017 / 10:38:01 / cg" |
|
9891 | 1641 |
! |
1642 |
||
1643 |
pythonMethodsOnly:aBoolean |
|
17555 | 1644 |
<resource: #obsolete> |
17552 | 1645 |
self methodsOnly:aBoolean |
1646 |
"/ showOnly := nil. |
|
1647 |
"/ aBoolean ifTrue:[ |
|
1648 |
"/ showOnly := DefaultShowOnly := #pythonMethods |
|
1649 |
"/ ]. |
|
1650 |
||
1651 |
"Modified: / 22-06-2017 / 10:38:22 / cg" |
|
9891 | 1652 |
! |
1653 |
||
1654 |
showOnly |
|
1655 |
tagTypesPresent == false ifTrue:[ |
|
1656 |
^ nil "/ showing everything |
|
1657 |
]. |
|
1658 |
^ showOnly "? DefaultShowOnly" |
|
1659 |
||
1660 |
"Modified: / 20-06-2010 / 01:44:13 / cg" |
|
1661 |
! |
|
1662 |
||
1663 |
showOnly:aSymbol |
|
1664 |
showOnly := aSymbol |
|
1665 |
||
1666 |
"Modified: / 05-05-2011 / 15:23:55 / cg" |
|
1667 |
! |
|
1668 |
||
1669 |
structsOnly |
|
1670 |
^ showOnly == #structs |
|
1671 |
||
1672 |
"Created: / 25-06-2010 / 10:42:27 / cg" |
|
1673 |
! |
|
1674 |
||
1675 |
structsOnly:aBoolean |
|
1676 |
showOnly := DefaultShowOnly := nil. |
|
1677 |
aBoolean ifTrue:[ |
|
1678 |
showOnly := "DefaultShowOnly :=" #structs |
|
1679 |
]. |
|
1680 |
||
1681 |
"Created: / 25-06-2010 / 10:42:39 / cg" |
|
1682 |
"Modified: / 05-05-2011 / 15:23:58 / cg" |
|
1683 |
! |
|
1684 |
||
1685 |
targetsOnly |
|
1686 |
^ showOnly == #targets |
|
1687 |
||
1688 |
"Modified: / 07-06-2010 / 14:19:03 / cg" |
|
1689 |
! |
|
1690 |
||
1691 |
targetsOnly:aBoolean |
|
1692 |
showOnly := DefaultShowOnly := nil. |
|
1693 |
aBoolean ifTrue:[ |
|
1694 |
showOnly := DefaultShowOnly := #targets |
|
1695 |
]. |
|
1696 |
||
1697 |
"Modified: / 05-05-2011 / 15:24:02 / cg" |
|
1698 |
! |
|
1699 |
||
1700 |
typesOnly |
|
1701 |
^ showOnly == #types |
|
1702 |
||
1703 |
"Modified: / 07-06-2010 / 14:19:06 / cg" |
|
1704 |
! |
|
1705 |
||
1706 |
typesOnly:aBoolean |
|
1707 |
showOnly := DefaultShowOnly := nil. |
|
1708 |
aBoolean ifTrue:[ |
|
1709 |
showOnly := "DefaultShowOnly :=" #types |
|
1710 |
]. |
|
1711 |
||
1712 |
"Modified: / 05-05-2011 / 15:24:04 / cg" |
|
1713 |
! |
|
1714 |
||
1715 |
variablesOnly |
|
1716 |
^ showOnly == #variables |
|
1717 |
||
1718 |
"Modified: / 07-06-2010 / 14:19:09 / cg" |
|
1719 |
! |
|
1720 |
||
1721 |
variablesOnly:aBoolean |
|
1722 |
showOnly := nil. |
|
1723 |
aBoolean ifTrue:[ |
|
1724 |
showOnly := DefaultShowOnly := #variables |
|
1725 |
]. |
|
1726 |
||
1727 |
"Modified: / 05-05-2011 / 15:24:06 / cg" |
|
1728 |
! ! |
|
1729 |
||
1730 |
!TagList methodsFor:'accessing-presentation'! |
|
1731 |
||
1732 |
groupBy |
|
1733 |
^ groupBy |
|
1734 |
||
1735 |
"Created: / 05-05-2011 / 14:31:37 / cg" |
|
1736 |
"Modified: / 05-05-2011 / 15:34:14 / cg" |
|
1737 |
! |
|
1738 |
||
1739 |
groupBy:aSymbolOrNil |
|
1740 |
groupBy ~~ aSymbolOrNil ifTrue:[ |
|
1741 |
groupBy := DefaultGroupBy := aSymbolOrNil. |
|
1742 |
self updateContentsFromFilteredList |
|
1743 |
]. |
|
1744 |
||
1745 |
"Created: / 05-05-2011 / 14:32:00 / cg" |
|
1746 |
! |
|
1747 |
||
1748 |
groupedByType |
|
1749 |
^ self groupBy == #byType |
|
1750 |
||
1751 |
"Created: / 05-05-2011 / 14:32:53 / cg" |
|
1752 |
! |
|
1753 |
||
1754 |
groupedByType:aBoolean |
|
1755 |
aBoolean == true ifTrue:[ |
|
1756 |
self groupBy:#byType |
|
1757 |
] ifFalse:[ |
|
1758 |
self groupBy:nil |
|
1759 |
]. |
|
1760 |
||
1761 |
"Created: / 05-05-2011 / 14:33:05 / cg" |
|
1762 |
! |
|
1763 |
||
1764 |
sortCriteria |
|
1765 |
^ sortCriteria ? DefaultSortCriteria |
|
1766 |
! |
|
1767 |
||
1768 |
sortCriteria:aSymbolOrNil |
|
1769 |
sortCriteria ~~ aSymbolOrNil ifTrue:[ |
|
1770 |
sortCriteria := DefaultSortCriteria := aSymbolOrNil. |
|
1771 |
Sorted := sortCriteria. |
|
1772 |
self updateContentsFromFilteredList |
|
1773 |
]. |
|
1774 |
||
1775 |
"Modified: / 05-05-2011 / 14:50:18 / cg" |
|
1776 |
! |
|
1777 |
||
1778 |
sorted |
|
1779 |
"backward compatibility" |
|
1780 |
||
1781 |
^ self sortCriteria notNil |
|
1782 |
! |
|
1783 |
||
1784 |
sorted:aBoolean |
|
1785 |
"backward compatibility" |
|
1786 |
||
1787 |
aBoolean ifTrue:[ |
|
1788 |
self sortCriteria:#byName |
|
1789 |
] ifFalse:[ |
|
1790 |
self sortCriteria:nil |
|
1791 |
]. |
|
1792 |
! |
|
1793 |
||
1794 |
sortedByLineNumber |
|
1795 |
^ self sortCriteria isNil |
|
1796 |
or:[ self sortCriteria == #lineNumber ] |
|
1797 |
||
1798 |
"Modified: / 05-05-2011 / 14:30:33 / cg" |
|
1799 |
! |
|
1800 |
||
1801 |
sortedByLineNumber:aBoolean |
|
1802 |
aBoolean == true ifTrue:[ |
|
1803 |
self sortCriteria:#lineNumber |
|
1804 |
]. |
|
1805 |
||
1806 |
"Modified: / 27-06-2010 / 21:31:44 / cg" |
|
1807 |
! |
|
1808 |
||
1809 |
sortedByName |
|
1810 |
^ self sortCriteria == #byName |
|
1811 |
! |
|
1812 |
||
1813 |
sortedByName:aBoolean |
|
1814 |
aBoolean == true ifTrue:[ |
|
1815 |
self sortCriteria:#byName |
|
1816 |
]. |
|
1817 |
! |
|
1818 |
||
1819 |
sortedByNameIgnoringCase |
|
1820 |
^ self sortCriteria == #byNameIgnoringCase |
|
1821 |
! |
|
1822 |
||
1823 |
sortedByNameIgnoringCase:aBoolean |
|
1824 |
aBoolean == true ifTrue:[ |
|
1825 |
self sortCriteria:#byNameIgnoringCase |
|
1826 |
]. |
|
1827 |
! |
|
1828 |
||
1829 |
sortedByNameIgnoringLeadingUnderscores |
|
1830 |
^ self sortCriteria == #byNameIgnoringLeadingUnderscores |
|
1831 |
! |
|
1832 |
||
1833 |
sortedByNameIgnoringLeadingUnderscores:aBoolean |
|
1834 |
aBoolean == true ifTrue:[ |
|
1835 |
self sortCriteria:#byNameIgnoringLeadingUnderscores |
|
1836 |
]. |
|
1837 |
! |
|
1838 |
||
1839 |
sortedByNameIgnoringLeadingUnderscoresAndCase |
|
1840 |
^ self sortCriteria == #byNameIgnoringLeadingUnderscoresAndCase |
|
1841 |
! |
|
1842 |
||
1843 |
sortedByNameIgnoringLeadingUnderscoresAndCase:aBoolean |
|
1844 |
aBoolean == true ifTrue:[ |
|
1845 |
self sortCriteria:#byNameIgnoringLeadingUnderscoresAndCase |
|
1846 |
]. |
|
1847 |
! |
|
1848 |
||
1849 |
sortedByType |
|
1850 |
^ self sortCriteria == #byType |
|
1851 |
! |
|
1852 |
||
1853 |
sortedByType:aBoolean |
|
1854 |
aBoolean == true ifTrue:[ |
|
1855 |
self sortCriteria:#byType |
|
1856 |
]. |
|
1857 |
! |
|
1858 |
||
1859 |
tagTypesPresent |
|
1860 |
^ tagTypesPresent |
|
1861 |
! ! |
|
1862 |
||
14346 | 1863 |
!TagList methodsFor:'initialization'! |
1864 |
||
1865 |
initContents:n |
|
1866 |
"Invoked when a new instance is created." |
|
1867 |
||
1868 |
super initContents:n. |
|
14387 | 1869 |
flags isNil ifTrue:[ |
1870 |
flags := IdentityDictionary new. |
|
1871 |
]. |
|
14346 | 1872 |
! |
1873 |
||
1874 |
initialize |
|
1875 |
"Invoked when a new instance is created." |
|
1876 |
||
1877 |
flags := IdentityDictionary new. |
|
1878 |
! ! |
|
1879 |
||
9891 | 1880 |
!TagList methodsFor:'private'! |
1881 |
||
1882 |
applyFilterToList:aList |
|
14564 | 1883 |
|filters| |
1884 |
||
1885 |
filters := filter splitByAny:',;'. |
|
1886 |
filters size == 1 ifTrue:[ |
|
1887 |
filter includesMatchCharacters ifFalse:[ |
|
1888 |
^ aList select:[:tag | tag label includesString:filter caseSensitive:false] |
|
1889 |
]. |
|
11722
f1f3a4d964ee
changed: #applyFilterToList:
Claus Gittinger <cg@exept.de>
parents:
11502
diff
changeset
|
1890 |
]. |
14564 | 1891 |
|
1892 |
^ aList |
|
1893 |
select:[:tag | |
|
1894 |
filters |
|
1895 |
contains:[:someFilter | |
|
1896 |
someFilter includesMatchCharacters ifTrue:[ |
|
1897 |
someFilter match:tag label caseSensitive:false |
|
1898 |
] ifFalse:[ |
|
1899 |
tag label includesString:someFilter caseSensitive:false |
|
1900 |
]. |
|
1901 |
]. |
|
1902 |
]. |
|
9891 | 1903 |
! |
1904 |
||
1905 |
getCtagsVersion |
|
18120 | 1906 |
"obsolete (no longer needed) |
1907 |
parse major and minor version from ctags by operating system command |
|
1908 |
check for the 'Exuberant Ctags' string being present |
|
1909 |
return an Array with major and minor part of version or nil if not available" |
|
9891 | 1910 |
|
1911 |
| stream string index majorVersion minorVersion indexOfPoint| |
|
1912 |
||
1913 |
stream := WriteStream on:''. |
|
1914 |
OperatingSystem |
|
1915 |
executeCommand:'ctags --version' |
|
1916 |
inputFrom:nil |
|
1917 |
outputTo:stream |
|
1918 |
errorTo:stream |
|
1919 |
inDirectory:nil |
|
1920 |
onError:[:status| false]. |
|
18120 | 1921 |
|
9891 | 1922 |
string := stream contents. |
1923 |
index := string findString:'Exuberant Ctags' ifAbsent:[nil]. |
|
1924 |
index notNil ifTrue:[ |
|
15328 | 1925 |
string := (string copyFrom:(index + ('Exuberant Ctags' size))) asCollectionOfWords first. |
9891 | 1926 |
(string includes:$,) ifTrue:[ string := string copyTo:((string indexOf:$,) - 1)]. |
1927 |
indexOfPoint := string indexOf:$. ifAbsent:nil. |
|
1928 |
indexOfPoint notNil ifTrue:[ |
|
1929 |
majorVersion := (string copyFrom:1 to:indexOfPoint - 1) asInteger. |
|
1930 |
minorVersion := (string copyFrom:indexOfPoint + 1 to:string size) asInteger. |
|
1931 |
^ Array with:majorVersion with:minorVersion. |
|
1932 |
] |
|
1933 |
]. |
|
1934 |
^ nil |
|
1935 |
||
1936 |
"Modified: / 05-05-2011 / 14:48:08 / cg" |
|
1937 |
! |
|
1938 |
||
1939 |
setFilteredList:aList |
|
1940 |
filteredList := aList. |
|
1941 |
self updateContentsFromFilteredList |
|
1942 |
||
1943 |
"Created: / 05-05-2011 / 14:46:12 / cg" |
|
1944 |
! |
|
1945 |
||
1946 |
setRawList:aList |
|
1947 |
rawList := aList. |
|
1948 |
self updateContentsFromRawList |
|
1949 |
||
1950 |
"Created: / 05-05-2011 / 14:46:22 / cg" |
|
1951 |
! |
|
1952 |
||
1953 |
shellCommandFor:aFilenameString |
|
1954 |
"returns the shellCommand to be used" |
|
1955 |
||
11050 | 1956 |
|template| |
1957 |
||
1958 |
(template := self shellCommandTemplateFor:aFilenameString) isNil ifTrue:[ |
|
1959 |
^ nil |
|
1960 |
]. |
|
1961 |
^ template bindWith:aFilenameString |
|
1962 |
||
1963 |
"Modified: / 05-01-2012 / 11:10:03 / cg" |
|
1964 |
! |
|
1965 |
||
1966 |
shellCommandTemplateFor:aFilenameString |
|
12332 | 1967 |
"returns the shellCommand to be used (contains %1 for the filename). |
1968 |
When first called, looks for ctags (both a private and the system-supplied), |
|
1969 |
and tries to see what version that is. I prefer exuberant ctags version" |
|
11050 | 1970 |
|
16280 | 1971 |
|lcSuffix shellCommand isCSuffix isCPlusPlusSuffix isObjcSuffix |
1972 |
isJavaSuffix isEiffelSuffix isFortranSuffix |
|
12332 | 1973 |
isTCLSuffix isRubySuffix isPythonSuffix isPhpSuffix isJavaScriptSuffix |
12341 | 1974 |
showOnly response suff fn langValue langOption moreOptions| |
9891 | 1975 |
|
1976 |
ctagsCommand isNil ifTrue:[ |
|
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1977 |
remoteTarget isNil ifTrue:[ |
9891 | 1978 |
"/ local use |
1979 |
suff := (OperatingSystem isMSWINDOWSlike) ifTrue:'.exe' ifFalse:''. |
|
1980 |
||
14881 | 1981 |
ctagsCommand := 'ctags',suff. |
9891 | 1982 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
1983 |
ctagsCommand := fn pathName. |
|
1984 |
ctagsIsExCtags := ctagsIsExCtags5x := true. |
|
1985 |
] ifFalse:[ |
|
14881 | 1986 |
ctagsCommand := 'bin/ctags',suff. |
9891 | 1987 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
1988 |
ctagsCommand := fn pathName. |
|
14881 | 1989 |
ctagsIsExCtags := ctagsIsExCtags5x := true. |
9891 | 1990 |
] ifFalse:[ |
14881 | 1991 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags-5.8/ctags',suff. |
9891 | 1992 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
1993 |
ctagsCommand := fn pathName. |
|
14881 | 1994 |
ctagsIsExCtags := ctagsIsExCtags5x := true. |
9891 | 1995 |
] ifFalse:[ |
14881 | 1996 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags-3.2.2/ctags',suff. |
1997 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
|
1998 |
ctagsCommand := fn pathName. |
|
1999 |
ctagsIsExCtags := true. |
|
2000 |
ctagsIsExCtags5x := false. |
|
2001 |
] ifFalse:[ |
|
2002 |
ctagsIsExCtags := nil. |
|
2003 |
ctagsIsExCtags5x := nil. |
|
2004 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags/ctags',suff. |
|
2005 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
|
2006 |
ctagsCommand := fn pathName. |
|
2007 |
] ifFalse:[ |
|
2008 |
"/ use systems default ctags command |
|
2009 |
ctagsCommand := 'ctags'. |
|
2010 |
] |
|
2011 |
] |
|
2012 |
]. |
|
9891 | 2013 |
] |
14881 | 2014 |
] |
9891 | 2015 |
] ifFalse:[ |
2016 |
"/ cross-development |
|
2017 |
"/ target remoteOperatingSystem = 'Linux' ifTrue:[ |
|
2018 |
"/ use systems default ctags command |
|
2019 |
ctagsCommand := 'ctags'. |
|
2020 |
ctagsIsExCtags := nil. |
|
2021 |
ctagsIsExCtags5x := nil. |
|
2022 |
"/ ] |
|
2023 |
]. |
|
2024 |
]. |
|
2025 |
||
2026 |
(ctagsIsExCtags isNil or:[ctagsIsExCtags5x isNil]) ifTrue:[ |
|
2027 |
ctagsCommand notNil ifTrue:[ |
|
2028 |
response := OperatingSystem getCommandOutputFrom:(ctagsCommand, ' --version'). |
|
2029 |
(response notNil |
|
2030 |
and:[response asLowercase startsWith:'exuberant ctags']) ifTrue:[ |
|
2031 |
ctagsIsExCtags := true. |
|
2032 |
||
2033 |
response := (response copyFrom:'exuberant ctags' size + 1) withoutSeparators. |
|
2034 |
ctagsIsExCtags5x := response startsWith:'5.' |
|
2035 |
]. |
|
2036 |
]. |
|
2037 |
]. |
|
2038 |
||
12344 | 2039 |
ctagsIsExCtags5x ifTrue:[ |
2040 |
langOption := '--language-force=%1'. |
|
2041 |
] ifFalse:[ ctagsIsExCtags ifTrue:[ |
|
2042 |
langOption := '--lang=%1'. |
|
2043 |
]]. |
|
2044 |
||
9891 | 2045 |
shellCommand := ctagsCommand. |
2046 |
(shellCommand includes:Character space) ifTrue:[ |
|
2047 |
shellCommand := '"',shellCommand,'"'. |
|
2048 |
]. |
|
12341 | 2049 |
moreOptions := ''. |
9891 | 2050 |
|
2051 |
showOnly := self showOnly. |
|
2052 |
||
2053 |
lcSuffix := aFilenameString asFilename suffix asLowercase. |
|
2054 |
isCSuffix := self class isCSuffix:lcSuffix. |
|
12344 | 2055 |
|
2056 |
"/ a hack for temporary files generated by stc |
|
2057 |
lcSuffix = 'sc' ifTrue:[ |
|
2058 |
(aFilenameString asFilename asAbsoluteFilename components includes:'stx') ifTrue:[ |
|
2059 |
isCSuffix := true |
|
2060 |
]. |
|
2061 |
]. |
|
9891 | 2062 |
isCPlusPlusSuffix := self class isCPlusPlusSuffix:lcSuffix. |
16280 | 2063 |
isObjcSuffix := self class isObjcSuffix:lcSuffix. |
9891 | 2064 |
|
2065 |
(shellCommand notNil and:[(ctagsIsExCtags ? false)]) ifTrue:[ |
|
2066 |
isJavaSuffix := self class isJavaSuffix:lcSuffix. |
|
2067 |
isEiffelSuffix := self class isEiffelSuffix:lcSuffix. |
|
2068 |
isFortranSuffix := self class isFortranSuffix:lcSuffix. |
|
2069 |
||
2070 |
"/ ex_ctags supports c, c++, java, fortran and a few others |
|
16280 | 2071 |
(isCSuffix or:[isCPlusPlusSuffix or:[isObjcSuffix |
2072 |
or:[isJavaSuffix or:[isEiffelSuffix or:[isFortranSuffix]]]]]) ifFalse:[ |
|
9891 | 2073 |
(ctagsIsExCtags5x ? false) ifFalse:[ |
2074 |
^ nil |
|
2075 |
]. |
|
12332 | 2076 |
|
2077 |
"/ ex_ctags5.x also supports: |
|
2078 |
"/ Assembler, AWK, ASP, BETA, |
|
2079 |
"/ Bourne/Korn/Z Shell, C, C++, C#, COBOL, Eiffel, Erlang, Fortran, Java, Lisp, |
|
2080 |
"/ Lua, Makefile, Pascal, Perl, PHP, PL/SQL, Python, REXX, Ruby, Scheme, |
|
2081 |
"/ S-Lang, SML (Standard ML), Tcl, Vera, Verilog, VHDL, Vim, and YACC. |
|
9891 | 2082 |
]. |
12332 | 2083 |
isTCLSuffix := self class isTCLSuffix:lcSuffix. |
2084 |
isRubySuffix := self class isRubySuffix:lcSuffix. |
|
2085 |
isPythonSuffix := self class isPythonSuffix:lcSuffix. |
|
2086 |
isPhpSuffix := self class isPhpSuffix:lcSuffix. |
|
2087 |
isJavaScriptSuffix := self class isJavaScriptSuffix:lcSuffix. |
|
9891 | 2088 |
|
2089 |
usingDefaultCTags := false. |
|
2090 |
shellCommand := shellCommand asFilename asAbsoluteFilename pathName. |
|
2091 |
"/ shellCommand := shellCommand, ' -f - --c-types=f --file-scope=no'. |
|
2092 |
"/ shellCommand := shellCommand, ' -f - --file-scope=yes'. |
|
2093 |
"/ shellCommand := shellCommand, ' -f - --file-scope=yes'. |
|
2094 |
shellCommand := shellCommand, ' -f - --file-scope=yes --excmd=number'. |
|
2095 |
||
16280 | 2096 |
(isCSuffix or:[isCPlusPlusSuffix or:[isObjcSuffix]]) ifTrue:[ |
9891 | 2097 |
isCPlusPlusSuffix |
12341 | 2098 |
ifTrue:[ langValue := 'c++'] |
2099 |
ifFalse:[ langValue := 'c']. |
|
9891 | 2100 |
|
2101 |
showOnly == #classes ifTrue:[ |
|
12341 | 2102 |
moreOptions := moreOptions, ' --c-types=c' |
9891 | 2103 |
] ifFalse:[ |
2104 |
showOnly == #functions ifTrue:[ |
|
12341 | 2105 |
moreOptions := moreOptions, ' --c-types=f' |
9891 | 2106 |
] ifFalse:[ |
2107 |
showOnly == #functionsAndVariables ifTrue:[ |
|
12341 | 2108 |
moreOptions := moreOptions, ' --c-types=fv' |
9891 | 2109 |
] ifFalse:[ |
2110 |
showOnly == #classesFunctionsAndVariables ifTrue:[ |
|
12341 | 2111 |
moreOptions := moreOptions, ' --c-types=cfv' |
9891 | 2112 |
] ifFalse:[ |
2113 |
showOnly == #variables ifTrue:[ |
|
12341 | 2114 |
moreOptions := moreOptions, ' --c-types=v' |
9891 | 2115 |
] ifFalse:[ |
2116 |
showOnly == #types ifTrue:[ |
|
12341 | 2117 |
moreOptions := moreOptions, ' --c-types=t' |
9891 | 2118 |
] |
2119 |
] |
|
2120 |
] |
|
2121 |
] |
|
2122 |
] |
|
2123 |
]. |
|
14346 | 2124 |
self hideStructMembers == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-m']. |
2125 |
self hideDefines == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-d' ]. |
|
2126 |
self hideTypedefs == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-t' ]. |
|
2127 |
self hideStructures == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-s']. |
|
2128 |
self hideVariables == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-v']. |
|
2129 |
self hideFunctions == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-f']. |
|
2130 |
self hideClasses == true ifTrue:[ moreOptions := moreOptions, ' --c-types=-c']. |
|
9891 | 2131 |
]. |
12332 | 2132 |
|
9891 | 2133 |
isJavaSuffix ifTrue:[ |
12341 | 2134 |
langValue := 'java'. |
9891 | 2135 |
|
17552 | 2136 |
(showOnly == #javaClasses or:[showOnly == #classes]) ifTrue:[ |
12341 | 2137 |
moreOptions := moreOptions, ' --java-types=c' |
9891 | 2138 |
] ifFalse:[ |
17552 | 2139 |
(showOnly == #javaMethods or:[showOnly == #methods]) ifTrue:[ |
12341 | 2140 |
moreOptions := moreOptions, ' --java-types=m' |
9891 | 2141 |
] ifFalse:[ |
17552 | 2142 |
(showOnly == #javaClassesAndMethods or:[showOnly == #classesAndMethods]) ifTrue:[ |
12341 | 2143 |
moreOptions := moreOptions, ' --java-types=mc' |
9891 | 2144 |
] |
2145 |
] |
|
2146 |
]. |
|
17555 | 2147 |
self hideClasses == true ifTrue:[ moreOptions := moreOptions, ' --java-types=-c' ]. |
2148 |
self hideMethods == true ifTrue:[ moreOptions := moreOptions, ' --java-types=-m' ]. |
|
2149 |
self hideInterfaces == true ifTrue:[ moreOptions := moreOptions, ' --java-types=-i' ]. |
|
2150 |
self hideFields == true ifTrue:[ moreOptions := moreOptions, ' --java-types=-f' ]. |
|
2151 |
self hidePackages == true ifTrue:[ moreOptions := moreOptions, ' --java-types=-p' ]. |
|
9891 | 2152 |
]. |
12332 | 2153 |
|
9891 | 2154 |
isEiffelSuffix ifTrue:[ |
12341 | 2155 |
langValue := 'eiffel'. |
9891 | 2156 |
|
12332 | 2157 |
showOnly == #classes ifTrue:[ |
12341 | 2158 |
moreOptions := moreOptions, ' --eiffel-types=c' |
9891 | 2159 |
] ifFalse:[ |
2160 |
showOnly == #features ifTrue:[ |
|
12341 | 2161 |
moreOptions := moreOptions, ' --eiffel-types=f' |
9891 | 2162 |
] |
2163 |
]. |
|
2164 |
"/ hideEiffelClasses == true ifTrue:[ |
|
12341 | 2165 |
"/ moreOptions := moreOptions, ' --eiffel-types=-c' |
9891 | 2166 |
"/ ]. |
2167 |
"/ hideEiffelFeatures == true ifTrue:[ |
|
12341 | 2168 |
"/ moreOptions := moreOptions, ' --eiffel-types=-m' |
9891 | 2169 |
"/ ]. |
2170 |
]. |
|
2171 |
||
2172 |
isFortranSuffix ifTrue:[ |
|
12341 | 2173 |
langValue := 'fortran'. |
9891 | 2174 |
|
2175 |
showOnly == #functions ifTrue:[ |
|
12341 | 2176 |
moreOptions := moreOptions, ' --fortran-types=f' |
9891 | 2177 |
] ifFalse:[ |
2178 |
showOnly == #interfaces ifTrue:[ |
|
12341 | 2179 |
moreOptions := moreOptions, ' --fortran-types=i' |
9891 | 2180 |
] ifFalse:[ |
2181 |
showOnly == #subroutines ifTrue:[ |
|
12341 | 2182 |
moreOptions := moreOptions, ' --fortran-types=s' |
9891 | 2183 |
] ifFalse:[ |
2184 |
showOnly == #commonBlocks == true ifTrue:[ |
|
12341 | 2185 |
moreOptions := moreOptions, ' --fortran-types=c' |
9891 | 2186 |
] |
2187 |
] |
|
2188 |
] |
|
2189 |
]. |
|
2190 |
"/ hideFortranFunctions == true ifTrue:[ |
|
12341 | 2191 |
"/ moreOptions := moreOptions, ' --fortran-types=-f' |
9891 | 2192 |
"/ ]. |
2193 |
"/ hideFortranInterfaces == true ifTrue:[ |
|
12341 | 2194 |
"/ moreOptions := moreOptions, ' --fortran-types=-i' |
9891 | 2195 |
"/ ]. |
2196 |
"/ hideFortranSubroutines == true ifTrue:[ |
|
12341 | 2197 |
"/ moreOptions := moreOptions, ' --fortran-types=-s' |
9891 | 2198 |
"/ ]. |
2199 |
"/ hideFortranCommonBlocks == true ifTrue:[ |
|
12341 | 2200 |
"/ moreOptions := moreOptions, ' --fortran-types=-c' |
9891 | 2201 |
"/ ]. |
2202 |
"/ hideFortranEntryPoints == true ifTrue:[ |
|
12341 | 2203 |
"/ moreOptions := moreOptions, ' --fortran-types=-e' |
9891 | 2204 |
"/ ]. |
2205 |
"/ hideFortranLabels == true ifTrue:[ |
|
12341 | 2206 |
"/ moreOptions := moreOptions, ' --fortran-types=-l' |
9891 | 2207 |
"/ ]. |
2208 |
"/ hideFortranDerivedTypes == true ifTrue:[ |
|
12341 | 2209 |
"/ moreOptions := moreOptions, ' --fortran-types=-t' |
9891 | 2210 |
"/ ]. |
2211 |
]. |
|
2212 |
||
2213 |
"/ shellCommand := shellCommand, ' -f -'. |
|
12341 | 2214 |
langValue notNil ifTrue:[ |
2215 |
langOption notNil ifTrue:[ |
|
2216 |
shellCommand := shellCommand , ' ' , (langOption bindWith:langValue) |
|
2217 |
]. |
|
2218 |
]. |
|
2219 |
moreOptions notEmptyOrNil ifTrue:[ |
|
2220 |
shellCommand := shellCommand , moreOptions |
|
2221 |
]. |
|
11050 | 2222 |
shellCommand := shellCommand, ' "%1"'. |
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2223 |
remoteTarget notNil ifTrue:[ |
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2224 |
^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./'). |
9891 | 2225 |
]. |
2226 |
^ shellCommand. |
|
2227 |
]. |
|
2228 |
||
2229 |
"/ regular ctags: assume supports c, c++ only |
|
2230 |
isCSuffix ifFalse:[ |
|
2231 |
^ nil |
|
2232 |
]. |
|
2233 |
||
15241 | 2234 |
usingDefaultCTags := true. |
9891 | 2235 |
|
2236 |
shellCommand := 'ctags'. |
|
2237 |
||
2238 |
"/ "sunos and realIX have no option -s" |
|
2239 |
"/ (OperatingSystem getOSType = 'linux') ifTrue:[ |
|
2240 |
"/ shellCommand := 'ctags -S' |
|
2241 |
"/ ]. |
|
15240 | 2242 |
Transcript showCR:('TagList [info]: using default ctags command (not ctags from stx): <', shellCommand, '>'). |
9891 | 2243 |
ctagsCommand := nil. "/ flush - so we will check again. |
2244 |
||
11050 | 2245 |
shellCommand := shellCommand, ' "%1"'. |
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2246 |
remoteTarget notNil ifTrue:[ |
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2247 |
^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./'). |
9891 | 2248 |
]. |
2249 |
^ shellCommand |
|
2250 |
||
11050 | 2251 |
"Created: / 05-01-2012 / 11:07:41 / cg" |
17555 | 2252 |
"Modified: / 22-06-2017 / 13:35:53 / cg" |
9891 | 2253 |
! |
2254 |
||
2255 |
sortBlock |
|
2256 |
"sort AND group" |
|
2257 |
||
2258 |
|sortBlock| |
|
2259 |
||
2260 |
sortCriteria := self sortCriteria. |
|
2261 |
sortBlock := self sortBlockForSortCriteria. |
|
2262 |
||
2263 |
groupBy isNil ifTrue:[ |
|
2264 |
^ sortBlock |
|
2265 |
]. |
|
2266 |
||
2267 |
^ [:a :b| |
|
2268 |
|t1 t2 l1 l2| |
|
2269 |
||
2270 |
t1 := a typeIdentifierInList ? ' '. |
|
2271 |
t2 := b typeIdentifierInList ? ' '. |
|
2272 |
t1 = t2 ifTrue:[ |
|
2273 |
sortBlock value:a value:b |
|
2274 |
] ifFalse:[ |
|
2275 |
t1 < t2 |
|
2276 |
] |
|
2277 |
]. |
|
2278 |
||
2279 |
"Modified: / 05-05-2011 / 15:35:02 / cg" |
|
2280 |
! |
|
2281 |
||
2282 |
sortBlockForSortCriteria |
|
2283 |
sortCriteria == #byName ifTrue:[ |
|
2284 |
^ [:a :b| |
|
2285 |
|l1 l2| |
|
2286 |
||
9939
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
2287 |
l1 := a label ? ''. |
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
2288 |
l2 := b label ? ''. |
9891 | 2289 |
l1 = l2 ifTrue:[ |
2290 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
2291 |
] ifFalse:[ |
|
2292 |
l1 < l2 |
|
2293 |
] |
|
2294 |
] |
|
2295 |
]. |
|
2296 |
||
2297 |
sortCriteria == #byNameIgnoringCase ifTrue:[ |
|
2298 |
^ [:a :b| |
|
2299 |
|l1 l2| |
|
2300 |
||
2301 |
l1 := a label asLowercase. |
|
2302 |
l2 := b label asLowercase. |
|
2303 |
l1 = l2 ifTrue:[ |
|
2304 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
2305 |
] ifFalse:[ |
|
2306 |
l1 < l2 |
|
2307 |
] |
|
2308 |
] |
|
2309 |
]. |
|
2310 |
||
2311 |
sortCriteria == #byNameIgnoringLeadingUnderscores ifTrue:[ |
|
2312 |
^ [:a :b| |
|
2313 |
|l1 l2 i| |
|
2314 |
||
2315 |
l1 := a label. |
|
2316 |
l2 := b label. |
|
2317 |
l1 = l2 ifTrue:[ |
|
2318 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
2319 |
] ifFalse:[ |
|
2320 |
i := l1 findFirst:[:c | (c ~~ $_)]. |
|
2321 |
i > 1 ifTrue:[ |
|
2322 |
l1 := l1 copyFrom:i |
|
2323 |
]. |
|
2324 |
i := l2 findFirst:[:c | (c ~~ $_)]. |
|
2325 |
i > 1 ifTrue:[ |
|
2326 |
l2 := l2 copyFrom:i |
|
2327 |
]. |
|
2328 |
l1 < l2 |
|
2329 |
] |
|
2330 |
]. |
|
2331 |
]. |
|
2332 |
||
2333 |
sortCriteria == #byNameIgnoringLeadingUnderscoresAndCase ifTrue:[ |
|
2334 |
^ [:a :b| |
|
2335 |
|l1 l2 i| |
|
2336 |
||
2337 |
l1 := a label asLowercase. |
|
2338 |
l2 := b label asLowercase. |
|
2339 |
l1 = l2 ifTrue:[ |
|
2340 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
2341 |
] ifFalse:[ |
|
2342 |
i := l1 findFirst:[:c | (c ~~ $_)]. |
|
2343 |
i > 1 ifTrue:[ |
|
2344 |
l1 := l1 copyFrom:i |
|
2345 |
]. |
|
2346 |
i := l2 findFirst:[:c | (c ~~ $_)]. |
|
2347 |
i > 1 ifTrue:[ |
|
2348 |
l2 := l2 copyFrom:i |
|
2349 |
]. |
|
2350 |
l1 < l2 |
|
2351 |
] |
|
2352 |
]. |
|
2353 |
]. |
|
2354 |
||
2355 |
"/ sortCriteria == #byType ifTrue:[ |
|
2356 |
"/ ^ [:a :b| |
|
2357 |
"/ |t1 t2 l1 l2| |
|
2358 |
"/ t1 := a typeIdentifierInList ? ' '. |
|
2359 |
"/ t2 := b typeIdentifierInList ? ' '. |
|
2360 |
"/ t1 = t2 ifTrue:[ |
|
2361 |
"/ l1 := a label. |
|
2362 |
"/ l2 := b label. |
|
2363 |
"/ l1 = l2 ifTrue:[ |
|
2364 |
"/ (a lineNumber ? 0) < (b lineNumber ? 0) |
|
2365 |
"/ ] ifFalse:[ |
|
2366 |
"/ l1 < l2 |
|
2367 |
"/ ] |
|
2368 |
"/ ] ifFalse:[ |
|
2369 |
"/ t1 < t2 |
|
2370 |
"/ ] |
|
2371 |
"/ ]. |
|
2372 |
"/ ]. |
|
2373 |
||
2374 |
^ [:a :b| a lineNumber < b lineNumber ] |
|
2375 |
||
2376 |
"Created: / 05-05-2011 / 14:37:25 / cg" |
|
9939
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
2377 |
"Modified: / 18-06-2011 / 19:30:45 / cg" |
9891 | 2378 |
! |
2379 |
||
2380 |
updateContentsFromFilteredList |
|
2381 |
"call this, if only the sort order has changed (no need to call ctags or filter again)" |
|
2382 |
||
2383 |
|list| |
|
2384 |
||
2385 |
list := filteredList. |
|
2386 |
list notEmptyOrNil ifTrue:[ |
|
2387 |
list := list asSortedCollection:(self sortBlock). |
|
2388 |
]. |
|
2389 |
self contents:(list ? #()). |
|
2390 |
||
2391 |
"Created: / 05-05-2011 / 14:45:41 / cg" |
|
2392 |
! |
|
2393 |
||
2394 |
updateContentsFromRawList |
|
2395 |
"call this, if only the filter has changed (no need to call ctags again)" |
|
2396 |
||
2397 |
filteredList := (filter isEmptyOrNil or:[rawList isNil]) |
|
2398 |
ifTrue:[ rawList ] |
|
2399 |
ifFalse:[ self applyFilterToList:rawList ]. |
|
13634 | 2400 |
filteredList notNil ifTrue:[ |
14346 | 2401 |
self hideFunctions == true ifTrue:[ |
13634 | 2402 |
filteredList := filteredList reject:[:tag | tag isFunctionTag]. |
2403 |
] ifFalse:[ |
|
2404 |
showOnly == #functions ifTrue:[ |
|
14433 | 2405 |
filteredList := filteredList select:[:tag | tag isFunctionOrMethodTag]. |
13634 | 2406 |
]. |
13631 | 2407 |
]. |
2408 |
]. |
|
9891 | 2409 |
self updateContentsFromFilteredList |
2410 |
||
2411 |
"Modified: / 05-05-2011 / 15:13:14 / cg" |
|
2412 |
! ! |
|
2413 |
||
2414 |
!TagList methodsFor:'queries'! |
|
2415 |
||
2416 |
bestTagForLine:lineNr |
|
14478 | 2417 |
"find the best tag for a given lineNr in the file" |
2418 |
||
2419 |
^ self bestTagForLine:lineNr filtering:nil |
|
2420 |
! |
|
2421 |
||
2422 |
bestTagForLine:lineNr filtering:tagFilterOrNil |
|
14479 | 2423 |
"find the best tag for a given lineNr in the file. |
2424 |
The filter can be used eg. to find only function tags |
|
2425 |
(i.e. to ignore case and goto labels in C)" |
|
14478 | 2426 |
|
9891 | 2427 |
|bestTag sortedByLineNumber| |
2428 |
||
2429 |
sortedByLineNumber := self sortedByLineNumber. |
|
2430 |
self do:[:eachTag | |
|
2431 |
eachTag notNil ifTrue:[ |
|
14478 | 2432 |
(tagFilterOrNil isNil or:[tagFilterOrNil value:eachTag]) ifTrue:[ |
2433 |
eachTag lineNumber <= lineNr ifTrue:[ |
|
2434 |
bestTag isNil ifTrue:[ |
|
2435 |
bestTag := eachTag. |
|
2436 |
"/ sortedByLineNumber ifTrue:[^ eachTag]. |
|
2437 |
] ifFalse:[ |
|
2438 |
eachTag lineNumber > bestTag lineNumber ifTrue:[ |
|
2439 |
bestTag := eachTag |
|
2440 |
] |
|
9891 | 2441 |
] |
14478 | 2442 |
]. |
9891 | 2443 |
]. |
2444 |
]. |
|
2445 |
]. |
|
2446 |
||
2447 |
^ bestTag |
|
13342 | 2448 |
! |
2449 |
||
2450 |
tagForFunction:functionName |
|
2451 |
^ rawList |
|
2452 |
detect:[:tag | |
|
2453 |
tag isFunctionTag and:[ tag label = functionName ] |
|
2454 |
] |
|
2455 |
ifNone:nil |
|
2456 |
! |
|
2457 |
||
15785 | 2458 |
tagForMacro:macroName |
2459 |
^ rawList |
|
2460 |
detect:[:tag | |
|
2461 |
tag isMacroTag and:[ tag label = macroName ] |
|
2462 |
] |
|
2463 |
ifNone:nil |
|
2464 |
! |
|
2465 |
||
15771 | 2466 |
tagForType:typeName |
2467 |
^ rawList |
|
2468 |
detect:[:tag | |
|
2469 |
tag isTypeTag and:[ tag label = typeName ] |
|
2470 |
] |
|
2471 |
ifNone:nil |
|
2472 |
! |
|
2473 |
||
13342 | 2474 |
tagsValidForFile |
2475 |
"the file, for which the tagsList is valid" |
|
2476 |
||
2477 |
^ tagsValidForFile |
|
9891 | 2478 |
! ! |
2479 |
||
2480 |
!TagList methodsFor:'tag generation'! |
|
2481 |
||
2482 |
fromFile:aFile in:aTempDirectory |
|
2483 |
"create tags from a file; |
|
15855 | 2484 |
either use the ctags/etags command, or an internal naive, simple method." |
9891 | 2485 |
|
13215 | 2486 |
|forceSimpleTagList list shellCmd numTags fileContents| |
9891 | 2487 |
|
2488 |
rawList := nil. |
|
13342 | 2489 |
tagsValidForFile := nil. |
2490 |
||
13215 | 2491 |
forceSimpleTagList := false. |
16181 | 2492 |
(self class isSmalltalkSuffix:aFile suffix) ifTrue:[ |
2493 |
forceSimpleTagList := true. |
|
2494 |
]. |
|
2495 |
||
13215 | 2496 |
"/ the simple builtin tagList generator is actually better than the ctags output for makefiles |
2497 |
(self class makeFilePatterns contains:[:aPattern | (aPattern match:aFile baseName asLowercase)]) ifTrue:[forceSimpleTagList := true]. |
|
2498 |
||
2499 |
forceSimpleTagList ifFalse:[ |
|
2500 |
shellCmd := (self shellCommandFor:aFile pathName). |
|
2501 |
shellCmd notNil ifTrue:[ |
|
2502 |
tagTypesPresent := false. "/ will be set again, when ctags command provides types |
|
16142 | 2503 |
list := ((self getTagListFromFile:aFile usingCommand:shellCmd mode:nil in:aTempDirectory) ? #()) asOrderedCollection. |
16280 | 2504 |
"/ kludge: I am better in getting cases/switches/labels |
2505 |
list addAll:(self getAdditionalCTagsInFile:aFile withList:list). |
|
2506 |
"/ another kludge - add in my own scanned objc tags |
|
2507 |
(self class isObjcSuffix:aFile suffix) ifTrue:[ |
|
2508 |
|objcTags| |
|
2509 |
||
2510 |
objcTags := self objcTagsInFile:aFile. |
|
2511 |
list |
|
2512 |
removeAllSuchThat:[:ctag | |
|
2513 |
objcTags contains:[:objctag | objctag lineNumber = ctag lineNumber] |
|
2514 |
]. |
|
2515 |
list addAll:objcTags. |
|
2516 |
]. |
|
13215 | 2517 |
]. |
9891 | 2518 |
]. |
17504 | 2519 |
list isNil ifTrue:[list := OrderedCollection new]. |
2520 |
||
12343 | 2521 |
"/ in case ctags could not find anything, try our own, naive fallback (not too bad either) |
17504 | 2522 |
"/ list isEmptyOrNil ifTrue:[ |
2523 |
list addAll: ((self getSimpleTagListFromFile:aFile in:aTempDirectory) ? #()). |
|
2524 |
"/ ]. |
|
9891 | 2525 |
tagTypesPresent := true. |
2526 |
||
2527 |
numTags := list size. |
|
2528 |
fileContents := aFile contents. |
|
2529 |
||
2530 |
(numTags > 1 and:[fileContents notEmptyOrNil]) ifTrue:[ |
|
2531 |
numTags to:1 by:-1 do:[:i| |
|
2532 |
|tag lnr| |
|
2533 |
||
2534 |
tag := list at:i ifAbsent:nil. |
|
2535 |
||
2536 |
lnr := tag lineNumberIn:fileContents. |
|
2537 |
lnr == 0 ifTrue:[ |
|
2538 |
list removeIndex:i |
|
2539 |
] ifFalse:[ |
|
2540 |
tag lineNumber:lnr |
|
2541 |
] |
|
2542 |
] |
|
2543 |
]. |
|
2544 |
self setRawList:list. |
|
13342 | 2545 |
tagsValidForFile := aFile. |
9891 | 2546 |
|
17504 | 2547 |
"Modified: / 15-05-2017 / 00:56:22 / cg" |
9891 | 2548 |
! |
2549 |
||
2550 |
fromFile:aFile in:aTempDirectory onTarget:aTarget |
|
2551 |
"create tags from a file; |
|
2552 |
either use the ctags/etags command, or an intenral naive, simple method. |
|
2553 |
" |
|
2554 |
|list| |
|
2555 |
||
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2556 |
remoteTarget := aTarget. |
9891 | 2557 |
|
2558 |
[ |
|
2559 |
list := self fromFile:aFile in:aTempDirectory |
|
11497
b27035bd0981
#ensure instead of #valueNowOrOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
11466
diff
changeset
|
2560 |
] ensure:[ |
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
2561 |
remoteTarget := nil. |
9891 | 2562 |
]. |
2563 |
^ list |
|
2564 |
! |
|
2565 |
||
2566 |
getModeFromFileSuffixOf:aFile |
|
2567 |
|suffix mode| |
|
2568 |
||
2569 |
suffix := aFile suffix. |
|
2570 |
(self class isCSuffix:suffix) ifTrue:[ |
|
2571 |
^ #c. |
|
2572 |
]. |
|
2573 |
(self class isCPlusPlusSuffix:suffix) ifTrue:[ |
|
2574 |
^ #c. |
|
2575 |
]. |
|
2576 |
(self class isJavaSuffix:suffix) ifTrue:[ |
|
2577 |
^ #java. |
|
2578 |
]. |
|
2579 |
(self class isFortranSuffix:suffix) ifTrue:[ |
|
2580 |
^ #fortran. |
|
2581 |
]. |
|
2582 |
(self class isEiffelSuffix:suffix) ifTrue:[ |
|
2583 |
^ #eiffel. |
|
2584 |
]. |
|
2585 |
(self class isHTMLSuffix:suffix) ifTrue:[ |
|
2586 |
^ #html. |
|
2587 |
]. |
|
2588 |
^ mode |
|
2589 |
||
2590 |
"Modified: / 20-04-2011 / 19:02:54 / cg" |
|
2591 |
! |
|
2592 |
||
11050 | 2593 |
getTagListFromFile:aFile usingCommand:scmd mode:modeOrNil in:aTempDirectory |
9891 | 2594 |
"create ctags-list from a file, using cmd (which is etags / ctags)" |
2595 |
||
2596 |
|list pipe tag tagFile contents mode infoDictionary| |
|
2597 |
||
11050 | 2598 |
(mode := modeOrNil) isNil ifTrue:[ |
2599 |
mode := self getModeFromFileSuffixOf:aFile. |
|
2600 |
]. |
|
9891 | 2601 |
list := OrderedCollection new:512. |
2602 |
||
2603 |
infoDictionary := Dictionary new. |
|
2604 |
||
17504 | 2605 |
"/ Transcript showCR:'execute tags command: ', scmd. |
9891 | 2606 |
usingDefaultCTags ifFalse:[ |
2607 |
(pipe := PipeStream readingFrom:scmd) notNil ifTrue:[ |
|
2608 |
[ |
|
2609 |
|line atEnd| |
|
2610 |
||
2611 |
atEnd := false. |
|
2612 |
ReadError |
|
2613 |
handle:[:ex | ] |
|
2614 |
do:[ |
|
2615 |
[atEnd] whileFalse:[ |
|
2616 |
(line := pipe nextLine) isNil ifTrue:[ |
|
2617 |
atEnd := pipe atEnd |
|
2618 |
] ifFalse:[ |
|
17504 | 2619 |
"/ Transcript show:'ctags: '; showCR:line. |
9891 | 2620 |
tag := self tagFromLine:line mode:mode using:infoDictionary. |
2621 |
||
2622 |
tag notNil ifTrue:[ |
|
2623 |
list add:tag |
|
2624 |
] |
|
2625 |
] |
|
2626 |
] |
|
2627 |
] |
|
2628 |
] ensure:[pipe close]. |
|
2629 |
]. |
|
2630 |
^ list. |
|
2631 |
]. |
|
2632 |
||
2633 |
(OperatingSystem executeCommand:scmd inDirectory:aTempDirectory) ifTrue:[ |
|
2634 |
tagFile := aTempDirectory construct:'tags'. |
|
2635 |
||
2636 |
tagFile exists ifTrue:[ |
|
2637 |
contents := tagFile contents. |
|
2638 |
||
2639 |
contents notNil ifTrue:[ |
|
2640 |
contents do:[:aLine| |
|
2641 |
(tag := self tagFromLine:aLine mode:mode using:infoDictionary) notNil ifTrue:[list add:tag] |
|
2642 |
] |
|
2643 |
]. |
|
2644 |
Exception |
|
2645 |
handle:[:ex| ] |
|
2646 |
do:[tagFile remove]. |
|
2647 |
]. |
|
2648 |
^ list. |
|
2649 |
]. |
|
2650 |
||
2651 |
scmd = 'ctags' ifFalse:[ |
|
2652 |
"/ try default ctags without any options |
|
11050 | 2653 |
^ self getTagListFromFile:aFile usingCommand:'ctags' mode:modeOrNil in:aTempDirectory |
9891 | 2654 |
]. |
2655 |
^ #() |
|
11050 | 2656 |
|
2657 |
"Created: / 05-01-2012 / 11:03:04 / cg" |
|
17504 | 2658 |
"Modified (format): / 13-05-2017 / 09:02:03 / cg" |
9891 | 2659 |
! |
2660 |
||
2661 |
tagFromLine:aLine mode:languageMode using:infoDictionary |
|
2662 |
"analyze the line as returned from ctags and create a corresponding tag object for it" |
|
2663 |
||
2664 |
|stream word1 word2 tagType pattern key |
|
2665 |
file className lineNumber tagClass fmtString fmt |
|
2666 |
showOnly| |
|
2667 |
||
13317 | 2668 |
"/ Transcript showCR:aLine. |
9891 | 2669 |
aLine size < 6 ifTrue:[ |
2670 |
^ nil |
|
2671 |
]. |
|
2672 |
aLine first == $!! ifTrue:[ |
|
2673 |
(aLine startsWith:'!!_TAG_FILE_FORMAT') ifTrue:[ |
|
2674 |
"/ aha - ex. ctags |
|
2675 |
stream := aLine readStream. |
|
2676 |
stream upTo:Character tab. |
|
2677 |
stream skipSeparators. |
|
2678 |
fmtString := stream upTo:Character tab. |
|
2679 |
fmt := Integer readFrom:fmtString onError:nil. |
|
2680 |
fmt notNil ifTrue:[ |
|
2681 |
infoDictionary at:#formatVersion put:fmt |
|
2682 |
] |
|
2683 |
]. |
|
2684 |
^ nil |
|
2685 |
]. |
|
2686 |
||
2687 |
"/ tab separated list; except for the pattern, which might include a tab. |
|
2688 |
stream := aLine readStream. |
|
2689 |
key := stream upTo:Character tab. |
|
2690 |
stream skipSeparators. |
|
2691 |
file := stream upTo:Character tab. |
|
2692 |
stream skipSeparators. |
|
2693 |
stream peek == $/ ifTrue:[ |
|
2694 |
stream next. |
|
2695 |
pattern := stream upTo:$/. |
|
2696 |
[(pattern last) == $\] whileTrue:[ |
|
2697 |
pattern at:(pattern size) put:$/. |
|
2698 |
pattern := pattern , (stream upTo:$/). |
|
2699 |
]. |
|
2700 |
] ifFalse:[ |
|
2701 |
stream peek isDigit ifTrue:[ |
|
2702 |
lineNumber := Integer readFrom:stream onError:nil. |
|
2703 |
lineNumber isNil ifTrue:[ |
|
2704 |
self halt:'should not happen - please debug'. |
|
2705 |
] ifFalse:[ |
|
2706 |
pattern := key. |
|
2707 |
]. |
|
2708 |
] ifFalse:[ |
|
2709 |
self halt:'should not happen - please debug'. |
|
2710 |
]. |
|
2711 |
]. |
|
2712 |
stream peekFor:$;. |
|
2713 |
stream peekFor:$". |
|
2714 |
stream skipSeparators. |
|
2715 |
tagType := stream upTo:Character tab. |
|
2716 |
stream skipSeparators. |
|
2717 |
word1 := stream upTo:Character tab. "/ optional file: (scope) |
|
2718 |
stream skipSeparators. |
|
2719 |
word2 := stream upTo:Character tab. "/ optional class: |
|
2720 |
||
2721 |
(word1 startsWith:'file:') ifTrue:[ "/ file: (scope) |
|
14346 | 2722 |
self hideStatic == true ifTrue:[^ nil]. |
9891 | 2723 |
]. |
2724 |
||
2725 |
(word2 startsWith: 'class:') ifTrue:[ |
|
2726 |
className := word2 copyFrom:('class:' size) |
|
2727 |
] ifFalse:[ |
|
2728 |
(word1 startsWith: 'class:') ifTrue:[ |
|
2729 |
className := word1 copyFrom:('class:' size) |
|
2730 |
] |
|
2731 |
]. |
|
2732 |
"/ (word1 startsWith: 'class:') ifTrue:[ |
|
2733 |
"/ className := word1 copyFrom:('class:' size) |
|
2734 |
"/ ]. |
|
2735 |
"/ (word2 startsWith: 'class:') ifTrue:[ |
|
2736 |
"/ className := word2 copyFrom:('class:' size) |
|
2737 |
"/ ]. |
|
2738 |
||
2739 |
tagClass := Tag. |
|
2740 |
tagClass autoload. |
|
2741 |
||
2742 |
"/ typeCharacter to tag-Class mapping... |
|
2743 |
languageMode == #c ifTrue:[ |
|
14385 | 2744 |
"/ Transcript showCR:tagType. |
9891 | 2745 |
tagType = 'v' ifTrue:[ |
14346 | 2746 |
self hideVariables == true ifTrue:[^ nil]. |
9891 | 2747 |
tagClass := Tag::TVariable |
2748 |
] ifFalse:[ tagType = 'f' ifTrue:[ |
|
14346 | 2749 |
self hideFunctions == true ifTrue:[^ nil]. |
9891 | 2750 |
tagClass := Tag::TFunction |
2751 |
] ifFalse:[ tagType = 'd' ifTrue:[ |
|
14346 | 2752 |
self hideDefines == true ifTrue:[^ nil]. |
9891 | 2753 |
tagClass := Tag::TMacro |
2754 |
] ifFalse:[ tagType = 't' ifTrue:[ |
|
14346 | 2755 |
self hideTypedefs == true ifTrue:[^ nil]. |
9891 | 2756 |
tagClass := Tag::TTypedef |
2757 |
] ifFalse:[ tagType = 'm' ifTrue:[ |
|
14346 | 2758 |
self hideStructMembers == true ifTrue:[^ nil]. |
9891 | 2759 |
tagClass := Tag::TMember |
2760 |
] ifFalse:[ tagType = 's' ifTrue:[ |
|
14346 | 2761 |
self hideStructures == true ifTrue:[^ nil]. |
9891 | 2762 |
tagClass := Tag::TStruct |
2763 |
] ifFalse:[ tagType = 'u' ifTrue:[ |
|
14346 | 2764 |
self hideStructures == true ifTrue:[^ nil]. |
9891 | 2765 |
tagClass := Tag::TUnion |
2766 |
] ifFalse:[ tagType = 'c' ifTrue:[ |
|
14346 | 2767 |
self hideClasses == true ifTrue:[^ nil]. |
9891 | 2768 |
tagClass := Tag::TClass |
2769 |
] ifFalse:[ tagType = 'e' ifTrue:[ |
|
2770 |
tagClass := Tag::TEnumMember. |
|
2771 |
] ifFalse:[ tagType = 'g' ifTrue:[ |
|
2772 |
tagClass := Tag::TEnum. |
|
2773 |
"/ ] ifFalse:[ tagType = 'n' ifTrue:[ |
|
2774 |
"/ tagClass := Tag::TNamespace |
|
2775 |
"/ ] ifFalse:[ tagType = 'p' ifTrue:[ |
|
2776 |
"/ tagClass := Tag::TFunctionPrototype |
|
2777 |
"/ ] ifFalse:[ tagType = 'x' ifTrue:[ |
|
2778 |
"/ tagClass := Tag::TExternVariable |
|
2779 |
] ifFalse:[ |
|
13753 | 2780 |
self breakPoint:#cg. |
9891 | 2781 |
"/ add more here |
2782 |
]]]]]]]]]] |
|
2783 |
] ifFalse:[ languageMode == #java ifTrue:[ |
|
2784 |
tagType = 'c' ifTrue:[ |
|
17638 | 2785 |
self hideClasses == true ifTrue:[^ nil]. |
9891 | 2786 |
tagClass := Tag::TClass |
2787 |
] ifFalse:[ tagType = 'm' ifTrue:[ |
|
17555 | 2788 |
self hideMethods == true ifTrue:[^ nil]. |
9891 | 2789 |
tagClass := Tag::TMethod |
2790 |
] ifFalse:[ tagType = 'f' ifTrue:[ |
|
17555 | 2791 |
self hideFields == true ifTrue:[^ nil]. |
9891 | 2792 |
tagClass := Tag::TField |
2793 |
] ifFalse:[ tagType = 'i' ifTrue:[ |
|
17555 | 2794 |
self hideInterfaces == true ifTrue:[^ nil]. |
9891 | 2795 |
tagClass := Tag::TInterface |
2796 |
] ifFalse:[ tagType = 'p' ifTrue:[ |
|
17555 | 2797 |
self hidePackages == true ifTrue:[^ nil]. |
9891 | 2798 |
tagClass := Tag::TPackage |
2799 |
] ifFalse:[ |
|
2800 |
"/ add more here */ |
|
2801 |
]]]]] |
|
2802 |
] ifFalse:[ languageMode == #eiffel ifTrue:[ |
|
2803 |
tagType = 'c' ifTrue:[ |
|
14346 | 2804 |
self hideClasses == true ifTrue:[^ nil]. |
9891 | 2805 |
tagClass := Tag::TClass |
2806 |
"/ ] ifFalse:[ tagType = 'f' ifTrue:[ |
|
2807 |
"/ tagClass := Tag::TFeature |
|
2808 |
"/ ] ifFalse:[ tagType = 'l' ifTrue:[ |
|
2809 |
"/ tagClass := Tag::TLocalEntity |
|
2810 |
] ifFalse:[ |
|
2811 |
"/ add more here */ |
|
2812 |
] |
|
2813 |
] ifFalse:[ languageMode == #fortran ifTrue:[ |
|
2814 |
tagType = 'f' ifTrue:[ |
|
14346 | 2815 |
self hideFunctions == true ifTrue:[^ nil]. |
9891 | 2816 |
tagClass := Tag::TFunction |
2817 |
] ifFalse:[ tagType = 'i' ifTrue:[ |
|
2818 |
"/ hideInterfaces == true ifTrue:[^ nil]. |
|
2819 |
tagClass := Tag::TInterface |
|
2820 |
] ifFalse:[ tagType = 't' ifTrue:[ |
|
14346 | 2821 |
self hideTypedefs == true ifTrue:[^ nil]. |
9891 | 2822 |
tagClass := Tag::TTypedef |
2823 |
"/ ] ifFalse:[ tagType = 'l' ifTrue:[ |
|
2824 |
"/ tagClass := Tag::TLabel |
|
2825 |
"/ ] ifFalse:[ tagType = 'm' ifTrue:[ |
|
2826 |
"/ tagClass := Tag::TModule |
|
2827 |
"/ ] ifFalse:[ tagType = 'n' ifTrue:[ |
|
2828 |
"/ tagClass := Tag::TNameList |
|
2829 |
"/ ] ifFalse:[ tagType = 'p' ifTrue:[ |
|
2830 |
"/ tagClass := Tag::TProgram |
|
2831 |
"/ ] ifFalse:[ tagType = 's' ifTrue:[ |
|
2832 |
"/ tagClass := Tag::TSubroutine |
|
2833 |
"/ ] ifFalse:[ tagType = 'b' ifTrue:[ |
|
2834 |
"/ tagClass := Tag::TBlockData |
|
2835 |
"/ ] ifFalse:[ tagType = 'c' ifTrue:[ |
|
2836 |
"/ tagClass := Tag::TCommonBlock |
|
2837 |
"/ ] ifFalse:[ tagType = 'e' ifTrue:[ |
|
2838 |
"/ tagClass := Tag::TEntryPoint |
|
2839 |
] ifFalse:[ |
|
2840 |
"/ add more here */ |
|
2841 |
]]] |
|
2842 |
]]]]. |
|
2843 |
||
2844 |
tagTypesPresent := true. |
|
2845 |
||
2846 |
tagType size == 0 ifTrue:[ |
|
2847 |
tagType := '' |
|
2848 |
] ifFalse:[ |
|
2849 |
(showOnly := self showOnly) notNil ifTrue:[ |
|
16048 | 2850 |
"/ how ugly can a piece of code get? |
17552 | 2851 |
(showOnly == #classes) ifTrue:[ |
9891 | 2852 |
tagClass ~~ Tag::TClass ifTrue:[^ nil]. |
17552 | 2853 |
] ifFalse:[ (showOnly == #functions) ifTrue:[ |
9891 | 2854 |
tagClass ~~ Tag::TFunction ifTrue:[^ nil]. |
2855 |
] ifFalse:[ showOnly == #variables ifTrue:[ |
|
2856 |
tagClass ~~ Tag::TVariable ifTrue:[^ nil]. |
|
2857 |
] ifFalse:[ showOnly == #types ifTrue:[ |
|
2858 |
(tagClass ~~ Tag::TTypedef |
|
2859 |
and:[ true "tagClass ~~ Tag::TUnion" |
|
2860 |
and:[ tagClass ~~ Tag::TStruct ]])ifTrue:[^ nil]. |
|
2861 |
] ifFalse:[ showOnly == #functionsAndVariables ifTrue:[ |
|
2862 |
((tagClass ~~ Tag::TFunction) |
|
2863 |
and:[tagClass ~~ Tag::TVariable]) ifTrue:[^ nil]. |
|
2864 |
] ifFalse:[ showOnly == #classesFunctionsAndVariables ifTrue:[ |
|
2865 |
((tagClass ~~ Tag::TFunction) |
|
2866 |
and:[(tagClass ~~ Tag::TVariable) |
|
2867 |
and:[tagClass ~~ Tag::TClass]]) ifTrue:[^ nil]. |
|
2868 |
] ifFalse:[ showOnly == #defines ifTrue:[ |
|
2869 |
tagClass ~~ Tag::TMacro ifTrue:[^ nil]. |
|
2870 |
] ifFalse:[ showOnly == #structs ifTrue:[ |
|
2871 |
tagClass ~~ Tag::TStruct ifTrue:[^ nil]. |
|
2872 |
] ifFalse:[ showOnly == #everything ifTrue:[ |
|
16048 | 2873 |
] ifFalse:[ showOnly == #headlines ifTrue:[ |
2874 |
tagClass ~~ Tag::THeaderElement ifTrue:[^ nil]. |
|
2875 |
] ifFalse:[ showOnly == #anchors ifTrue:[ |
|
2876 |
tagClass ~~ Tag::TAnchorElement ifTrue:[^ nil]. |
|
17207 | 2877 |
] ifFalse:[ showOnly == #targets ifTrue:[ |
2878 |
tagClass ~~ Tag::TMakeTarget ifTrue:[^ nil]. |
|
17552 | 2879 |
] ifFalse:[ showOnly == #methods ifTrue:[ |
2880 |
tagClass ~~ Tag::TMethod ifTrue:[^ nil]. |
|
16048 | 2881 |
] ifFalse:[ |
9891 | 2882 |
self halt:'unhandled showOnly'. |
17552 | 2883 |
]]]]]]]]]]]]] |
2884 |
]. |
|
2885 |
tagClass ~~ Tag::TClass ifTrue:[ |
|
2886 |
self hideClasses == true ifTrue:[^ nil]. |
|
2887 |
]. |
|
9891 | 2888 |
]. |
2889 |
||
2890 |
^ tagClass label:key |
|
2891 |
pattern:pattern |
|
2892 |
type:tagType |
|
2893 |
lineNumber:lineNumber |
|
2894 |
className:className. |
|
2895 |
||
17638 | 2896 |
"Modified: / 28-08-2017 / 20:14:16 / cg" |
9891 | 2897 |
! ! |
2898 |
||
13153 | 2899 |
!TagList methodsFor:'tag generation - helpers'! |
2900 |
||
14345 | 2901 |
linewiseNaiveTagsInFile:aFilePath using:parseLineBlock |
2902 |
"common helper for naive linewise parsing tags" |
|
2903 |
||
2904 |
|targets line lineNr s tagOrTagCollection| |
|
2905 |
||
2906 |
Tag autoload. |
|
2907 |
||
2908 |
targets := OrderedCollection new. |
|
2909 |
s := aFilePath asFilename readStream. |
|
2910 |
s notNil ifTrue:[ |
|
2911 |
s := LineNumberReadStream readingFrom:s. |
|
2912 |
[s atEnd] whileFalse:[ |
|
2913 |
lineNr := s lineNumber. |
|
2914 |
line := s nextLine. |
|
2915 |
||
2916 |
tagOrTagCollection := parseLineBlock value:line value:lineNr. |
|
2917 |
tagOrTagCollection notNil ifTrue:[ |
|
2918 |
tagOrTagCollection isCollection ifTrue:[ |
|
2919 |
targets addAll:tagOrTagCollection |
|
2920 |
] ifFalse:[ |
|
2921 |
targets add:tagOrTagCollection |
|
2922 |
]. |
|
2923 |
]. |
|
2924 |
]. |
|
2925 |
s close |
|
2926 |
]. |
|
2927 |
^ targets |
|
2928 |
||
2929 |
"Modified: / 08-05-2011 / 10:12:29 / cg" |
|
2930 |
! |
|
2931 |
||
13153 | 2932 |
plainTextBetweenHTMLElement:startElement andElementWithTag:endTag |
2933 |
"applied to an <h1>-tag element, passing '/h1' as endTag, |
|
2934 |
this retrieves the plain text of the headline. Used by the tag list." |
|
2935 |
||
2936 |
|el collector hasSpace txt| |
|
2937 |
||
14726 | 2938 |
collector := CharacterWriteStream on:(String new:100). |
13153 | 2939 |
el := startElement next. |
2940 |
||
2941 |
hasSpace := true. |
|
2942 |
[ el notNil and:[el tag ~= endTag] ] whileTrue:[ |
|
2943 |
el isTextElement ifTrue:[ |
|
2944 |
hasSpace ifFalse:[ |
|
2945 |
collector space. |
|
2946 |
hasSpace := true. |
|
2947 |
]. |
|
2948 |
txt := el text withoutSeparators. |
|
2949 |
txt notEmpty ifTrue:[ |
|
2950 |
collector nextPutAll:txt. |
|
2951 |
hasSpace := txt endsWith:' '. |
|
2952 |
] |
|
2953 |
]. |
|
2954 |
el := el next |
|
2955 |
]. |
|
2956 |
^ collector contents |
|
2957 |
||
2958 |
"Created: / 12-09-2012 / 12:38:01 / cg" |
|
2959 |
! |
|
2960 |
||
2961 |
tagsForLinesStartingWithIdentifierAndColon:aFilePath |
|
2962 |
"helper for yacc tags (and maybe others in the future): |
|
2963 |
naive, q&d scan for lines matching: |
|
2964 |
<anything>: |
|
2965 |
" |
|
2966 |
||
2967 |
|targets line l lineNr nm s words w| |
|
2968 |
||
2969 |
Tag autoload. |
|
2970 |
||
2971 |
targets := OrderedCollection new. |
|
2972 |
s := aFilePath asFilename readStream. |
|
2973 |
s notNil ifTrue:[ |
|
2974 |
s := LineNumberReadStream readingFrom:s. |
|
2975 |
[s atEnd] whileFalse:[ |
|
2976 |
line := s nextLine. |
|
2977 |
l := line withoutSeparators. |
|
2978 |
words := l asCollectionOfWords. |
|
2979 |
||
2980 |
words size >= 1 ifTrue:[ |
|
2981 |
w := words first. |
|
2982 |
(w endsWith:$:) ifTrue:[ |
|
14579 | 2983 |
nm := w copyButLast. |
13153 | 2984 |
|
2985 |
lineNr := s lineNumber - 1. |
|
2986 |
targets add:(Tag::TLabel |
|
2987 |
label:nm |
|
2988 |
pattern:nil |
|
2989 |
type:nil |
|
2990 |
lineNumber:lineNr). |
|
2991 |
]. |
|
2992 |
] |
|
2993 |
]. |
|
2994 |
s close |
|
2995 |
]. |
|
2996 |
^ targets |
|
2997 |
||
2998 |
"Created: / 28-09-2012 / 14:45:35 / cg" |
|
2999 |
! ! |
|
3000 |
||
9891 | 3001 |
!TagList methodsFor:'tag generation - simple'! |
3002 |
||
3003 |
assemblerTagsInFile:aFilePath |
|
3004 |
"assembler tags: |
|
3005 |
naive, q&d scan for lines matching: |
|
3006 |
<anything>: |
|
3007 |
CAVEAT: |
|
3008 |
the code below handles linux-i386 assembler only (for now) |
|
3009 |
" |
|
3010 |
||
3011 |
|targets line l lineNr nm s words w directive |
|
11502 | 3012 |
hideLocals hideLocals2 hideLocals3 hideData hideText currentSegment| |
9891 | 3013 |
|
3014 |
Tag autoload. |
|
3015 |
||
3016 |
targets := OrderedCollection new. |
|
3017 |
s := aFilePath asFilename readStream. |
|
3018 |
s notNil ifTrue:[ |
|
14346 | 3019 |
hideLocals := self flagNamed:#hideLocalLabels ? false. |
3020 |
hideLocals2 := self flagNamed:#hideLocalLabels2 ? false. |
|
3021 |
hideLocals3 := self flagNamed:#hideLocalLabels3 ? false. |
|
3022 |
hideData := self flagNamed:#hideDataLabels ? false. |
|
3023 |
hideText := self flagNamed:#hideTextLabels ? false. |
|
9891 | 3024 |
currentSegment := #text. |
3025 |
||
3026 |
s := LineNumberReadStream readingFrom:s. |
|
3027 |
[s atEnd] whileFalse:[ |
|
3028 |
lineNr := s lineNumber. |
|
3029 |
line := s nextLine. |
|
3030 |
l := line withoutSeparators. |
|
3031 |
words := l asCollectionOfWords. |
|
3032 |
words size >= 1 ifTrue:[ |
|
3033 |
w := words first. |
|
3034 |
(w endsWith:$:) ifTrue:[ |
|
3035 |
(hideText and:[currentSegment == #text]) ifFalse:[ |
|
3036 |
(hideData and:[currentSegment == #data]) ifFalse:[ |
|
3037 |
(hideLocals and:[(w startsWith:$.)]) ifFalse:[ |
|
11466 | 3038 |
(hideLocals2 and:[(w startsWith:$_) not]) ifFalse:[ |
11502 | 3039 |
(hideLocals3 |
3040 |
and:[ (w startsWith:$L) |
|
3041 |
and:[ (w size > 1) |
|
3042 |
and:[ ((w copyFrom:2 to:(w size-1)) conform:[:c | c isDigit]) |
|
3043 |
]]]) ifFalse:[ |
|
14579 | 3044 |
nm := w copyButLast. |
11502 | 3045 |
targets add:(Tag::TLabel |
3046 |
label:nm |
|
3047 |
pattern:nil |
|
3048 |
type:nil |
|
3049 |
lineNumber:lineNr). |
|
3050 |
]. |
|
11466 | 3051 |
]. |
9891 | 3052 |
]. |
3053 |
]. |
|
3054 |
]. |
|
3055 |
words size >= 2 ifTrue:[ |
|
3056 |
directive := words second |
|
3057 |
] ifFalse:[ |
|
3058 |
directive := nil. |
|
3059 |
] |
|
3060 |
] ifFalse:[ |
|
3061 |
directive := w. |
|
3062 |
]. |
|
3063 |
(directive notNil and:[directive startsWith:$.]) ifTrue:[ |
|
3064 |
directive = '.text' ifTrue:[ |
|
3065 |
currentSegment := #text |
|
3066 |
] ifFalse:[ directive = '.data' ifTrue:[ |
|
3067 |
currentSegment := #data |
|
3068 |
] ifFalse:[ directive = '.bss' ifTrue:[ |
|
3069 |
currentSegment := #data |
|
3070 |
] ifFalse:[ directive = '.rodata' ifTrue:[ |
|
3071 |
currentSegment := #data |
|
3072 |
]]]] |
|
3073 |
] |
|
3074 |
] |
|
3075 |
]. |
|
3076 |
s close |
|
3077 |
]. |
|
3078 |
^ targets |
|
3079 |
||
11502 | 3080 |
"Modified: / 13-05-2012 / 11:25:49 / cg" |
9891 | 3081 |
! |
3082 |
||
11825 | 3083 |
batchTagsInFile:aFilePath |
3084 |
"batch-file |
|
3085 |
naive, q&d scan for lines matching: |
|
3086 |
:<anything> |
|
3087 |
" |
|
3088 |
||
3089 |
|targets line l lineNr nm s words| |
|
3090 |
||
3091 |
Tag autoload. |
|
3092 |
||
3093 |
targets := OrderedCollection new. |
|
3094 |
s := aFilePath asFilename readStream. |
|
3095 |
s notNil ifTrue:[ |
|
3096 |
s := LineNumberReadStream readingFrom:s. |
|
3097 |
[s atEnd] whileFalse:[ |
|
3098 |
line := s nextLine. |
|
3099 |
(line startsWith:$:) ifTrue:[ |
|
3100 |
l := line withoutSeparators. |
|
3101 |
words := (l copyFrom:2) asCollectionOfWords. |
|
3102 |
||
3103 |
words size == 1 ifTrue:[ |
|
3104 |
nm := words first. |
|
3105 |
||
3106 |
lineNr := s lineNumber - 1. |
|
3107 |
targets add:(Tag::TLabel |
|
3108 |
label:nm |
|
3109 |
pattern:nil |
|
3110 |
type:nil |
|
3111 |
lineNumber:lineNr). |
|
3112 |
]. |
|
3113 |
] |
|
3114 |
]. |
|
3115 |
s close |
|
3116 |
]. |
|
3117 |
^ targets |
|
3118 |
||
3119 |
"Created: / 28-09-2012 / 14:45:10 / cg" |
|
3120 |
! |
|
3121 |
||
11762 | 3122 |
dartTagsInFile:aFilePath |
3123 |
"dart tags: |
|
3124 |
naive, q&d scan for lines matching: |
|
3125 |
interface foo |
|
3126 |
class foo |
|
3127 |
function foo |
|
3128 |
" |
|
3129 |
||
3130 |
|targets line l lineNr nm s| |
|
3131 |
||
3132 |
Tag autoload. |
|
3133 |
||
3134 |
targets := OrderedCollection new. |
|
3135 |
s := aFilePath asFilename readStream. |
|
3136 |
s notNil ifTrue:[ |
|
3137 |
s := LineNumberReadStream readingFrom:s. |
|
3138 |
[s atEnd] whileFalse:[ |
|
3139 |
lineNr := s lineNumber. |
|
3140 |
line := s nextLine. |
|
3141 |
l := line withoutSeparators. |
|
3142 |
{ |
|
14346 | 3143 |
{ 'function ' . #functions . self hideFunctions . Tag::TFunction } . |
3144 |
{ 'var ' . #variables . self hideVariables . Tag::TVariable } . |
|
3145 |
{ 'class ' . #classes . self hideClasses . Tag::TClass } . |
|
3146 |
{ 'abstract class ' . #classes . self hideClasses . Tag::TClass } . |
|
17552 | 3147 |
{ 'interface ' . #interfaces . self hideInterfaces . Tag::TInterface } . |
14346 | 3148 |
{ 'factory ' . #methods . self hideMethods . Tag::TMethod } . |
11762 | 3149 |
} tuplesDo:[:keywordSpace :showOnlyEnum :hideVariableValue :tagType| |
3150 |
(l startsWith:keywordSpace) ifTrue:[ |
|
3151 |
(showOnly isNil or:[showOnly == showOnlyEnum]) ifTrue:[ |
|
3152 |
hideVariableValue ~~ true ifTrue:[ |
|
3153 |
nm := l copyFrom:(keywordSpace size + 1). |
|
3154 |
nm := nm copyTo:(nm |
|
11771 | 3155 |
findFirst:[:ch | (ch isLetterOrDigit or:['$_.' includes:ch]) not] |
11762 | 3156 |
ifNone:nm size+1)-1. |
3157 |
targets add:(tagType |
|
3158 |
label:nm |
|
3159 |
pattern:nil |
|
3160 |
type:nil |
|
3161 |
lineNumber:lineNr). |
|
3162 |
] |
|
3163 |
] |
|
3164 |
]. |
|
3165 |
] |
|
3166 |
]. |
|
3167 |
s close |
|
3168 |
]. |
|
3169 |
^ targets |
|
3170 |
||
3171 |
"Created: / 28-06-2010 / 12:44:25 / cg" |
|
17552 | 3172 |
"Modified: / 22-06-2017 / 10:41:01 / cg" |
11762 | 3173 |
! |
3174 |
||
15855 | 3175 |
getAdditionalCTagsInFile:aFilePath withList:ctagsList |
3176 |
"additional tags, which are not found by the standard ctags utility: |
|
3177 |
case foo: - case label tags |
|
3178 |
switch: - case label tags |
|
3179 |
label: - label tags (if there is a corresponding goto) |
|
3180 |
||
3181 |
The already generated ctagsList is passed as argument, |
|
3182 |
so duplicates etc. can be detected" |
|
3183 |
||
3184 |
|targets line lineNr s caseLabel l gotoTargets possibleLabels |
|
3185 |
addLabelTag findCurrentFunctionPrefix| |
|
3186 |
||
3187 |
self hideLabels ifTrue:[^ #()]. |
|
3188 |
showOnly notNil ifTrue:[^ #()]. |
|
17493 | 3189 |
(self class isCSuffix:aFilePath suffix) ifFalse:[^ #()]. |
3190 |
||
15855 | 3191 |
Tag autoload. |
3192 |
||
3193 |
targets := OrderedCollection new. |
|
3194 |
gotoTargets := Set new. |
|
3195 |
possibleLabels := OrderedCollection new. |
|
3196 |
||
3197 |
findCurrentFunctionPrefix := |
|
3198 |
[:lineNr | |
|
3199 |
|bestSoFar| |
|
3200 |
||
3201 |
ctagsList do:[:each | |
|
3202 |
each isFunctionOrMethodTag ifTrue:[ |
|
3203 |
each lineNumber <= lineNr ifTrue:[ |
|
3204 |
(bestSoFar isNil or:[ each lineNumber > bestSoFar lineNumber]) ifTrue:[ |
|
3205 |
bestSoFar := each |
|
3206 |
] |
|
3207 |
]. |
|
3208 |
]. |
|
3209 |
]. |
|
3210 |
bestSoFar isNil |
|
3211 |
ifTrue:[ '' ] |
|
3212 |
ifFalse:[ bestSoFar label, ' ' ] |
|
3213 |
]. |
|
3214 |
||
3215 |
addLabelTag := |
|
3216 |
[:tagType :lineNr :label | |
|
3217 |
|fnPrefix| |
|
3218 |
||
3219 |
fnPrefix := findCurrentFunctionPrefix value:lineNr. |
|
3220 |
targets add:(tagType |
|
3221 |
label:(fnPrefix,label) |
|
3222 |
pattern:nil |
|
3223 |
type:nil |
|
3224 |
lineNumber:lineNr). |
|
3225 |
]. |
|
3226 |
||
3227 |
s := aFilePath asFilename readStream. |
|
3228 |
s notNil ifTrue:[ |
|
3229 |
lineNr := 0. |
|
3230 |
s := LineNumberReadStream readingFrom:s. |
|
3231 |
[s atEnd] whileFalse:[ |
|
3232 |
lineNr := lineNr + 1. |
|
3233 |
line := s nextLine withoutSeparators. |
|
3234 |
((line startsWith:'case ') and:[line includes:$:]) ifTrue:[ |
|
3235 |
l := line readStream. |
|
3236 |
l skip:5. |
|
3237 |
caseLabel := l upTo:$:. |
|
3238 |
addLabelTag value:(Tag::TCaseLabel) value:lineNr |
|
3239 |
value:('case ' allItalic , caseLabel",' <case>' allItalic"). |
|
3240 |
] ifFalse:[ |
|
3241 |
(line startsWith:'default:') ifTrue:[ |
|
3242 |
addLabelTag value:(Tag::TCaseLabel) value:lineNr |
|
3243 |
value:('case ' allItalic, 'default'). |
|
3244 |
] ifFalse:[ |
|
3245 |
((line startsWith:'switch') and:[line includes:$(]) ifTrue:[ |
|
3246 |
l := line readStream. |
|
3247 |
l skip:6. |
|
3248 |
l skipSeparators. |
|
3249 |
l peek == $( ifTrue:[ |
|
3250 |
l next. |
|
3251 |
caseLabel := (l upTo:$)) withoutSeparators. |
|
3252 |
caseLabel notEmpty ifTrue:[ |
|
3253 |
caseLabel := 'switch (',caseLabel,')'. |
|
3254 |
addLabelTag value:(Tag::TCaseLabel) value:lineNr |
|
3255 |
value:('case ' allItalic , caseLabel). |
|
3256 |
] |
|
3257 |
] |
|
3258 |
] ifFalse:[ |
|
3259 |
(line startsWith:'goto ') ifTrue:[ |
|
3260 |
|targetLabel| |
|
3261 |
l := line readStream. |
|
3262 |
l skip:5. |
|
3263 |
l skipSeparators. |
|
3264 |
targetLabel := (l upTo:$; ) withoutSeparators. |
|
3265 |
targetLabel notEmpty ifTrue:[ |
|
3266 |
gotoTargets add:targetLabel. |
|
3267 |
] |
|
3268 |
] ifFalse:[ |
|
3269 |
(line includes:$:) ifTrue:[ |
|
3270 |
|label| |
|
3271 |
label := (line upTo:$:) withoutSeparators. |
|
3272 |
label notEmpty ifTrue:[ |
|
3273 |
((label first isLetter or:[label first = $_]) |
|
3274 |
and:[ label conform:[:ch | ch isLetterOrDigit or:[ch = $_]]]) ifTrue:[ |
|
3275 |
|fnPrefix| |
|
3276 |
fnPrefix := findCurrentFunctionPrefix value:lineNr. |
|
3277 |
possibleLabels |
|
3278 |
add:(Tag::TCaseLabel |
|
3279 |
label:(fnPrefix,('label ' allItalic , label)) |
|
3280 |
pattern:label |
|
3281 |
type:nil |
|
3282 |
lineNumber:lineNr) |
|
3283 |
]. |
|
3284 |
]. |
|
3285 |
]. |
|
3286 |
]. |
|
3287 |
] |
|
3288 |
] |
|
3289 |
]. |
|
3290 |
]. |
|
3291 |
s close |
|
3292 |
]. |
|
3293 |
possibleLabels |
|
3294 |
select:[:lbl | gotoTargets includes:lbl pattern] |
|
3295 |
thenDo:[:lbl | targets add:lbl]. |
|
3296 |
^ targets |
|
17493 | 3297 |
|
3298 |
"Modified: / 11-04-2017 / 10:02:50 / cg" |
|
15855 | 3299 |
! |
3300 |
||
3301 |
getAdditionalTagsInFile:aFile withList:ctagsList |
|
3302 |
"a chance to generate a list of additional tags, |
|
3303 |
which are not found by the standard ctags utility. |
|
3304 |
For example, for C, labels and switches are detected and added. |
|
3305 |
The already generated ctagsList is passed as argument, |
|
3306 |
so duplicates etc. can be detected" |
|
3307 |
||
3308 |
(self class isCSuffix:(aFile suffix)) ifTrue:[ |
|
3309 |
^ self getAdditionalCTagsInFile:aFile withList:ctagsList |
|
3310 |
]. |
|
3311 |
^ #() |
|
3312 |
! |
|
3313 |
||
11050 | 3314 |
getSimpleTagListFromFile:aFileOrString in:aTempDirectory |
9891 | 3315 |
"fallback, if no ctags is present, or if the file is not a c-file. |
3316 |
Implemented here for some other file types (Makefiles) |
|
3317 |
" |
|
14365 | 3318 |
|file lcName pathName suffix mime| |
11050 | 3319 |
|
3320 |
file := aFileOrString asFilename. |
|
3321 |
lcName := file baseName asLowercase. |
|
3322 |
pathName := file pathName. |
|
3323 |
||
9891 | 3324 |
self class makeFilePatterns do:[:aPattern | |
3325 |
(aPattern match:lcName) ifTrue:[ |
|
3326 |
^ self class makeTargetTagsInFile:pathName filter:showOnly |
|
3327 |
] |
|
3328 |
]. |
|
3329 |
||
3330 |
suffix := lcName asFilename suffix. |
|
14365 | 3331 |
mime := TagList tagMimeTypeForFile:file. |
3332 |
||
3333 |
((self class isSmalltalkSuffix:suffix) |
|
3334 |
or:[(mime ? '') includesString:'smalltalk']) ifTrue:[ |
|
9891 | 3335 |
"/ smalltalk tags - simulated |
11050 | 3336 |
^ self stTagsInFile:pathName in:aTempDirectory |
9891 | 3337 |
]. |
14365 | 3338 |
((self class isPythonSuffix:suffix) |
3339 |
or:[(mime ? '') includesString:'python']) ifTrue:[ |
|
9891 | 3340 |
"/ python tags - simulated |
3341 |
^ self pythonTagsInFile:pathName |
|
3342 |
]. |
|
14365 | 3343 |
((self class isPhpSuffix:suffix) |
3344 |
or:[(mime ? '') includesString:'php']) ifTrue:[ |
|
9891 | 3345 |
"/ php tags - simulated |
3346 |
^ self phpTagsInFile:pathName |
|
3347 |
]. |
|
14365 | 3348 |
((self class isLispSuffix:suffix) |
3349 |
or:[(mime ? '') includesString:'lisp']) ifTrue:[ |
|
9891 | 3350 |
"/ lisp tags - simulated |
3351 |
^ self lispTagsInFile:pathName |
|
3352 |
]. |
|
16280 | 3353 |
((self class isObjcSuffix:suffix) |
3354 |
or:[(mime ? '') includesString:'objcsrc']) ifTrue:[ |
|
3355 |
"/ objc tags - simulated |
|
3356 |
^ self objcTagsInFile:pathName |
|
3357 |
]. |
|
14365 | 3358 |
((self class isOzSuffix:suffix) |
3359 |
or:[(mime ? '') includesString:'oz']) ifTrue:[ |
|
9891 | 3360 |
"/ oz tags - simulated |
3361 |
^ self ozTagsInFile:pathName |
|
3362 |
]. |
|
14365 | 3363 |
((self class isPrologSuffix:suffix) |
3364 |
or:[(mime ? '') includesString:'prolog']) ifTrue:[ |
|
9891 | 3365 |
"/ prolog tags - simulated |
3366 |
^ self prologTagsInFile:pathName |
|
3367 |
]. |
|
14365 | 3368 |
((self class isTCLSuffix:suffix) |
3369 |
or:[(mime ? '') includesString:'tcl']) ifTrue:[ |
|
9891 | 3370 |
"/ tcl tags - simulated |
3371 |
^ self tclTagsInFile:pathName |
|
3372 |
]. |
|
14365 | 3373 |
((self class isAssemblerSuffix:suffix) |
3374 |
or:[(mime ? '') includesString:'assembler']) ifTrue:[ |
|
9891 | 3375 |
"/ assembler tags - simulated |
3376 |
^ self assemblerTagsInFile:pathName |
|
3377 |
]. |
|
14365 | 3378 |
((self class isRubySuffix:suffix) |
3379 |
or:[(mime ? '') includesString:'ruby']) ifTrue:[ |
|
9891 | 3380 |
"/ ruby tags - simulated |
3381 |
^ self rubyTagsInFile:pathName |
|
3382 |
]. |
|
14365 | 3383 |
((self class isYaccSuffix:suffix) |
3384 |
or:[(mime ? '') includesString:'yacc']) ifTrue:[ |
|
9891 | 3385 |
"/ yacc tags - simulated |
3386 |
^ self yaccTagsInFile:pathName |
|
3387 |
]. |
|
14365 | 3388 |
((self class isJavaScriptSuffix:suffix) |
3389 |
or:[(mime ? '') includesString:'javascript']) ifTrue:[ |
|
9891 | 3390 |
"/ js tags - simulated |
3391 |
^ self javaScriptTagsInFile:pathName |
|
3392 |
]. |
|
14365 | 3393 |
((self class isDartSuffix:suffix) |
3394 |
or:[(mime ? '') includesString:'dart']) ifTrue:[ |
|
11766 | 3395 |
"/ dart tags - simulated |
3396 |
^ self dartTagsInFile:pathName |
|
3397 |
]. |
|
14365 | 3398 |
((self class isLuaSuffix:suffix) |
3399 |
or:[(mime ? '') includesString:'lua']) ifTrue:[ |
|
14345 | 3400 |
"/ lua tags - simulated |
3401 |
^ self luaTagsInFile:pathName |
|
3402 |
]. |
|
9891 | 3403 |
|
14365 | 3404 |
((self class isHTMLSuffix:suffix) |
3405 |
or:[(mime ? '') includesString:'html']) ifTrue:[ |
|
9891 | 3406 |
"/ html tags - simulated |
3407 |
^ self htmlTagsInFile:pathName |
|
3408 |
]. |
|
14365 | 3409 |
((self class isBatchSuffix:suffix) |
3410 |
or:[(mime ? '') includesString:'batch']) ifTrue:[ |
|
11825 | 3411 |
"/ batch tags - simulated |
3412 |
^ self batchTagsInFile:pathName |
|
3413 |
]. |
|
15685 | 3414 |
((self class isXSDSuffix:suffix) |
3415 |
or:[(mime ? '') includesString:'xsd']) ifTrue:[ |
|
3416 |
"/ xsd tags - simulated |
|
3417 |
^ self xsdTagsInFile:pathName |
|
3418 |
]. |
|
15711 | 3419 |
(suffix = 'rs') ifTrue:[ |
3420 |
^ self stxResourceTagsInFile:pathName |
|
3421 |
]. |
|
9891 | 3422 |
|
3423 |
"/ could add more here ... |
|
3424 |
^ nil. |
|
3425 |
||
11050 | 3426 |
"Created: / 05-01-2012 / 10:55:03 / cg" |
9891 | 3427 |
! |
3428 |
||
3429 |
htmlTagsInFile:aFilePath |
|
3430 |
"hatml tags: |
|
13153 | 3431 |
naive, q&d scan for lines containing: |
9891 | 3432 |
<textarea> |
3433 |
<input> |
|
3434 |
<table> |
|
3435 |
<script> |
|
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3436 |
<hX> |
9891 | 3437 |
" |
3438 |
||
3439 |
|targets line l lineNr s tag| |
|
3440 |
||
3441 |
"/ TODO: use HTMPParser to read all of them !! |
|
3442 |
||
3443 |
Tag autoload. |
|
3444 |
||
3445 |
targets := OrderedCollection new. |
|
3446 |
s := aFilePath asFilename readStream. |
|
3447 |
s notNil ifTrue:[ |
|
3448 |
s := LineNumberReadStream readingFrom:s. |
|
3449 |
[s atEnd] whileFalse:[ |
|
3450 |
lineNr := s lineNumber. |
|
3451 |
line := s nextLine. |
|
9918 | 3452 |
line := line withoutSeparators. |
3453 |
l := line asLowercase. |
|
9891 | 3454 |
|
3455 |
#( |
|
14579 | 3456 |
'textarea' hideHTMLTextArea nil |
3457 |
'input' hideHTMLInput nil |
|
3458 |
'table' hideHTMLTable nil |
|
3459 |
'script' hideHTMLScript nil |
|
3460 |
'form' hideHTMLForm nil |
|
3461 |
'a' nil anchors |
|
3462 |
'h1' hideHTMLHeaders headlines |
|
3463 |
'h2' hideHTMLHeaders headlines |
|
3464 |
'h3' hideHTMLHeaders headlines |
|
3465 |
'h4' hideHTMLHeaders headlines |
|
3466 |
'h5' hideHTMLHeaders headlines |
|
3467 |
'h6' hideHTMLHeaders headlines |
|
3468 |
) inGroupsOf:3 do:[:nm :hideInstVarName :thisType| |
|
11802 | 3469 |
|type hideHolder idx tagText doc markup label text markupName markupType |
3470 |
isHeader| |
|
9891 | 3471 |
|
3472 |
type := hideHolder := nil. |
|
3473 |
||
3474 |
idx := l indexOfSubCollection:('<',nm). |
|
3475 |
idx ~~ 0 ifTrue:[ |
|
11802 | 3476 |
hideHolder := hideInstVarName isNil |
3477 |
ifTrue:[ false ] |
|
14382 | 3478 |
ifFalse:[ self flagNamed:hideInstVarName ]. |
9891 | 3479 |
|
9918 | 3480 |
tagText := line copyFrom:idx. |
9891 | 3481 |
doc := HTMLParser new parseText:tagText. |
3482 |
markup := doc markup. |
|
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3483 |
markupName := markup name. |
11802 | 3484 |
markupType := "markup tag ?" markup type. |
3485 |
||
3486 |
isHeader := (#(h1 h2 h3 h4 h5 h6) includes:markupType). |
|
3487 |
isHeader ifTrue:[ |
|
3488 |
type := Tag::THeaderElement |
|
3489 |
] ifFalse: [ |
|
3490 |
markupType == #'form' ifTrue:[ |
|
3491 |
type := Tag::TFormElement |
|
3492 |
] ifFalse:[ |
|
3493 |
markupType == #'a' ifTrue:[ |
|
3494 |
type := Tag::TAnchorElement. |
|
17071 | 3495 |
markupName := markup hrefString notEmptyOrNil |
3496 |
ifTrue:['"',markup hrefString,'"'] |
|
3497 |
ifFalse:[ markup name ] |
|
11802 | 3498 |
] ifFalse:[ |
3499 |
type := Tag::TElement |
|
3500 |
] |
|
3501 |
]. |
|
3502 |
]. |
|
3503 |
||
9891 | 3504 |
markup id notEmptyOrNil ifTrue:[ |
3505 |
label := nm , ' (',markup id,')' |
|
3506 |
] ifFalse:[ |
|
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3507 |
markupName notEmptyOrNil ifTrue:[ |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3508 |
label := nm , ' (',markupName,')' |
9891 | 3509 |
] ifFalse:[ |
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3510 |
(markupType == #input and:[ markup valueString notEmptyOrNil ]) ifTrue:[ |
11802 | 3511 |
label := nm , ' ("',markup valueString,'")' |
9918 | 3512 |
] ifFalse:[ |
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3513 |
(markupType == #script and:[ markup src notEmptyOrNil ]) ifTrue:[ |
9918 | 3514 |
label := nm , ' ("',markup src,'")' |
3515 |
] ifFalse:[ |
|
11802 | 3516 |
( isHeader |
3517 |
and:[text := self plainTextBetweenHTMLElement:markup andElementWithTag:('/',markupType). |
|
3518 |
text notEmpty] |
|
3519 |
) ifTrue:[ |
|
11801
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3520 |
label := '"',text,'" (',nm,')' |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3521 |
] ifFalse:[ |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3522 |
label := nm |
18a705623785
better html tags (h-elements)
Claus Gittinger <cg@exept.de>
parents:
11771
diff
changeset
|
3523 |
] |
9918 | 3524 |
] |
3525 |
] |
|
9891 | 3526 |
]. |
3527 |
]. |
|
3528 |
||
14579 | 3529 |
(showOnly isNil or:[thisType isNil or:[showOnly == thisType]]) ifTrue:[ |
3530 |
hideHolder value ~~ true ifTrue:[ |
|
3531 |
tag := type |
|
3532 |
label:label |
|
3533 |
pattern:nil |
|
3534 |
type:nil |
|
3535 |
lineNumber:lineNr. |
|
3536 |
targets add:tag. |
|
3537 |
] |
|
9891 | 3538 |
] |
3539 |
]. |
|
3540 |
]. |
|
3541 |
]. |
|
3542 |
s close |
|
3543 |
]. |
|
3544 |
^ targets |
|
3545 |
||
3546 |
"Created: / 20-04-2011 / 18:59:29 / cg" |
|
11802 | 3547 |
"Modified: / 12-09-2012 / 17:54:07 / cg" |
17071 | 3548 |
"Modified (format): / 16-11-2016 / 17:17:41 / cg" |
9891 | 3549 |
! |
3550 |
||
3551 |
javaScriptTagsInFile:aFilePath |
|
3552 |
"javaScript tags: |
|
3553 |
naive, q&d scan for lines matching: |
|
3554 |
(function foo |
|
3555 |
" |
|
3556 |
||
3557 |
|targets line l lineNr nm s| |
|
3558 |
||
3559 |
Tag autoload. |
|
3560 |
||
3561 |
targets := OrderedCollection new. |
|
3562 |
s := aFilePath asFilename readStream. |
|
3563 |
s notNil ifTrue:[ |
|
3564 |
s := LineNumberReadStream readingFrom:s. |
|
3565 |
[s atEnd] whileFalse:[ |
|
3566 |
lineNr := s lineNumber. |
|
3567 |
line := s nextLine. |
|
3568 |
l := line withoutSeparators. |
|
3569 |
||
14359 | 3570 |
(l = 'function') ifTrue:[ |
3571 |
l := l , ' ' , (s nextLine withoutSeparators). |
|
3572 |
]. |
|
9891 | 3573 |
(l startsWith:'function ') ifTrue:[ |
3574 |
(showOnly isNil or:[showOnly == #functions]) ifTrue:[ |
|
14346 | 3575 |
self hideFunctions ~~ true ifTrue:[ |
9891 | 3576 |
nm := l copyFrom:('function ' size + 1). |
3577 |
nm := nm copyTo:(nm |
|
3578 |
findFirst:[:ch | (ch isLetterOrDigit or:['$_' includes:ch]) not] |
|
3579 |
ifNone:nm size+1)-1. |
|
3580 |
targets add:(Tag::TFunction |
|
3581 |
label:nm |
|
3582 |
pattern:nil |
|
3583 |
type:nil |
|
3584 |
lineNumber:lineNr). |
|
3585 |
] |
|
3586 |
] |
|
3587 |
] ifFalse:[ |
|
3588 |
(l startsWith:'var ') ifTrue:[ |
|
3589 |
(showOnly isNil or:[showOnly == #variables]) ifTrue:[ |
|
14346 | 3590 |
self hideVariables ~~ true ifTrue:[ |
9891 | 3591 |
nm := l copyFrom:('var ' size + 1). |
3592 |
nm := nm copyTo:(nm |
|
3593 |
findFirst:[:ch | (ch isLetterOrDigit or:['$_' includes:ch]) not] |
|
3594 |
ifNone:nm size+1)-1. |
|
3595 |
targets add:(Tag::TVariable |
|
3596 |
label:nm |
|
3597 |
pattern:nil |
|
3598 |
type:nil |
|
3599 |
lineNumber:lineNr). |
|
3600 |
]. |
|
3601 |
]. |
|
15072 | 3602 |
] ifFalse:[ |
3603 |
((l includesString:'=function') or:[(l includesString:'= function')]) ifTrue:[ |
|
3604 |
(showOnly isNil or:[showOnly == #functions]) ifTrue:[ |
|
3605 |
self hideFunctions ~~ true ifTrue:[ |
|
3606 |
nm := l copyTo:((l indexOf:$=) - 1). nm := nm withoutSeparators. |
|
3607 |
targets add:(Tag::TFunction |
|
3608 |
label:nm |
|
3609 |
pattern:nil |
|
3610 |
type:nil |
|
3611 |
lineNumber:lineNr). |
|
3612 |
]. |
|
3613 |
]. |
|
3614 |
]. |
|
9891 | 3615 |
]. |
3616 |
] |
|
3617 |
]. |
|
3618 |
s close |
|
3619 |
]. |
|
3620 |
^ targets |
|
3621 |
||
3622 |
"Created: / 28-06-2010 / 12:44:25 / cg" |
|
9921 | 3623 |
"Modified: / 08-05-2011 / 10:39:55 / cg" |
9891 | 3624 |
! |
3625 |
||
3626 |
lispTagFromLine:line lineNr:lineNr |
|
14344 | 3627 |
"lisp/scheme tags: |
15912 | 3628 |
naive, q&d scan for lines starting with: |
9891 | 3629 |
(define ... |
3630 |
(defun ... |
|
3631 |
(defvar ... |
|
3632 |
(defmacro ... |
|
3633 |
(defclass ... |
|
3634 |
(defmethod ... |
|
3635 |
(defpackage ... |
|
3636 |
(eval-when ... |
|
3637 |
(define- ... |
|
3638 |
(def* ... |
|
3639 |
(set ... |
|
3640 |
(constant ... |
|
3641 |
(defconstant ... |
|
15912 | 3642 |
(define-constant ... |
9921 | 3643 |
;;; more documentation |
15912 | 3644 |
|
3645 |
This is NOT syntax aware, so affected by formatting, line breaks etc. |
|
3646 |
Just enough to allow most scheme and lisp programs to be tagged and |
|
17495 | 3647 |
viewed in the file browser. For real lisp work, much more is needed. |
9891 | 3648 |
" |
3649 |
||
14352 | 3650 |
|l nm words def inParens rest| |
9891 | 3651 |
|
3652 |
l := line withoutSeparators. |
|
3653 |
||
9921 | 3654 |
(l startsWith:'(') ifFalse:[ |
3655 |
(showOnly notNil and:[showOnly ~~ #documentation]) ifTrue:[^ nil]. |
|
14346 | 3656 |
self hideDocumentation == true ifTrue:[ ^ nil ]. |
9921 | 3657 |
|
3658 |
(l startsWith:';;;') ifFalse:[^ nil]. |
|
15912 | 3659 |
|
9921 | 3660 |
rest := (l copyFrom:4) withoutSeparators. |
3661 |
rest isEmpty ifTrue:[^ nil]. |
|
15288 | 3662 |
(rest conform:[:ch | ch == $;]) ifTrue:[^ nil]. |
9921 | 3663 |
^ Tag::TDocumentation |
16509 | 3664 |
label:(rest withColor:(Color blue "grey")) |
9921 | 3665 |
pattern:nil |
3666 |
type:nil |
|
3667 |
lineNumber:lineNr. |
|
3668 |
]. |
|
9891 | 3669 |
|
3670 |
words := (l copyFrom:2) asCollectionOfWords. |
|
3671 |
words size >= 2 ifFalse:[^ nil]. |
|
3672 |
||
3673 |
def := words first. |
|
3674 |
nm := words second. |
|
15912 | 3675 |
|
3676 |
"/ inparens is true if we have (define (name |
|
3677 |
(inParens := nm = '(') ifTrue:[ |
|
3678 |
words size > 2 ifTrue:[ nm := words third ] ifFalse:[ nm := '' ]. |
|
3679 |
] ifFalse:[ |
|
9891 | 3680 |
(inParens := nm startsWith:'(') ifTrue:[ |
3681 |
nm := nm copyFrom:2. |
|
15912 | 3682 |
] ifFalse:[ |
3683 |
nm := nm upTo:$(. "/ in case it is (define foo() - without space after name |
|
3684 |
(inParens := nm startsWith:'(') ifTrue:[ |
|
3685 |
nm := nm copyFrom:2. |
|
3686 |
]. |
|
9891 | 3687 |
]. |
15912 | 3688 |
]. |
9891 | 3689 |
(nm endsWith:')') ifTrue:[ |
14579 | 3690 |
nm := nm copyButLast |
9891 | 3691 |
]. |
3692 |
||
3693 |
def = 'define' ifTrue:[ "/ scheme |
|
3694 |
inParens ifTrue:[ |
|
3695 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
14346 | 3696 |
self hideFunctions == true ifTrue:[ ^ nil ]. |
9891 | 3697 |
^ Tag::TFunction |
3698 |
label:nm |
|
3699 |
pattern:nil |
|
3700 |
type:nil |
|
3701 |
lineNumber:lineNr. |
|
3702 |
] ifFalse:[ |
|
14344 | 3703 |
"/ check for (define name (lambda ... |
3704 |
"/ and (define name (macro ... |
|
3705 |
(words size > 2 |
|
3706 |
and:[ words third startsWith:'(' ]) ifTrue:[ |
|
3707 |
(words third = '(' and:[words size > 3]) ifTrue:[ |
|
3708 |
def := words fourth |
|
3709 |
] ifFalse:[ |
|
3710 |
def := words third copyFrom:2. |
|
3711 |
]. |
|
3712 |
def = 'lambda' ifTrue:[ |
|
3713 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
14346 | 3714 |
self hideFunctions == true ifTrue:[ ^ nil ]. |
14344 | 3715 |
^ Tag::TFunction |
3716 |
label:nm |
|
3717 |
pattern:nil |
|
3718 |
type:nil |
|
3719 |
lineNumber:lineNr. |
|
3720 |
]. |
|
3721 |
def = 'macro' ifTrue:[ |
|
3722 |
(showOnly notNil and:[showOnly ~~ #macros]) ifTrue:[^ nil]. |
|
14346 | 3723 |
self hideLispMacros == true ifTrue:[ ^ nil ]. |
14344 | 3724 |
^ Tag::TLispMacro |
3725 |
label:nm |
|
3726 |
pattern:nil |
|
3727 |
type:nil |
|
3728 |
lineNumber:lineNr. |
|
3729 |
]. |
|
3730 |
]. |
|
9891 | 3731 |
(showOnly notNil and:[showOnly ~~ #variables]) ifTrue:[^ nil]. |
14346 | 3732 |
self hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 3733 |
^ Tag::TVariable |
3734 |
label:nm |
|
3735 |
pattern:nil |
|
3736 |
type:nil |
|
3737 |
lineNumber:lineNr. |
|
3738 |
]. |
|
3739 |
^ nil |
|
3740 |
]. |
|
3741 |
||
15912 | 3742 |
def = 'defun' ifTrue:[ |
3743 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
3744 |
self hideFunctions == true ifTrue:[ ^ nil ]. |
|
3745 |
||
3746 |
^ Tag::TFunction |
|
3747 |
label:nm |
|
3748 |
pattern:nil |
|
3749 |
type:nil |
|
3750 |
lineNumber:lineNr. |
|
3751 |
]. |
|
9891 | 3752 |
def = 'defvar' ifTrue:[ |
3753 |
(showOnly notNil and:[showOnly ~~ #variables]) ifTrue:[^ nil]. |
|
14346 | 3754 |
self hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 3755 |
^ Tag::TVariable |
3756 |
label:nm |
|
3757 |
pattern:nil |
|
3758 |
type:nil |
|
3759 |
lineNumber:lineNr. |
|
3760 |
]. |
|
3761 |
def = 'set' ifTrue:[ |
|
14346 | 3762 |
self hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 3763 |
^ Tag::TVariable |
3764 |
label:nm |
|
3765 |
pattern:nil |
|
3766 |
type:nil |
|
3767 |
lineNumber:lineNr. |
|
3768 |
]. |
|
15912 | 3769 |
(def = 'defconstant' or:[def = 'define-constant' or:[def = 'constant']]) ifTrue:[ |
9891 | 3770 |
(showOnly notNil and:[showOnly ~~ #constants]) ifTrue:[^ nil]. |
14346 | 3771 |
self hideLispConstants == true ifTrue:[ ^ nil ]. |
9891 | 3772 |
^ Tag::TLispConstant |
3773 |
label:nm |
|
3774 |
pattern:nil |
|
3775 |
type:nil |
|
3776 |
lineNumber:lineNr. |
|
3777 |
]. |
|
3778 |
(def = 'mac' or:[def = 'defmacro' or:[def = 'define-macro']]) ifTrue:[ |
|
3779 |
(showOnly notNil and:[showOnly ~~ #macros]) ifTrue:[^ nil]. |
|
14346 | 3780 |
self hideLispMacros == true ifTrue:[ ^ nil ]. |
9891 | 3781 |
^ Tag::TLispMacro |
3782 |
label:nm |
|
3783 |
pattern:nil |
|
3784 |
type:nil |
|
3785 |
lineNumber:lineNr. |
|
3786 |
]. |
|
3787 |
(def = 'defclass' or:[def = 'define-class']) ifTrue:[ |
|
3788 |
(showOnly notNil and:[showOnly ~~ #classes]) ifTrue:[^ nil]. |
|
14346 | 3789 |
self hideClasses == true ifTrue:[ ^ nil ]. |
9891 | 3790 |
^ Tag::TClass |
3791 |
label:nm |
|
3792 |
pattern:nil |
|
3793 |
type:nil |
|
3794 |
lineNumber:lineNr. |
|
3795 |
]. |
|
3796 |
(def = 'defmethod' or:[def = 'define-method' or:[def = 'define-generic']]) ifTrue:[ |
|
3797 |
(showOnly notNil and:[showOnly ~~ #methods]) ifTrue:[^ nil]. |
|
14346 | 3798 |
self hideLispMethods == true ifTrue:[ ^ nil ]. |
9891 | 3799 |
^ Tag::TMethod |
3800 |
label:nm |
|
3801 |
pattern:nil |
|
3802 |
type:nil |
|
3803 |
lineNumber:lineNr. |
|
3804 |
]. |
|
3805 |
(def = 'defpackage') ifTrue:[ |
|
14346 | 3806 |
self hideLispMethods == true ifTrue:[ ^ nil ]. |
9891 | 3807 |
^ Tag::TPackage |
3808 |
label:nm |
|
3809 |
pattern:nil |
|
3810 |
type:nil |
|
3811 |
lineNumber:lineNr. |
|
3812 |
]. |
|
3813 |
def = 'eval-when' ifTrue:[ |
|
14346 | 3814 |
self hideLispEvaluations == true ifTrue:[ ^ nil ]. |
9891 | 3815 |
^ Tag::TLispEval |
14352 | 3816 |
label:nm |
9891 | 3817 |
pattern:nil |
3818 |
type:nil |
|
3819 |
lineNumber:lineNr. |
|
3820 |
]. |
|
3821 |
def = 'defstruct' ifTrue:[ |
|
14346 | 3822 |
self hideStructures == true ifTrue:[ ^ nil ]. |
9891 | 3823 |
^ Tag::TStruct |
3824 |
label:nm |
|
3825 |
pattern:nil |
|
3826 |
type:nil |
|
3827 |
lineNumber:lineNr. |
|
3828 |
]. |
|
3829 |
(def startsWith:'def') ifTrue:[ |
|
3830 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
14346 | 3831 |
self hideFunctions == true ifTrue:[ ^ nil ]. |
9891 | 3832 |
^ Tag::TFunction |
3833 |
label:nm |
|
3834 |
pattern:nil |
|
3835 |
type:nil |
|
3836 |
lineNumber:lineNr. |
|
3837 |
]. |
|
3838 |
^ nil |
|
3839 |
||
9921 | 3840 |
"Modified: / 08-05-2011 / 10:57:03 / cg" |
9891 | 3841 |
! |
3842 |
||
3843 |
lispTagsInFile:aFilePath |
|
3844 |
"lisp tags: |
|
3845 |
naive, q&d scan for lines starting with (not syntax-aware): |
|
3846 |
(define ... |
|
3847 |
(defun ... |
|
3848 |
(defvar ... |
|
3849 |
(defmacro ... |
|
3850 |
(defclass ... |
|
3851 |
(defmethod ... |
|
3852 |
(defpackage ... |
|
3853 |
(eval-when ... |
|
3854 |
(define- ... |
|
3855 |
(def* ... |
|
3856 |
(set ... |
|
3857 |
(constant ... |
|
3858 |
(defconstant ... |
|
9921 | 3859 |
;;; moretext documentation |
9891 | 3860 |
" |
3861 |
||
14345 | 3862 |
^ self |
3863 |
linewiseNaiveTagsInFile:aFilePath |
|
3864 |
using:[:line :lineNr | |
|
3865 |
self lispTagFromLine:line lineNr:lineNr |
|
3866 |
] |
|
9891 | 3867 |
|
9921 | 3868 |
"Modified: / 08-05-2011 / 10:12:29 / cg" |
9891 | 3869 |
! |
3870 |
||
14345 | 3871 |
luaTagFromLine:line lineNr:lineNr |
3872 |
"lua tags: |
|
3873 |
naive, q&d scan for lines starting with (not syntax-aware): |
|
3874 |
local function ... |
|
3875 |
" |
|
3876 |
||
3877 |
|l nm words def isLocal| |
|
3878 |
||
3879 |
l := line withoutSeparators. |
|
3880 |
||
3881 |
(l startsWith:'--') ifTrue:[^ nil]. "/ comment |
|
3882 |
||
3883 |
words := l splitByAny:(' (),',Character tab). |
|
3884 |
words size >= 2 ifFalse:[^ nil]. |
|
3885 |
||
3886 |
(isLocal := words first = 'local') ifTrue:[ words := words copyFrom:2 ]. |
|
3887 |
words size <= 2 ifTrue:[ ^ nil ]. |
|
3888 |
def := words first. |
|
3889 |
nm := words second. |
|
3890 |
||
3891 |
def = 'function' ifTrue:[ |
|
3892 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
14346 | 3893 |
self hideFunctions == true ifTrue:[ ^ nil ]. |
14345 | 3894 |
^ Tag::TFunction |
3895 |
label:nm |
|
3896 |
pattern:nil |
|
3897 |
type:nil |
|
3898 |
lineNumber:lineNr. |
|
3899 |
]. |
|
3900 |
||
3901 |
isLocal ifTrue:[ |
|
3902 |
(words includes:'=') ifTrue:[ |
|
3903 |
words := words copyTo:(words indexOf:'=')-1 |
|
3904 |
]. |
|
3905 |
^ words |
|
3906 |
collect:[:eachVar | |
|
3907 |
Tag::TVariable |
|
3908 |
label:eachVar |
|
3909 |
pattern:nil |
|
3910 |
type:nil |
|
3911 |
lineNumber:lineNr. |
|
3912 |
] |
|
3913 |
as:Array. |
|
3914 |
]. |
|
3915 |
||
3916 |
^ nil |
|
3917 |
! |
|
3918 |
||
3919 |
luaTagsInFile:aFilePath |
|
3920 |
"lua tags: |
|
3921 |
naive, q&d scan for lines starting with (not syntax-aware): |
|
3922 |
local function ... |
|
3923 |
" |
|
3924 |
||
3925 |
^ self |
|
3926 |
linewiseNaiveTagsInFile:aFilePath |
|
3927 |
using:[:line :lineNr | |
|
3928 |
self luaTagFromLine:line lineNr:lineNr |
|
3929 |
] |
|
3930 |
! |
|
3931 |
||
16280 | 3932 |
objcTagFromLine:line lineNr:lineNr |
3933 |
"objc tags: |
|
3934 |
naive, q&d scan for lines starting with some common patterns" |
|
3935 |
||
3936 |
|l nm lineStream kwLen type hideHolder skipType| |
|
3937 |
||
3938 |
l := line withoutSeparators. |
|
3939 |
skipType := false. |
|
3940 |
||
3941 |
(l startsWith:'@interface') ifTrue:[ |
|
3942 |
kwLen := '@interface' size. |
|
3943 |
type := Tag::TInterface. |
|
17555 | 3944 |
hideHolder := self hideClasses. |
16280 | 3945 |
]. |
3946 |
(l startsWith:'@implementation') ifTrue:[ |
|
3947 |
kwLen := '@implementation' size. |
|
3948 |
type := Tag::TClass. |
|
17555 | 3949 |
hideHolder := self hideClasses. |
16280 | 3950 |
]. |
3951 |
(l startsWith:'@property') ifTrue:[ |
|
3952 |
kwLen := '@property' size. |
|
3953 |
type := Tag::TMacro. |
|
3954 |
]. |
|
3955 |
(l startsWithAnyOf:'+-') ifTrue:[ |
|
3956 |
kwLen := 1. |
|
3957 |
type := Tag::TMethod. |
|
17555 | 3958 |
hideHolder := self hideMethods. |
16280 | 3959 |
skipType := true. |
3960 |
]. |
|
3961 |
hideHolder value ~~ true ifTrue:[ |
|
3962 |
kwLen notNil ifTrue:[ |
|
3963 |
lineStream := l readStream. |
|
3964 |
lineStream skip:kwLen; skipSeparators. |
|
3965 |
skipType ifTrue:[ |
|
3966 |
lineStream peek == $( ifTrue:[ |
|
3967 |
lineStream next. lineStream skipThrough:$). |
|
3968 |
lineStream skipSeparators. |
|
3969 |
]. |
|
3970 |
]. |
|
3971 |
||
3972 |
nm := lineStream upToElementForWhich:[:ch | (ch isLetterOrDigit or:['_' includes:ch]) not]. |
|
3973 |
(nm notEmpty and:[nm first isLetterOrUnderline]) ifTrue:[ |
|
3974 |
^ type |
|
3975 |
label:nm |
|
3976 |
pattern:nil |
|
3977 |
type:nil |
|
3978 |
lineNumber:lineNr. |
|
3979 |
] |
|
3980 |
]. |
|
3981 |
]. |
|
3982 |
||
3983 |
^ nil |
|
17555 | 3984 |
|
3985 |
"Modified: / 22-06-2017 / 13:37:20 / cg" |
|
16280 | 3986 |
! |
3987 |
||
3988 |
objcTagsInFile:aFilePath |
|
3989 |
"objc tags: |
|
3990 |
naive, q&d scan for lines starting with some wellknown patterns" |
|
3991 |
||
3992 |
^ self |
|
3993 |
linewiseNaiveTagsInFile:aFilePath |
|
3994 |
using:[:line :lineNr | |
|
3995 |
self objcTagFromLine:line lineNr:lineNr |
|
3996 |
] |
|
3997 |
! |
|
3998 |
||
14345 | 3999 |
ozTagFromLine:line lineNr:lineNr |
4000 |
"oz tags: |
|
4001 |
naive, q&d scan for lines starting with: |
|
4002 |
fun { name ... |
|
4003 |
" |
|
4004 |
||
4005 |
|l nm lineStream kwLen skipBrace type hideHolder| |
|
4006 |
||
4007 |
l := line withoutSeparators. |
|
4008 |
||
4009 |
kwLen := nil. |
|
4010 |
skipBrace := false. |
|
4011 |
||
4012 |
(l startsWith:'class') ifTrue:[ |
|
4013 |
kwLen := 5. |
|
4014 |
type := Tag::TClass. |
|
17555 | 4015 |
hideHolder := self hideClasses. |
14345 | 4016 |
]. |
4017 |
(l startsWith:'meth') ifTrue:[ |
|
4018 |
kwLen := 4. |
|
4019 |
type := Tag::TMethod. |
|
17555 | 4020 |
hideHolder := self hideMethods. |
14345 | 4021 |
]. |
4022 |
(l startsWith:'fun') ifTrue:[ |
|
4023 |
kwLen := 3. |
|
4024 |
skipBrace := true. |
|
4025 |
type := Tag::TFunction. |
|
17555 | 4026 |
hideHolder := self hideFunctions. |
14345 | 4027 |
]. |
4028 |
(l startsWith:'proc') ifTrue:[ |
|
4029 |
kwLen := 4. |
|
4030 |
skipBrace := true. |
|
4031 |
type := Tag::TFunction. |
|
17555 | 4032 |
hideHolder := self hideFunctions. |
14345 | 4033 |
]. |
4034 |
hideHolder value ~~ true ifTrue:[ |
|
4035 |
kwLen notNil ifTrue:[ |
|
4036 |
lineStream := l readStream. |
|
4037 |
lineStream skip:kwLen; skipSeparators. |
|
4038 |
||
4039 |
(skipBrace not or:[lineStream peek = ${ ]) ifTrue:[ |
|
4040 |
skipBrace ifTrue:[lineStream skip:1; skipSeparators]. |
|
14538 | 4041 |
nm := lineStream upToElementForWhich:[:ch | (ch isLetterOrDigit or:['_' includes:ch]) not]. |
15220 | 4042 |
(nm notEmpty and:[nm first isLetterOrUnderline]) ifTrue:[ |
14345 | 4043 |
^ type |
4044 |
label:nm |
|
4045 |
pattern:nil |
|
4046 |
type:nil |
|
4047 |
lineNumber:lineNr. |
|
4048 |
] |
|
4049 |
] |
|
4050 |
]. |
|
4051 |
]. |
|
4052 |
^ nil |
|
17555 | 4053 |
|
4054 |
"Modified: / 22-06-2017 / 13:37:50 / cg" |
|
14345 | 4055 |
! |
4056 |
||
9891 | 4057 |
ozTagsInFile:aFilePath |
4058 |
"oz tags: |
|
4059 |
naive, q&d scan for lines starting with: |
|
4060 |
fun { name ... |
|
4061 |
" |
|
4062 |
||
14345 | 4063 |
^ self |
4064 |
linewiseNaiveTagsInFile:aFilePath |
|
4065 |
using:[:line :lineNr | |
|
4066 |
self ozTagFromLine:line lineNr:lineNr |
|
4067 |
] |
|
4068 |
! |
|
4069 |
||
4070 |
phpTagFromLine:line lineNr:lineNr |
|
4071 |
"php tags: |
|
4072 |
naive, q&d scan for lines starting with: |
|
4073 |
var ... |
|
4074 |
class ... |
|
4075 |
function ... |
|
4076 |
" |
|
4077 |
||
4078 |
|l nm lineStream| |
|
4079 |
||
4080 |
l := line withoutSeparators. |
|
14669 | 4081 |
(l startsWith:'public ') ifTrue:[ l := (l copyFrom:'public ' size + 1) withoutSeparators ]. |
14681 | 4082 |
(l startsWith:'private ') ifTrue:[ l := (l copyFrom:'private ' size + 1) withoutSeparators ]. |
14345 | 4083 |
|
4084 |
(l startsWith:'var ') ifTrue:[ |
|
14669 | 4085 |
lineStream := (l copyFrom:'var ' size) readStream. |
14345 | 4086 |
lineStream skipSeparators. |
4087 |
lineStream peek == $$ ifTrue:[ |
|
4088 |
lineStream next. |
|
4089 |
nm := lineStream |
|
4090 |
nextMatching:[:c | c isLetter] |
|
4091 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
|
4092 |
^ (Tag::TVariable |
|
4093 |
label:nm |
|
4094 |
pattern:nil |
|
4095 |
type:nil |
|
4096 |
lineNumber:lineNr). |
|
4097 |
] |
|
4098 |
] ifFalse:[ |
|
14681 | 4099 |
((l startsWith:'class ') or:[l startsWith:'Class '])ifTrue:[ |
14669 | 4100 |
lineStream := (l copyFrom:'class ' size) readStream. |
14345 | 4101 |
lineStream skipSeparators. |
4102 |
nm := lineStream |
|
4103 |
nextMatching:[:c | c isLetter] |
|
4104 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
|
4105 |
^ (Tag::TClass |
|
4106 |
label:nm |
|
4107 |
pattern:nil |
|
4108 |
type:nil |
|
4109 |
lineNumber:lineNr). |
|
4110 |
] ifFalse:[ |
|
14681 | 4111 |
((l startsWith:'function ') or:[l startsWith:'Function ']) ifTrue:[ |
14669 | 4112 |
lineStream := (l copyFrom:'function ' size) readStream. |
14345 | 4113 |
lineStream skipSeparators. |
4114 |
nm := lineStream |
|
14669 | 4115 |
nextMatching:[:c | c isLetter or:[c == $_]] |
14345 | 4116 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
4117 |
^ (Tag::TFunction |
|
4118 |
label:nm |
|
4119 |
pattern:nil |
|
4120 |
type:nil |
|
4121 |
lineNumber:lineNr). |
|
9891 | 4122 |
]. |
4123 |
]. |
|
4124 |
]. |
|
14345 | 4125 |
^ nil |
9891 | 4126 |
! |
4127 |
||
4128 |
phpTagsInFile:aFilePath |
|
4129 |
"php tags: |
|
4130 |
naive, q&d scan for lines starting with: |
|
4131 |
var ... |
|
4132 |
class ... |
|
4133 |
function ... |
|
4134 |
" |
|
4135 |
||
14345 | 4136 |
^ self |
4137 |
linewiseNaiveTagsInFile:aFilePath |
|
4138 |
using:[:line :lineNr | |
|
4139 |
self phpTagFromLine:line lineNr:lineNr |
|
4140 |
] |
|
4141 |
! |
|
4142 |
||
4143 |
prologTagFromLine:line lineNr:lineNr |
|
4144 |
"prolog tags: |
|
4145 |
naive, q&d scan for lines matching: |
|
4146 |
<anything> :- |
|
4147 |
" |
|
4148 |
||
4149 |
|l nm| |
|
4150 |
||
4151 |
l := line withoutSeparators. |
|
4152 |
||
4153 |
(l includesString:':-') ifTrue:[ |
|
4154 |
(l startsWith:':-') ifFalse:[ |
|
4155 |
nm := l copyTo:(l indexOfSubCollection:':-'). |
|
4156 |
^ (Tag::TPrologClause |
|
4157 |
label:nm |
|
4158 |
pattern:nil |
|
4159 |
type:nil |
|
4160 |
lineNumber:lineNr). |
|
4161 |
] |
|
9891 | 4162 |
]. |
14345 | 4163 |
^ nil |
9891 | 4164 |
! |
4165 |
||
4166 |
prologTagsInFile:aFilePath |
|
4167 |
"prolog tags: |
|
4168 |
naive, q&d scan for lines matching: |
|
4169 |
<anything> :- |
|
4170 |
" |
|
4171 |
||
14345 | 4172 |
^ self |
4173 |
linewiseNaiveTagsInFile:aFilePath |
|
4174 |
using:[:line :lineNr | |
|
4175 |
self prologTagFromLine:line lineNr:lineNr |
|
4176 |
] |
|
9891 | 4177 |
! |
4178 |
||
4179 |
pythonTagsInFile:aFilePath |
|
4180 |
"python tags: |
|
4181 |
naive, q&d scan for lines matching |
|
4182 |
class <anything> : |
|
4183 |
or |
|
4184 |
def <anything> : |
|
4185 |
" |
|
4186 |
||
4187 |
|targets line l lineNr nm s inClass indent classIndent| |
|
4188 |
||
4189 |
Tag autoload. |
|
4190 |
||
4191 |
inClass := nil. |
|
4192 |
targets := OrderedCollection new. |
|
4193 |
s := aFilePath asFilename readStream. |
|
4194 |
inClass := OrderedCollection new. |
|
4195 |
classIndent := 0. |
|
4196 |
||
4197 |
s notNil ifTrue:[ |
|
4198 |
s := LineNumberReadStream readingFrom:s. |
|
4199 |
[s atEnd] whileFalse:[ |
|
4200 |
lineNr := s lineNumber. |
|
4201 |
line := s nextLine. |
|
4202 |
l := line withoutSeparators. |
|
4203 |
l size > 0 ifTrue:[ |
|
4204 |
||
4205 |
line := line withTabsExpanded:8. |
|
4206 |
indent := line findFirst:[:c | c ~~ Character space]. |
|
4207 |
indent := indent // 8. |
|
4208 |
indent < classIndent ifTrue:[ |
|
4209 |
inClass removeFirstIfAbsent:nil. |
|
4210 |
classIndent := classIndent - 1. |
|
4211 |
]. |
|
4212 |
||
4213 |
(l startsWith:'class ') ifTrue:[ |
|
4214 |
(l endsWith:':') ifTrue:[ |
|
4215 |
nm := l copyFrom:7 to:(l size - 1). |
|
4216 |
nm := nm withoutSeparators. |
|
4217 |
(showOnly ~~ #pythonFunctions |
|
4218 |
and:[showOnly ~~ #pythonMethods]) ifTrue:[ |
|
17555 | 4219 |
self hideClasses ~~ true ifTrue:[ |
9891 | 4220 |
targets add:(Tag::TClass |
4221 |
label:nm |
|
4222 |
pattern:nil |
|
4223 |
type:nil |
|
4224 |
lineNumber:lineNr). |
|
4225 |
]. |
|
4226 |
]. |
|
4227 |
nm := nm upTo:$(. |
|
4228 |
inClass addFirst:nm. |
|
4229 |
classIndent := indent + 1. |
|
4230 |
] |
|
4231 |
] ifFalse:[ |
|
4232 |
(l startsWith:'def ') ifTrue:[ |
|
4233 |
(l endsWith:':') ifTrue:[ |
|
4234 |
nm := l copyFrom:5 to:(l size - 1). |
|
4235 |
nm := nm withoutSeparators. |
|
4236 |
||
4237 |
inClass size > 0 ifTrue:[ |
|
4238 |
(showOnly ~~ #pythonFunctions |
|
4239 |
and:[showOnly ~~ #pythonClasses]) ifTrue:[ |
|
17555 | 4240 |
self hideMethods ~~ true ifTrue:[ |
9891 | 4241 |
nm := inClass first , '.' , nm. |
4242 |
targets add:(Tag::TMethod |
|
4243 |
label:nm |
|
4244 |
pattern:nil |
|
4245 |
type:nil |
|
4246 |
lineNumber:lineNr). |
|
4247 |
] |
|
4248 |
] |
|
4249 |
] ifFalse:[ |
|
4250 |
(showOnly ~~ #pythonClasses |
|
4251 |
and:[showOnly ~~ #pythonMethods]) ifTrue:[ |
|
17555 | 4252 |
self hideFunctions ~~ true ifTrue:[ |
9891 | 4253 |
targets add:(Tag::TFunction |
4254 |
label:nm |
|
4255 |
pattern:nil |
|
4256 |
type:nil |
|
4257 |
lineNumber:lineNr). |
|
4258 |
] |
|
4259 |
] |
|
4260 |
] |
|
4261 |
] |
|
4262 |
] |
|
4263 |
] |
|
4264 |
] |
|
4265 |
]. |
|
4266 |
s close |
|
4267 |
]. |
|
4268 |
^ targets |
|
9921 | 4269 |
|
17555 | 4270 |
"Modified: / 22-06-2017 / 13:38:30 / cg" |
9891 | 4271 |
! |
4272 |
||
14345 | 4273 |
rubyTagFromLine:line lineNr:lineNr |
4274 |
"ruby tags: |
|
4275 |
naive, q&d scan for lines matching: |
|
4276 |
def any |
|
4277 |
" |
|
4278 |
||
4279 |
|l nm| |
|
4280 |
||
4281 |
l := line withoutSeparators. |
|
4282 |
||
4283 |
(l startsWith:'def ') ifTrue:[ |
|
4284 |
nm := l copyFrom:5. |
|
4285 |
^ (Tag::TFunction |
|
4286 |
label:nm |
|
4287 |
pattern:nil |
|
4288 |
type:nil |
|
4289 |
lineNumber:lineNr). |
|
4290 |
] ifFalse:[ |
|
4291 |
(l startsWith:'class ') ifTrue:[ |
|
14346 | 4292 |
self hideClasses == true ifFalse:[ |
14345 | 4293 |
nm := l copyFrom:6. |
4294 |
^ (Tag::TClass |
|
4295 |
label:nm |
|
4296 |
pattern:nil |
|
4297 |
type:nil |
|
4298 |
lineNumber:lineNr). |
|
4299 |
] |
|
4300 |
]. |
|
4301 |
]. |
|
4302 |
^ nil |
|
4303 |
||
4304 |
"Modified: / 08-05-2011 / 10:38:44 / cg" |
|
4305 |
! |
|
4306 |
||
9891 | 4307 |
rubyTagsInFile:aFilePath |
4308 |
"ruby tags: |
|
4309 |
naive, q&d scan for lines matching: |
|
4310 |
def any |
|
4311 |
" |
|
4312 |
||
14345 | 4313 |
^ self |
4314 |
linewiseNaiveTagsInFile:aFilePath |
|
4315 |
using:[:line :lineNr | |
|
4316 |
self rubyTagFromLine:line lineNr:lineNr |
|
4317 |
] |
|
9921 | 4318 |
|
4319 |
"Modified: / 08-05-2011 / 10:38:44 / cg" |
|
9891 | 4320 |
! |
4321 |
||
11050 | 4322 |
stTagsInFile:aFilePath in:aTempDirectory |
9891 | 4323 |
"smalltalk tags: |
11050 | 4324 |
not so naive: generate a changeList from the contents and convert it into a tag-list |
9891 | 4325 |
" |
4326 |
||
11050 | 4327 |
|targets s anyPrimitiveDefinitions shellCmd cTagsList| |
9891 | 4328 |
|
4329 |
Tag autoload. |
|
4330 |
||
11050 | 4331 |
anyPrimitiveDefinitions := false. |
9891 | 4332 |
targets := OrderedCollection new. |
4333 |
s := aFilePath asFilename readStream. |
|
4334 |
s notNil ifTrue:[ |
|
4335 |
s := LineNumberReadStream readingFrom:s. |
|
4336 |
s skipSeparators. |
|
4337 |
||
4338 |
"/ new interface: block-arg to #changesFromStream:do: gets 3 args |
|
4339 |
[ |
|
4340 |
ChangeSet::InvalidChangeChunkError handle:[:ex | |
|
18166 | 4341 |
Logger warning:('TagList [info]: Error while processing changes in "%1":\\%2' withCRs |
15168 | 4342 |
bindWith:aFilePath asFilename pathName |
4343 |
with: ex description). |
|
9891 | 4344 |
] do:[ |
4345 |
ChangeSet changesFromStream:s do:[:aChange :lNr :pos| |
|
4346 |
aChange isClassDefinitionChange ifTrue:[ |
|
14346 | 4347 |
self hideClasses == true ifFalse:[ |
9921 | 4348 |
targets add:(Tag::TClass |
9891 | 4349 |
label:(aChange className) |
4350 |
pattern:('/subclass:') |
|
4351 |
type:nil |
|
4352 |
lineNumber:lNr). |
|
9921 | 4353 |
] |
9891 | 4354 |
] ifFalse:[ |
4355 |
aChange isMethodChange ifTrue:[ |
|
14346 | 4356 |
self hideMethods == true ifFalse:[ |
13450 | 4357 |
targets add:((Tag::TMethod |
9891 | 4358 |
label:(aChange selector) |
4359 |
pattern:('/^' , aChange selector) |
|
4360 |
type:nil |
|
13450 | 4361 |
lineNumber:lNr) |
4362 |
isMeta:(aChange className endsWith:' class')). |
|
9921 | 4363 |
] |
11050 | 4364 |
] ifFalse:[ |
4365 |
aChange isPrimitiveChange ifTrue:[ |
|
4366 |
targets add:(Tag::TMacro |
|
4367 |
label:(aChange isPrimitiveDefinitionsChange |
|
11051 | 4368 |
ifTrue:['<< primitive definitions >>'] |
11050 | 4369 |
ifFalse:[ (aChange isPrimitiveFunctionsChange |
11051 | 4370 |
ifTrue:['<< primitive functions >>'] |
4371 |
ifFalse:['<< primitive variables >>'])]) |
|
11050 | 4372 |
pattern:('/^' , aChange source asStringCollection first) |
4373 |
type:nil |
|
4374 |
lineNumber:lNr). |
|
4375 |
anyPrimitiveDefinitions := true |
|
4376 |
] |
|
9891 | 4377 |
] |
4378 |
]. |
|
4379 |
] |
|
4380 |
] |
|
4381 |
] ensure:[ |
|
4382 |
s close. |
|
4383 |
]. |
|
4384 |
]. |
|
11050 | 4385 |
|
4386 |
anyPrimitiveDefinitions ifTrue:[ |
|
4387 |
"/ also invoke ctags on the file, merge those tags. |
|
4388 |
"/ sorry: not perfect, because ctags seems to get confused by the extra %{ %} nesting. |
|
4389 |
shellCmd := (self shellCommandTemplateFor:(aFilePath asFilename withSuffix:'c') pathName) |
|
4390 |
bindWith:aFilePath. |
|
4391 |
shellCmd notNil ifTrue:[ |
|
4392 |
cTagsList := self getTagListFromFile:aFilePath asFilename usingCommand:shellCmd mode:#c in:aTempDirectory. |
|
4393 |
cTagsList notEmptyOrNil ifTrue:[ |
|
4394 |
^ cTagsList , targets |
|
4395 |
]. |
|
4396 |
]. |
|
4397 |
]. |
|
4398 |
||
9891 | 4399 |
^ targets |
9921 | 4400 |
|
11050 | 4401 |
"Created: / 05-01-2012 / 10:56:26 / cg" |
18166 | 4402 |
"Modified: / 30-05-2018 / 11:29:36 / Claus Gittinger" |
9891 | 4403 |
! |
4404 |
||
15711 | 4405 |
stxResourceTagsInFile:aFilePath |
4406 |
"resource tags: |
|
4407 |
scan for translated entries to show them alphabetically" |
|
4408 |
||
4409 |
|rsrcPack| |
|
4410 |
||
4411 |
rsrcPack := ResourcePack fromFile:aFilePath. |
|
4412 |
^ self |
|
4413 |
linewiseNaiveTagsInFile:aFilePath |
|
4414 |
using:[:rawLine :lineNr | |
|
4415 |
|line key tag| |
|
4416 |
||
4417 |
line := rawLine withoutSeparators. |
|
4418 |
(line isEmpty or:[line startsWithAnyOf:'#;']) ifFalse:[ |
|
4419 |
(line startsWith:$') ifTrue:[ |
|
4420 |
"read as smalltalk string" |
|
4421 |
key := String readFrom:line. |
|
4422 |
] ifFalse:[ |
|
4423 |
key := line upToSeparator. |
|
4424 |
]. |
|
4425 |
(rsrcPack includesKey:key) ifTrue:[ |
|
4426 |
tag := Tag::TLabel |
|
4427 |
label:key |
|
4428 |
pattern:nil |
|
4429 |
type:nil |
|
4430 |
lineNumber:lineNr. |
|
4431 |
] |
|
4432 |
]. |
|
4433 |
tag |
|
4434 |
]. |
|
4435 |
! |
|
4436 |
||
14345 | 4437 |
tclTagFromLine:line lineNr:lineNr |
4438 |
"tcl tags: |
|
4439 |
naive, q&d scan for lines matching: |
|
4440 |
proc any |
|
4441 |
" |
|
4442 |
||
4443 |
|l nm words| |
|
4444 |
||
4445 |
l := line withoutSeparators. |
|
4446 |
||
4447 |
(l startsWith:'proc ') ifTrue:[ |
|
4448 |
nm := l withoutPrefix:'proc '. |
|
4449 |
^(Tag::TFunction |
|
4450 |
label:nm |
|
4451 |
pattern:nil |
|
4452 |
type:nil |
|
4453 |
lineNumber:lineNr). |
|
4454 |
] ifFalse:[ (l startsWith:'tixWidgetClass ') ifTrue:[ |
|
4455 |
nm := l copyFrom:'tixWidgetClass ' size + 1. |
|
4456 |
(nm endsWith:'{') ifTrue:[ |
|
14579 | 4457 |
nm := (nm copyButLast) withoutSeparators. |
14345 | 4458 |
]. |
4459 |
^(Tag::TClass |
|
4460 |
label:nm |
|
4461 |
pattern:nil |
|
4462 |
type:nil |
|
4463 |
lineNumber:lineNr). |
|
4464 |
] ifFalse:[ (l startsWith:'set ') ifTrue:[ |
|
14346 | 4465 |
self hideVariables ~~ true ifTrue:[ |
14345 | 4466 |
words := l asCollectionOfWords. |
4467 |
words size >= 2 ifTrue:[ |
|
4468 |
nm := words second. |
|
4469 |
^(Tag::TVariable |
|
4470 |
label:nm |
|
4471 |
pattern:nil |
|
4472 |
type:nil |
|
4473 |
lineNumber:lineNr). |
|
4474 |
] |
|
4475 |
]]]]. |
|
4476 |
^ nil |
|
4477 |
! |
|
4478 |
||
9891 | 4479 |
tclTagsInFile:aFilePath |
4480 |
"tcl tags: |
|
4481 |
naive, q&d scan for lines matching: |
|
4482 |
proc any |
|
4483 |
" |
|
4484 |
||
14345 | 4485 |
^ self |
4486 |
linewiseNaiveTagsInFile:aFilePath |
|
4487 |
using:[:line :lineNr | |
|
4488 |
self tclTagFromLine:line lineNr:lineNr |
|
4489 |
] |
|
9891 | 4490 |
! |
4491 |
||
15685 | 4492 |
xsdTagFromLine:line lineNr:lineNr |
15711 | 4493 |
"xsd schema tags: |
15685 | 4494 |
naive, q&d scan for lines matching: |
4495 |
<xsd:complexType... |
|
4496 |
<xsd:simpleType ... |
|
4497 |
Should be replaced by a more sophisticated reader, which parses the xml first. |
|
4498 |
" |
|
4499 |
||
4500 |
|l nm i1 i2| |
|
4501 |
||
4502 |
l := line withoutSeparators. |
|
4503 |
||
15706 | 4504 |
((l includesString:':complexType ') or:[l includesString:':simpleType ']) ifTrue:[ |
15685 | 4505 |
i1 := l findString:'name="'. |
4506 |
i1 ~~ 0 ifTrue:[ |
|
4507 |
nm := l copyFrom:(i1 + 'name="' size). |
|
4508 |
i2 := nm indexOf:$". |
|
4509 |
nm := nm copyTo:i2-1. |
|
4510 |
^(Tag::TTypedef |
|
4511 |
label:nm |
|
4512 |
pattern:nil |
|
4513 |
type:nil |
|
4514 |
lineNumber:lineNr). |
|
4515 |
]. |
|
4516 |
]. |
|
15706 | 4517 |
(l includesString:':element ') ifTrue:[ |
15689 | 4518 |
i1 := l findString:'name="'. |
4519 |
i1 ~~ 0 ifTrue:[ |
|
4520 |
nm := l copyFrom:(i1 + 'name="' size). |
|
4521 |
i2 := nm indexOf:$". |
|
4522 |
nm := nm copyTo:i2-1. |
|
4523 |
^(Tag::TElement |
|
4524 |
label:nm |
|
4525 |
pattern:nil |
|
4526 |
type:nil |
|
4527 |
lineNumber:lineNr). |
|
4528 |
]. |
|
4529 |
]. |
|
15685 | 4530 |
^ nil |
4531 |
! |
|
4532 |
||
4533 |
xsdTagsInFile:aFilePath |
|
4534 |
"xsd tags: |
|
4535 |
naive, q&d scan for lines matching: |
|
4536 |
<xsd:complexType... |
|
4537 |
<xsd:simpleType ... |
|
4538 |
Should be replaced by a more sophisticated reader, which parses the xml first. |
|
4539 |
" |
|
4540 |
||
4541 |
^ self |
|
4542 |
linewiseNaiveTagsInFile:aFilePath |
|
4543 |
using:[:line :lineNr | |
|
4544 |
self xsdTagFromLine:line lineNr:lineNr |
|
4545 |
] |
|
4546 |
! |
|
4547 |
||
9891 | 4548 |
yaccTagsInFile:aFilePath |
4549 |
"yacc tags: |
|
4550 |
naive, q&d scan for lines matching: |
|
4551 |
<anything>: |
|
4552 |
" |
|
4553 |
||
11825 | 4554 |
^ self tagsForLinesStartingWithIdentifierAndColon:aFilePath |
4555 |
||
4556 |
"Modified: / 28-09-2012 / 14:45:52 / cg" |
|
9891 | 4557 |
! ! |
4558 |
||
4559 |
!TagList methodsFor:'testing'! |
|
4560 |
||
4561 |
supportsFile:aFile |
|
4562 |
"return true, if we can generate tags for a file" |
|
4563 |
||
4564 |
aFile isReadable ifFalse:[^ false]. |
|
4565 |
||
4566 |
"/ cg: now always return true - let generateTag run against the wall... |
|
4567 |
^ true. |
|
4568 |
||
13335 | 4569 |
"/ lcSuffix := aFile suffix asLowercase. |
9891 | 4570 |
"/ selfClass := self class. |
4571 |
"/ |
|
13335 | 4572 |
"/ lcSuffix size ~~ 0 ifTrue:[ |
9891 | 4573 |
"/ ((selfClass isCSuffix:lcSuffix) |
4574 |
"/ or:[(selfClass isJavaSuffix:lcSuffix) |
|
4575 |
"/ or:[(selfClass isEiffelSuffix:lcSuffix) |
|
4576 |
"/ or:[(selfClass isFortranSuffix:lcSuffix) |
|
4577 |
"/ or:[(selfClass isPythonSuffix:lcSuffix) |
|
4578 |
"/ or:[(selfClass isLispSuffix:lcSuffix) |
|
4579 |
"/ or:[(selfClass isPrologSuffix:lcSuffix) |
|
4580 |
"/ or:[(selfClass isTCLSuffix:lcSuffix) |
|
4581 |
"/ or:[(selfClass isAssemblerSuffix:lcSuffix) |
|
4582 |
"/ or:[(selfClass isSmalltalkSuffix:lcSuffix) |
|
4583 |
"/ or:[(selfClass isRubySuffix:lcSuffix)]]]]]]]]]]) |
|
4584 |
"/ ifTrue:[ |
|
4585 |
"/ ^ true |
|
4586 |
"/ ]. |
|
4587 |
"/ ]. |
|
4588 |
"/ |
|
4589 |
"/ lcName := aFile baseName asLowercase. |
|
13335 | 4590 |
"/ ^ selfClass makeFilePatterns contains:[:pattern | pattern match:lcName] |
9891 | 4591 |
! ! |
4592 |
||
4593 |
!TagList class methodsFor:'documentation'! |
|
4594 |
||
11051 | 4595 |
version |
15685 | 4596 |
^ '$Header$' |
11051 | 4597 |
! |
4598 |
||
9891 | 4599 |
version_CVS |
15685 | 4600 |
^ '$Header$' |
10054 | 4601 |
! |
4602 |
||
4603 |
version_SVN |
|
15685 | 4604 |
^ '$Id$' |
9891 | 4605 |
! ! |
12332 | 4606 |