author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 13 Apr 2012 14:15:47 +0100 | |
branch | jv |
changeset 12229 | 5c129972b1fd |
parent 12128 | a7ff7d66ee85 |
child 12254 | b1237f76f501 |
permissions | -rw-r--r-- |
9891 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
List subclass:#TagList |
|
17 |
instanceVariableNames:'rawList filteredList filter sortCriteria groupBy showOnly |
|
18 |
hideStatic hideStructMembers hideClasses hideMethods hideDefines |
|
19 |
hideTypedefs hideVariables hideStructures hideFunctions |
|
20 |
hideFunctionProtoTypes hideJavaClasses hideJavaMethods |
|
21 |
hideJavaInterfaces hideJavaFields hideJavaPackages hideLispMacros |
|
22 |
hideLispEvaluations hideLispMethods hideLispConstants |
|
12229 | 23 |
hideLocalLabels hideLocalLabels2 hideDataLabels hideTextLabels |
24 |
tagTypesPresent hidePythonClasses hidePythonMethods |
|
25 |
hidePythonFunctions hideOzClasses hideOzMethods hideOzFunctions |
|
26 |
hideHTMLTextArea hideHTMLInput hideHTMLTable hideHTMLScript |
|
27 |
hideHTMLForm usingDefaultCTags ctagsCommand ctagsIsExCtags |
|
28 |
ctagsIsExCtags5x hideDocumentation remoteTarget' |
|
9891 | 29 |
classVariableNames:'Sorted CachedTagListsPerFile DefaultSortCriteria DefaultShowOnly |
30 |
TagsSuffixes DefaultGroupBy' |
|
31 |
poolDictionaries:'' |
|
32 |
category:'Interface-Tools-File-Tags' |
|
33 |
! |
|
34 |
||
35 |
!TagList class methodsFor:'documentation'! |
|
36 |
||
37 |
copyright |
|
38 |
" |
|
39 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
40 |
All Rights Reserved |
|
41 |
||
42 |
This software is furnished under a license and may be used |
|
43 |
only in accordance with the terms of that license and with the |
|
44 |
inclusion of the above copyright notice. This software may not |
|
45 |
be provided or otherwise made available to, or used by, any |
|
46 |
other person. No title to or ownership of the software is |
|
47 |
hereby transferred. |
|
48 |
||
49 |
||
50 |
" |
|
10054 | 51 |
! |
52 |
||
53 |
documentation |
|
54 |
" |
|
55 |
a list of tags as read & generated from parsing a source file. |
|
56 |
For some languages, naive parsing is supported right here; |
|
57 |
for other languages, external tools (ctags) are used. |
|
58 |
The tags are used bz the tagList or to navigate quickly to some |
|
59 |
function in the C-browser. |
|
60 |
" |
|
9891 | 61 |
! ! |
62 |
||
63 |
!TagList class methodsFor:'accessing'! |
|
64 |
||
65 |
tagsSuffixes |
|
66 |
"flush with: |
|
67 |
TagsSuffixes := nil |
|
68 |
" |
|
69 |
TagsSuffixes notNil ifTrue:[ |
|
70 |
^ TagsSuffixes |
|
71 |
]. |
|
72 |
TagsSuffixes := IdentityDictionary new. |
|
73 |
||
74 |
TagsSuffixes at:#'text/asm' put:#( 's' 'asm' ). |
|
75 |
TagsSuffixes at:#'text/c' put:#( 'c' 'h' 'ci' 'hi' 'sc'). |
|
76 |
TagsSuffixes at:#'text/cpp' put:#( 'cc' 'cpp' 'cxx' 'c++' 'hxx' 'hpp' 'h++'). |
|
77 |
TagsSuffixes at:#'text/eiffel' put:#( 'e' 'eif' ). |
|
78 |
TagsSuffixes at:#'text/fortran' put:#( 'f' 'for' 'ftn' 'f77' 'f90' ). |
|
79 |
TagsSuffixes at:#'text/html' put:#( 'htm' 'html'). |
|
80 |
TagsSuffixes at:#'text/java' put:#( 'java' 'jav'). |
|
81 |
TagsSuffixes at:#'text/javaScript' put:#( 'js' ). |
|
82 |
TagsSuffixes at:#'text/javascript' put:#( 'js' ). |
|
83 |
TagsSuffixes at:#'application/x-javascript' put:#( 'js' ). |
|
84 |
TagsSuffixes at:#'text/make' put:#( 'makefile' 'make.proto' 'makefile.*' '*.mak' '*.bpr'). |
|
85 |
TagsSuffixes at:#'text/prolog' put:#( 'pl' ). |
|
86 |
TagsSuffixes at:#'text/python' put:#( 'py' ). |
|
87 |
TagsSuffixes at:#'text/php' put:#( 'php' ). |
|
88 |
TagsSuffixes at:#'text/lisp' put:#( 'lisp' 'el' 'lsp' 'cl'). |
|
89 |
TagsSuffixes at:#'text/lisp-arc' put:#( 'arc' ). |
|
90 |
TagsSuffixes at:#'text/scheme' put:#( 'scm' 'ss' 'brg'). |
|
91 |
TagsSuffixes at:#'text/oz' put:#( 'oz'). |
|
92 |
TagsSuffixes at:#'text/smalltalk' put:#( 'st' ). |
|
93 |
TagsSuffixes at:#'text/tcl' put:#( 'tcl' ). |
|
94 |
TagsSuffixes at:#'text/ruby' put:#( 'rb' ). |
|
95 |
TagsSuffixes at:#'text/yacc' put:#( 'y' ). |
|
96 |
^ TagsSuffixes |
|
97 |
||
98 |
"Modified: / 20-04-2011 / 19:27:53 / cg" |
|
99 |
! ! |
|
100 |
||
101 |
!TagList class methodsFor:'defaults'! |
|
102 |
||
103 |
arcLispSuffixes |
|
104 |
"returns a list of supported arc-lisp-suffixes" |
|
105 |
||
106 |
^ self tagsSuffixes at:#'text/lisp-arc' |
|
107 |
! |
|
108 |
||
109 |
assemblerSuffixes |
|
110 |
"returns a list of supported assembler-suffixes" |
|
111 |
||
112 |
^ self tagsSuffixes at:#'text/asm' |
|
113 |
! |
|
114 |
||
115 |
cPlusPlusSuffixes |
|
116 |
"returns a list of supported c-suffixes" |
|
117 |
||
118 |
^ self tagsSuffixes at:#'text/cpp' |
|
119 |
! |
|
120 |
||
121 |
cSuffixes |
|
122 |
"returns a list of supported c-suffixes" |
|
123 |
||
124 |
^ self tagsSuffixes at:#'text/c' |
|
125 |
! |
|
126 |
||
127 |
commonLispSuffixes |
|
128 |
"returns a list of supported common-lisp-suffixes" |
|
129 |
||
130 |
^ self tagsSuffixes at:#'text/lisp' |
|
131 |
! |
|
132 |
||
133 |
eiffelSuffixes |
|
134 |
"returns a list of supported eiffel-suffixes |
|
135 |
" |
|
136 |
^ self tagsSuffixes at:#'text/eiffel' |
|
137 |
! |
|
138 |
||
139 |
fortranSuffixes |
|
140 |
"returns a list of supported fortran-suffixes |
|
141 |
" |
|
142 |
^ self tagsSuffixes at:#'text/fortran' |
|
143 |
! |
|
144 |
||
145 |
htmlSuffixes |
|
146 |
"returns a list of supported html-suffixes |
|
147 |
" |
|
148 |
^ self tagsSuffixes at:#'text/html' |
|
149 |
||
150 |
"Created: / 20-04-2011 / 19:03:39 / cg" |
|
151 |
! |
|
152 |
||
153 |
isTagSearchableSuffix:aSuffix |
|
154 |
"returns true, if aSuffix looks ok for ctags |
|
155 |
" |
|
156 |
self tagsSuffixes keysAndValuesDo:[:tag :suffixes | |
|
157 |
(suffixes includes:aSuffix) ifTrue:[^ true]. |
|
158 |
]. |
|
159 |
"/ (self cSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
160 |
"/ (self javaSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
161 |
"/ (self fortranSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
162 |
"/ (self eiffelSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
163 |
"/ (self commonLispSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
164 |
"/ (self schemeSuffixes includes:aSuffix) ifTrue:[^ true]. |
|
165 |
^ false |
|
166 |
! |
|
167 |
||
168 |
javaScriptSuffixes |
|
169 |
"returns a list of supported javaScript-suffixes" |
|
170 |
||
171 |
^ self tagsSuffixes at:#'text/javaScript' |
|
172 |
||
173 |
"Created: / 28-06-2010 / 12:44:58 / cg" |
|
174 |
! |
|
175 |
||
176 |
javaSuffixes |
|
177 |
"returns a list of supported java-suffixes |
|
178 |
" |
|
179 |
^ self tagsSuffixes at:#'text/java' |
|
180 |
! |
|
181 |
||
182 |
makeFilePatterns |
|
183 |
"returns a list of makefile match patterns |
|
184 |
" |
|
185 |
^ self tagsSuffixes at:#'text/make' |
|
186 |
! |
|
187 |
||
188 |
ozSuffixes |
|
189 |
"returns a list of supported oz-suffixes |
|
190 |
" |
|
191 |
^ self tagsSuffixes at:#'text/oz' |
|
192 |
! |
|
193 |
||
194 |
phpSuffixes |
|
195 |
"returns a list of supported php-suffixes" |
|
196 |
||
197 |
^ self tagsSuffixes at:#'text/php' |
|
198 |
! |
|
199 |
||
12125 | 200 |
pltSchemeLispSuffixes |
201 |
^ #('plt') |
|
202 |
||
203 |
"Created: / 21-10-2011 / 09:32:20 / cg" |
|
204 |
! |
|
205 |
||
9891 | 206 |
prologSuffixes |
207 |
"returns a list of supported prolog-suffixes |
|
208 |
" |
|
209 |
^ self tagsSuffixes at:#'text/prolog' |
|
210 |
! |
|
211 |
||
212 |
pythonSuffixes |
|
213 |
"returns a list of supported python-suffixes |
|
214 |
" |
|
215 |
^ self tagsSuffixes at:#'text/python' |
|
216 |
! |
|
217 |
||
12125 | 218 |
racketSchemeLispSuffixes |
219 |
^ #('rkt') |
|
220 |
||
221 |
"Created: / 21-10-2011 / 09:32:27 / cg" |
|
222 |
! |
|
223 |
||
9891 | 224 |
rubySuffixes |
225 |
"returns a list of supported ruby-suffixes |
|
226 |
" |
|
227 |
^ self tagsSuffixes at:#'text/ruby' |
|
228 |
! |
|
229 |
||
230 |
schemeSuffixes |
|
231 |
"returns a list of supported scheme-lisp-suffixes |
|
232 |
" |
|
233 |
^ self tagsSuffixes at:#'text/scheme' |
|
234 |
! |
|
235 |
||
236 |
smalltalkSuffixes |
|
237 |
"returns a list of supported smalltalk-suffixes |
|
238 |
" |
|
239 |
^ self tagsSuffixes at:#'text/smalltalk' |
|
240 |
! |
|
241 |
||
242 |
tclSuffixes |
|
243 |
"returns a list of supported tcl-suffixes |
|
244 |
" |
|
245 |
^ self tagsSuffixes at:#'text/tcl' |
|
246 |
! |
|
247 |
||
248 |
yaccSuffixes |
|
249 |
"returns a list of supported yacc-suffixes |
|
250 |
" |
|
251 |
^ self tagsSuffixes at:#'text/yacc' |
|
252 |
! ! |
|
253 |
||
254 |
!TagList class methodsFor:'queries'! |
|
255 |
||
256 |
isArcLispSuffix:suffix |
|
257 |
^ self isSuffix:suffix in:self arcLispSuffixes |
|
258 |
! |
|
259 |
||
260 |
isAssemblerSuffix:suffix |
|
261 |
^ self isSuffix:suffix in:self assemblerSuffixes |
|
262 |
! |
|
263 |
||
264 |
isCPlusPlusSuffix:suffix |
|
265 |
^ self isSuffix:suffix in:self cPlusPlusSuffixes |
|
266 |
! |
|
267 |
||
268 |
isCSuffix:suffix |
|
269 |
^ self isSuffix:suffix in:self cSuffixes |
|
270 |
! |
|
271 |
||
272 |
isCommonLispSuffix:suffix |
|
273 |
^ self isSuffix:suffix in:self commonLispSuffixes |
|
274 |
! |
|
275 |
||
276 |
isEiffelSuffix:suffix |
|
277 |
^ self isSuffix:suffix in:self eiffelSuffixes |
|
278 |
! |
|
279 |
||
280 |
isFortranSuffix:suffix |
|
281 |
^ self isSuffix:suffix in:self fortranSuffixes |
|
282 |
! |
|
283 |
||
284 |
isHTMLSuffix:suffix |
|
285 |
^ self isSuffix:suffix in:self htmlSuffixes |
|
286 |
||
287 |
"Created: / 20-04-2011 / 19:03:26 / cg" |
|
288 |
! |
|
289 |
||
290 |
isJavaScriptSuffix:suffix |
|
291 |
^ self isSuffix:suffix in:self javaScriptSuffixes |
|
292 |
||
293 |
"Created: / 28-06-2010 / 12:44:47 / cg" |
|
294 |
! |
|
295 |
||
296 |
isJavaSuffix:suffix |
|
297 |
^ self isSuffix:suffix in:self javaSuffixes |
|
298 |
! |
|
299 |
||
300 |
isLispSuffix:suffix |
|
301 |
^ (self isCommonLispSuffix:suffix) |
|
302 |
or:[(self isSchemeSuffix:suffix) |
|
12125 | 303 |
or:[(self isArcLispSuffix:suffix) |
304 |
or:[(self isPltSchemeLispSuffix:suffix) |
|
305 |
or:[(self isRacketSchemeLispSuffix:suffix)]]]] |
|
306 |
||
307 |
"Modified: / 21-10-2011 / 09:31:30 / cg" |
|
9891 | 308 |
! |
309 |
||
310 |
isMakefileName:fileName |
|
311 |
|lcName| |
|
312 |
||
313 |
lcName := fileName asFilename baseName asLowercase. |
|
314 |
self makeFilePatterns do:[:aPattern | |
|
315 |
(aPattern match:lcName) ifTrue:[ ^ true ]. |
|
316 |
]. |
|
317 |
^ false |
|
318 |
! |
|
319 |
||
320 |
isOzSuffix:suffix |
|
321 |
^ self isSuffix:suffix in:self ozSuffixes |
|
322 |
! |
|
323 |
||
324 |
isPhpSuffix:suffix |
|
325 |
^ self isSuffix:suffix in:self phpSuffixes |
|
326 |
! |
|
327 |
||
12125 | 328 |
isPltSchemeLispSuffix:suffix |
329 |
^ self isSuffix:suffix in:self pltSchemeLispSuffixes |
|
330 |
||
331 |
"Created: / 21-10-2011 / 09:30:56 / cg" |
|
332 |
! |
|
333 |
||
9891 | 334 |
isPrologSuffix:suffix |
335 |
^ self isSuffix:suffix in:self prologSuffixes |
|
336 |
! |
|
337 |
||
338 |
isPythonSuffix:suffix |
|
339 |
^ self isSuffix:suffix in:self pythonSuffixes |
|
340 |
! |
|
341 |
||
12125 | 342 |
isRacketSchemeLispSuffix:suffix |
343 |
^ self isSuffix:suffix in:self racketSchemeLispSuffixes |
|
344 |
||
345 |
"Created: / 21-10-2011 / 09:31:04 / cg" |
|
346 |
! |
|
347 |
||
9891 | 348 |
isRubySuffix:suffix |
349 |
^ self isSuffix:suffix in:self rubySuffixes |
|
350 |
! |
|
351 |
||
352 |
isSchemeSuffix:suffix |
|
353 |
^ self isSuffix:suffix in:self schemeSuffixes |
|
354 |
! |
|
355 |
||
356 |
isSmalltalkSuffix:suffix |
|
357 |
^ self isSuffix:suffix in:self smalltalkSuffixes |
|
358 |
! |
|
359 |
||
360 |
isTCLSuffix:suffix |
|
361 |
^ self isSuffix:suffix in:self tclSuffixes |
|
362 |
! |
|
363 |
||
364 |
isYaccSuffix:suffix |
|
365 |
^ self isSuffix:suffix in:self yaccSuffixes |
|
366 |
! ! |
|
367 |
||
368 |
!TagList class methodsFor:'queries basic'! |
|
369 |
||
370 |
isSuffix:suffix in:patterns |
|
371 |
|lcSuffix| |
|
372 |
||
373 |
lcSuffix := suffix asLowercase. |
|
374 |
^ patterns contains:[:pattern | pattern match:lcSuffix]. |
|
375 |
! |
|
376 |
||
377 |
tagMimeTypeForFile:aFile |
|
378 |
"returns the tag-mimetype for a file or nil |
|
379 |
" |
|
380 |
|suff file list name mimeMake| |
|
381 |
||
382 |
aFile isNil ifTrue:[^ nil]. |
|
383 |
||
384 |
file := aFile asFilename. |
|
385 |
suff := aFile asFilename suffix. |
|
386 |
||
387 |
suff size ~~ 0 ifTrue:[ |
|
388 |
suff := suff asLowercase. |
|
389 |
||
390 |
(suff = 'bak' or:[suff = 'sav']) ifTrue:[ |
|
391 |
file := file asFilename withoutSuffix. |
|
392 |
suff := file suffix. |
|
393 |
suff size ~~ 0 ifTrue:[ |
|
394 |
suff := suff asLowercase |
|
395 |
] |
|
396 |
] |
|
397 |
]. |
|
398 |
list := self tagsSuffixes. |
|
399 |
||
400 |
" hack to test for make-file patterns " |
|
401 |
name := file baseName asLowercase. |
|
402 |
mimeMake := #'text/make'. |
|
403 |
||
404 |
((list at:mimeMake) contains:[:pattern | pattern match:name]) ifTrue:[ |
|
405 |
^ mimeMake |
|
406 |
]. |
|
407 |
||
408 |
self tagsSuffixes keysAndValuesDo:[:mimeType :suffixes| |
|
409 |
(suffixes includes:suff) ifTrue:[ ^ mimeType ] |
|
410 |
]. |
|
411 |
^ nil |
|
412 |
! ! |
|
413 |
||
414 |
!TagList class methodsFor:'tag generation'! |
|
415 |
||
416 |
cachedTagsFromFile:aFilename in:aTempDirectory |
|
417 |
"retrieve a cached tagList for a file" |
|
418 |
||
419 |
|tagList cached fileTime suffix| |
|
420 |
||
421 |
fileTime := aFilename modificationTime. |
|
422 |
||
423 |
CachedTagListsPerFile isNil ifTrue:[ |
|
424 |
CachedTagListsPerFile := Dictionary new. |
|
425 |
]. |
|
426 |
cached := CachedTagListsPerFile at:aFilename ifAbsent:nil. |
|
427 |
cached notNil ifTrue:[ |
|
428 |
fileTime > cached tagTimestamp ifFalse:[ |
|
429 |
^ cached tagList |
|
430 |
] |
|
431 |
]. |
|
432 |
suffix := aFilename suffix. |
|
433 |
||
434 |
"/ ((self isCSuffix:suffix) |
|
435 |
"/ or:[(self isJavaSuffix:suffix) |
|
436 |
"/ or:[(self isFortranSuffix:suffix) |
|
437 |
"/ or:[(self isEiffelSuffix:suffix)]]]) |
|
438 |
"/ ifFalse:[ |
|
439 |
"/ ^ #() |
|
440 |
"/ ]. |
|
441 |
tagList := self new. |
|
442 |
tagList showOnly:nil. |
|
443 |
tagList fromFile:aFilename in:aTempDirectory. |
|
444 |
||
445 |
CachedTagListsPerFile at:aFilename put:(CachedTags new tagList:tagList; tagTimestamp:fileTime; yourself). |
|
446 |
^ tagList |
|
447 |
||
448 |
"Modified: / 07-06-2010 / 12:13:25 / cg" |
|
449 |
! |
|
450 |
||
451 |
cachedTagsFromFile:aFilename in:aTempDirectory buildTargetHandler:aTargetHandler remote:aBoolean |
|
452 |
"retrieve a cached tagList for a file" |
|
453 |
||
454 |
^ self cachedTagsFromFile:aFilename in:aTempDirectory. |
|
455 |
! |
|
456 |
||
457 |
flushCachedTags |
|
458 |
CachedTagListsPerFile := nil |
|
459 |
||
460 |
" |
|
461 |
self flushCachedTags |
|
462 |
" |
|
463 |
! |
|
464 |
||
465 |
makeTargetTagsInFile:aMakefilePath |
|
466 |
"makefile tags: |
|
467 |
naive, q&d scan for lines ending with a colon |
|
468 |
" |
|
469 |
^ self makeTargetTagsInFile:aMakefilePath filter:nil |
|
470 |
! |
|
471 |
||
472 |
makeTargetTagsInFile:aMakefilePath filter:showOnly |
|
473 |
"makefile tags: |
|
474 |
naive, q&d scan for lines ending with a colon |
|
475 |
" |
|
476 |
|targets| |
|
477 |
||
478 |
Tag autoload. |
|
479 |
||
480 |
targets := OrderedCollection new. |
|
481 |
aMakefilePath asFilename contents keysAndValuesDo:[:lnr :line | |
|
482 |
|idxColon idxAssign varName target| |
|
483 |
||
484 |
line size > 0 ifTrue:[ |
|
485 |
line first isSeparator ifFalse:[ |
|
486 |
(line startsWith:$#) ifFalse:[ |
|
487 |
idxAssign := line indexOf:$=. |
|
488 |
idxAssign ~~ 0 ifTrue:[ |
|
489 |
showOnly ~~ #targets ifTrue:[ |
|
490 |
varName := line copyFrom:1 to:idxAssign - 1. |
|
491 |
targets add:(Tag::TVariable |
|
492 |
label:varName |
|
493 |
pattern:('/^',varName,'=') |
|
494 |
type:nil |
|
495 |
lineNumber:lnr) |
|
496 |
] |
|
497 |
] ifFalse:[ |
|
498 |
idxColon := line indexOf:$:. |
|
499 |
idxColon ~~ 0 ifTrue:[ |
|
500 |
target := line copyFrom:1 to:idxColon - 1. |
|
501 |
"/ ignore macro-targets |
|
502 |
||
503 |
(target includes:$$) ifFalse:[ |
|
504 |
(target startsWith:$.) ifFalse:[ |
|
505 |
"/ normal targets |
|
506 |
targets add:(Tag::TMakeTarget |
|
507 |
label:target |
|
508 |
pattern:('/^',target,':') |
|
509 |
type:nil |
|
510 |
lineNumber:lnr) |
|
511 |
] ifTrue:[ |
|
512 |
"/ rule-targets |
|
513 |
targets add:(Tag::TMakeRule |
|
514 |
label:target |
|
515 |
pattern:('/^',target,':') |
|
516 |
type:nil |
|
517 |
lineNumber:lnr) |
|
518 |
] |
|
519 |
] ifTrue:[ |
|
520 |
"/ rule-targets |
|
521 |
targets add:(Tag::TMakeTarget |
|
522 |
label:target |
|
523 |
pattern:('/^',target,':') |
|
524 |
type:nil |
|
525 |
lineNumber:lnr) |
|
526 |
]. |
|
527 |
] |
|
528 |
] |
|
529 |
] |
|
530 |
] |
|
531 |
] |
|
532 |
]. |
|
533 |
^ targets |
|
534 |
! ! |
|
535 |
||
536 |
!TagList methodsFor:'accessing-filters'! |
|
537 |
||
538 |
classesFunctionsAndVariablesOnly |
|
539 |
^ showOnly == #classesFunctionsAndVariables |
|
540 |
||
541 |
"Modified: / 07-06-2010 / 14:18:09 / cg" |
|
542 |
! |
|
543 |
||
544 |
classesFunctionsAndVariablesOnly:aBoolean |
|
545 |
showOnly := nil. |
|
546 |
aBoolean ifTrue:[ |
|
547 |
showOnly := DefaultShowOnly := #classesFunctionsAndVariables |
|
548 |
]. |
|
549 |
||
550 |
"Modified: / 05-05-2011 / 15:21:53 / cg" |
|
551 |
! |
|
552 |
||
553 |
classesOnly |
|
554 |
^ showOnly == #classes |
|
555 |
||
556 |
"Modified: / 07-06-2010 / 14:18:12 / cg" |
|
557 |
! |
|
558 |
||
559 |
classesOnly:aBoolean |
|
560 |
showOnly := nil. |
|
561 |
aBoolean ifTrue:[ |
|
562 |
showOnly := DefaultShowOnly := #classes |
|
563 |
]. |
|
564 |
||
565 |
"Modified: / 05-05-2011 / 15:21:56 / cg" |
|
566 |
! |
|
567 |
||
568 |
definesOnly |
|
569 |
^ showOnly == #defines |
|
570 |
||
571 |
"Modified: / 07-06-2010 / 14:18:15 / cg" |
|
572 |
! |
|
573 |
||
574 |
definesOnly:aBoolean |
|
575 |
showOnly := nil. |
|
576 |
aBoolean ifTrue:[ |
|
577 |
showOnly := DefaultShowOnly := #defines |
|
578 |
]. |
|
579 |
||
580 |
"Modified: / 05-05-2011 / 15:21:58 / cg" |
|
581 |
! |
|
582 |
||
9921 | 583 |
documentationOnly |
584 |
^ showOnly == #documentation |
|
585 |
||
586 |
"Created: / 08-05-2011 / 10:11:47 / cg" |
|
587 |
! |
|
588 |
||
589 |
documentationOnly:aBoolean |
|
590 |
showOnly := DefaultShowOnly := nil. |
|
591 |
aBoolean ifTrue:[ |
|
592 |
showOnly := "DefaultShowOnly :=" #documentation |
|
593 |
]. |
|
594 |
||
595 |
"Created: / 08-05-2011 / 10:11:39 / cg" |
|
596 |
! |
|
597 |
||
9891 | 598 |
filter:something |
599 |
(filter ? '') ~= (something ? '') ifTrue:[ |
|
600 |
filter := something. |
|
601 |
rawList notNil ifTrue:[ |
|
602 |
self updateContentsFromRawList |
|
603 |
]. |
|
604 |
]. |
|
605 |
||
606 |
"Modified: / 05-05-2011 / 14:43:04 / cg" |
|
607 |
! |
|
608 |
||
609 |
functionsAndVariablesOnly |
|
610 |
^ showOnly == #functionsAndVariables |
|
611 |
||
612 |
"Modified: / 07-06-2010 / 14:18:05 / cg" |
|
613 |
! |
|
614 |
||
615 |
functionsAndVariablesOnly:aBoolean |
|
616 |
showOnly := nil. |
|
617 |
aBoolean ifTrue:[ |
|
618 |
showOnly := DefaultShowOnly := #functionsAndVariables |
|
619 |
]. |
|
620 |
||
621 |
"Modified: / 05-05-2011 / 15:22:01 / cg" |
|
622 |
! |
|
623 |
||
624 |
functionsOnly |
|
625 |
^ showOnly == #functions |
|
626 |
||
627 |
"Modified: / 07-06-2010 / 14:17:54 / cg" |
|
628 |
! |
|
629 |
||
630 |
functionsOnly:aBoolean |
|
631 |
showOnly := nil. |
|
632 |
aBoolean ifTrue:[ |
|
633 |
showOnly := DefaultShowOnly := #functions |
|
634 |
]. |
|
635 |
||
636 |
"Modified: / 05-05-2011 / 15:22:03 / cg" |
|
637 |
! |
|
638 |
||
639 |
hideClasses |
|
640 |
^ hideClasses ? false |
|
641 |
! |
|
642 |
||
643 |
hideClasses:aBoolean |
|
644 |
hideClasses := aBoolean. |
|
645 |
||
646 |
"Modified: / 05-05-2011 / 15:22:08 / cg" |
|
647 |
! |
|
648 |
||
649 |
hideDataLabels |
|
650 |
^ hideDataLabels ? false |
|
651 |
! |
|
652 |
||
653 |
hideDataLabels:aBoolean |
|
654 |
hideDataLabels := aBoolean. |
|
655 |
||
656 |
"Modified: / 05-05-2011 / 15:22:10 / cg" |
|
657 |
! |
|
658 |
||
659 |
hideDefines |
|
660 |
^ hideDefines ? false |
|
661 |
! |
|
662 |
||
663 |
hideDefines:aBoolean |
|
664 |
hideDefines := aBoolean. |
|
665 |
||
666 |
"Modified: / 05-05-2011 / 15:22:12 / cg" |
|
667 |
! |
|
668 |
||
9921 | 669 |
hideDocumentation |
670 |
^ hideDocumentation ? false |
|
671 |
||
672 |
"Created: / 08-05-2011 / 10:11:02 / cg" |
|
673 |
! |
|
674 |
||
675 |
hideDocumentation:aBoolean |
|
676 |
hideDocumentation := aBoolean. |
|
677 |
||
678 |
"Created: / 08-05-2011 / 10:11:06 / cg" |
|
679 |
! |
|
680 |
||
9891 | 681 |
hideFunctionProtoTypes |
682 |
^ hideFunctionProtoTypes ? false |
|
683 |
! |
|
684 |
||
685 |
hideFunctionProtoTypes:aBoolean |
|
686 |
hideFunctionProtoTypes := aBoolean. |
|
687 |
||
688 |
"Modified: / 05-05-2011 / 15:22:14 / cg" |
|
689 |
! |
|
690 |
||
691 |
hideFunctions |
|
692 |
^ hideFunctions ? false |
|
693 |
! |
|
694 |
||
695 |
hideFunctions:aBoolean |
|
696 |
hideFunctions := aBoolean. |
|
697 |
||
698 |
"Modified: / 05-05-2011 / 15:22:18 / cg" |
|
699 |
! |
|
700 |
||
701 |
hideHTMLInput |
|
702 |
^ hideHTMLInput ? false |
|
703 |
||
704 |
"Created: / 20-04-2011 / 19:01:04 / cg" |
|
705 |
! |
|
706 |
||
707 |
hideHTMLInput:aBoolean |
|
708 |
hideHTMLInput := aBoolean. |
|
709 |
||
710 |
"Created: / 20-04-2011 / 19:01:32 / cg" |
|
711 |
"Modified: / 05-05-2011 / 15:22:21 / cg" |
|
712 |
! |
|
713 |
||
714 |
hideHTMLScript |
|
715 |
^ hideHTMLScript ? false |
|
716 |
||
717 |
"Created: / 20-04-2011 / 19:00:32 / cg" |
|
718 |
! |
|
719 |
||
720 |
hideHTMLScript:aBoolean |
|
721 |
hideHTMLScript := aBoolean. |
|
722 |
||
723 |
"Created: / 20-04-2011 / 19:01:32 / cg" |
|
724 |
"Modified: / 05-05-2011 / 15:22:23 / cg" |
|
725 |
! |
|
726 |
||
727 |
hideHTMLTable |
|
728 |
^ hideHTMLTable ? false |
|
729 |
||
730 |
"Created: / 20-04-2011 / 19:01:23 / cg" |
|
731 |
! |
|
732 |
||
733 |
hideHTMLTable:aBoolean |
|
734 |
hideHTMLTable := aBoolean. |
|
735 |
||
736 |
"Created: / 20-04-2011 / 19:01:48 / cg" |
|
737 |
"Modified: / 05-05-2011 / 15:22:26 / cg" |
|
738 |
! |
|
739 |
||
740 |
hideHTMLTextArea |
|
741 |
^ hideHTMLTextArea ? false |
|
742 |
||
743 |
"Created: / 20-04-2011 / 19:00:55 / cg" |
|
744 |
! |
|
745 |
||
746 |
hideHTMLTextArea:aBoolean |
|
747 |
hideHTMLTextArea := aBoolean. |
|
748 |
||
749 |
"Created: / 20-04-2011 / 19:01:58 / cg" |
|
750 |
"Modified: / 05-05-2011 / 15:22:28 / cg" |
|
751 |
! |
|
752 |
||
753 |
hideJavaClasses |
|
754 |
^ hideJavaClasses ? false |
|
755 |
! |
|
756 |
||
757 |
hideJavaClasses:aBoolean |
|
758 |
hideJavaClasses := aBoolean. |
|
759 |
||
760 |
"Modified: / 05-05-2011 / 15:22:32 / cg" |
|
761 |
! |
|
762 |
||
763 |
hideJavaFields |
|
764 |
^ hideJavaFields ? false |
|
765 |
! |
|
766 |
||
767 |
hideJavaFields:aBoolean |
|
768 |
hideJavaFields := aBoolean. |
|
769 |
||
770 |
"Modified: / 05-05-2011 / 15:22:34 / cg" |
|
771 |
! |
|
772 |
||
773 |
hideJavaInterfaces |
|
774 |
^ hideJavaInterfaces ? false |
|
775 |
! |
|
776 |
||
777 |
hideJavaInterfaces:aBoolean |
|
778 |
hideJavaInterfaces := aBoolean. |
|
779 |
||
780 |
"Modified: / 05-05-2011 / 15:22:38 / cg" |
|
781 |
! |
|
782 |
||
783 |
hideJavaMethods |
|
784 |
^ hideJavaMethods ? false |
|
785 |
! |
|
786 |
||
787 |
hideJavaMethods:aBoolean |
|
788 |
hideJavaMethods := aBoolean. |
|
789 |
||
790 |
"Modified: / 05-05-2011 / 15:22:40 / cg" |
|
791 |
! |
|
792 |
||
793 |
hideJavaPackages |
|
794 |
^ hideJavaPackages ? false |
|
795 |
! |
|
796 |
||
797 |
hideJavaPackages:aBoolean |
|
798 |
hideJavaPackages := aBoolean. |
|
799 |
||
800 |
"Modified: / 05-05-2011 / 15:22:41 / cg" |
|
801 |
! |
|
802 |
||
803 |
hideLispConstants |
|
804 |
^ hideLispConstants ? false |
|
805 |
! |
|
806 |
||
807 |
hideLispConstants:aBoolean |
|
808 |
hideLispConstants := aBoolean. |
|
809 |
||
810 |
"Modified: / 05-05-2011 / 15:22:46 / cg" |
|
811 |
! |
|
812 |
||
813 |
hideLispEvaluations |
|
814 |
^ hideLispEvaluations ? false |
|
815 |
! |
|
816 |
||
817 |
hideLispEvaluations:aBoolean |
|
818 |
hideLispEvaluations := aBoolean. |
|
819 |
||
820 |
"Modified: / 05-05-2011 / 15:22:49 / cg" |
|
821 |
! |
|
822 |
||
823 |
hideLispMacros |
|
824 |
^ hideLispMacros ? false |
|
825 |
! |
|
826 |
||
827 |
hideLispMacros:aBoolean |
|
828 |
hideLispMacros := aBoolean. |
|
829 |
||
830 |
"Modified: / 05-05-2011 / 15:22:50 / cg" |
|
831 |
! |
|
832 |
||
833 |
hideLispMethods |
|
834 |
^ hideLispMethods ? false |
|
835 |
! |
|
836 |
||
837 |
hideLispMethods:aBoolean |
|
838 |
hideLispMethods := aBoolean. |
|
839 |
||
840 |
"Modified: / 05-05-2011 / 15:22:53 / cg" |
|
841 |
! |
|
842 |
||
843 |
hideLocalLabels |
|
844 |
^ hideLocalLabels ? false |
|
845 |
! |
|
846 |
||
12229 | 847 |
hideLocalLabels2 |
848 |
^ hideLocalLabels2 ? false |
|
849 |
||
850 |
"Created: / 24-03-2012 / 23:23:15 / cg" |
|
851 |
! |
|
852 |
||
853 |
hideLocalLabels2:aBoolean |
|
854 |
hideLocalLabels2 := aBoolean. |
|
855 |
||
856 |
"Modified: / 05-05-2011 / 15:22:54 / cg" |
|
857 |
"Created: / 24-03-2012 / 23:23:20 / cg" |
|
858 |
! |
|
859 |
||
9891 | 860 |
hideLocalLabels:aBoolean |
861 |
hideLocalLabels := aBoolean. |
|
862 |
||
863 |
"Modified: / 05-05-2011 / 15:22:54 / cg" |
|
864 |
! |
|
865 |
||
866 |
hideOzClasses |
|
867 |
^ hideOzClasses ? false |
|
868 |
! |
|
869 |
||
870 |
hideOzClasses:aBoolean |
|
871 |
hideOzClasses := aBoolean. |
|
872 |
||
873 |
"Modified: / 05-05-2011 / 15:22:58 / cg" |
|
874 |
! |
|
875 |
||
876 |
hideOzFunctions |
|
877 |
^ hideOzFunctions ? false |
|
878 |
! |
|
879 |
||
880 |
hideOzFunctions:aBoolean |
|
881 |
hideOzFunctions := aBoolean. |
|
882 |
||
883 |
"Modified: / 05-05-2011 / 15:23:00 / cg" |
|
884 |
! |
|
885 |
||
886 |
hideOzMethods |
|
887 |
^ hideOzMethods ? false |
|
888 |
! |
|
889 |
||
890 |
hideOzMethods:aBoolean |
|
891 |
hideOzMethods := aBoolean. |
|
892 |
||
893 |
"Modified: / 05-05-2011 / 15:23:02 / cg" |
|
894 |
! |
|
895 |
||
896 |
hidePythonClasses |
|
897 |
^ hidePythonClasses ? false |
|
898 |
! |
|
899 |
||
900 |
hidePythonClasses:aBoolean |
|
901 |
hidePythonClasses := aBoolean. |
|
902 |
||
903 |
"Modified: / 05-05-2011 / 15:23:05 / cg" |
|
904 |
! |
|
905 |
||
906 |
hidePythonFunctions |
|
907 |
^ hidePythonFunctions ? false |
|
908 |
! |
|
909 |
||
910 |
hidePythonFunctions:aBoolean |
|
911 |
hidePythonFunctions := aBoolean. |
|
912 |
||
913 |
"Modified: / 05-05-2011 / 15:23:07 / cg" |
|
914 |
! |
|
915 |
||
916 |
hidePythonMethods |
|
917 |
^ hidePythonMethods ? false |
|
918 |
! |
|
919 |
||
920 |
hidePythonMethods:aBoolean |
|
921 |
hidePythonMethods := aBoolean. |
|
922 |
||
923 |
"Modified: / 05-05-2011 / 15:23:09 / cg" |
|
924 |
! |
|
925 |
||
926 |
hideStatic |
|
927 |
^ hideStatic ? false |
|
928 |
! |
|
929 |
||
930 |
hideStatic:aBoolean |
|
931 |
hideStatic := aBoolean. |
|
932 |
||
933 |
"Modified: / 05-05-2011 / 15:23:11 / cg" |
|
934 |
! |
|
935 |
||
936 |
hideStructMembers |
|
937 |
^ hideStructMembers ? false |
|
938 |
! |
|
939 |
||
940 |
hideStructMembers:aBoolean |
|
941 |
hideStructMembers := aBoolean. |
|
942 |
||
943 |
"Modified: / 05-05-2011 / 15:23:15 / cg" |
|
944 |
! |
|
945 |
||
946 |
hideStructures |
|
947 |
^ hideStructures ? false |
|
948 |
! |
|
949 |
||
950 |
hideStructures:aBoolean |
|
951 |
hideStructures := aBoolean. |
|
952 |
||
953 |
"Modified: / 05-05-2011 / 15:23:17 / cg" |
|
954 |
! |
|
955 |
||
956 |
hideTextLabels |
|
957 |
^ hideTextLabels ? false |
|
958 |
! |
|
959 |
||
960 |
hideTextLabels:aBoolean |
|
961 |
hideTextLabels := aBoolean. |
|
962 |
||
963 |
"Modified: / 05-05-2011 / 15:23:19 / cg" |
|
964 |
! |
|
965 |
||
966 |
hideTypedefs |
|
967 |
^ hideTypedefs ? false |
|
968 |
! |
|
969 |
||
970 |
hideTypedefs:aBoolean |
|
971 |
hideTypedefs := aBoolean. |
|
972 |
||
973 |
"Modified: / 05-05-2011 / 15:23:21 / cg" |
|
974 |
! |
|
975 |
||
976 |
hideVariables |
|
977 |
^ hideVariables ? false |
|
978 |
! |
|
979 |
||
980 |
hideVariables:aBoolean |
|
981 |
hideVariables := aBoolean. |
|
982 |
||
983 |
"Modified: / 05-05-2011 / 15:23:23 / cg" |
|
984 |
! |
|
985 |
||
986 |
javaClassesAndMethodsOnly |
|
987 |
^ showOnly == #javaClassesAndMethods |
|
988 |
||
989 |
"Modified: / 07-06-2010 / 14:18:25 / cg" |
|
990 |
! |
|
991 |
||
992 |
javaClassesAndMethodsOnly:aBoolean |
|
993 |
showOnly := nil. |
|
994 |
aBoolean ifTrue:[ |
|
995 |
showOnly := DefaultShowOnly := #javaClassesAndMethods |
|
996 |
]. |
|
997 |
||
998 |
"Modified: / 05-05-2011 / 15:23:25 / cg" |
|
999 |
! |
|
1000 |
||
1001 |
javaClassesOnly |
|
1002 |
^ showOnly == #javaClasses |
|
1003 |
||
1004 |
"Modified: / 07-06-2010 / 14:18:28 / cg" |
|
1005 |
! |
|
1006 |
||
1007 |
javaClassesOnly:aBoolean |
|
1008 |
showOnly := nil. |
|
1009 |
aBoolean ifTrue:[ |
|
1010 |
showOnly := DefaultShowOnly := #javaClasses |
|
1011 |
]. |
|
1012 |
||
1013 |
"Modified: / 05-05-2011 / 15:23:29 / cg" |
|
1014 |
! |
|
1015 |
||
1016 |
javaMethodsOnly |
|
1017 |
^ showOnly == #javaMethods |
|
1018 |
||
1019 |
"Modified: / 07-06-2010 / 14:18:30 / cg" |
|
1020 |
! |
|
1021 |
||
1022 |
javaMethodsOnly:aBoolean |
|
1023 |
showOnly := nil. |
|
1024 |
aBoolean ifTrue:[ |
|
1025 |
showOnly := DefaultShowOnly := #javaMethods |
|
1026 |
]. |
|
1027 |
||
1028 |
"Modified: / 05-05-2011 / 15:23:31 / cg" |
|
1029 |
! |
|
1030 |
||
1031 |
macrosOnly |
|
1032 |
^ showOnly == #macros |
|
1033 |
||
1034 |
"Created: / 07-06-2010 / 12:09:22 / cg" |
|
1035 |
"Modified: / 07-06-2010 / 14:18:33 / cg" |
|
1036 |
! |
|
1037 |
||
1038 |
macrosOnly:aBoolean |
|
1039 |
showOnly := nil. |
|
1040 |
aBoolean ifTrue:[ |
|
1041 |
showOnly := DefaultShowOnly := #macros |
|
1042 |
]. |
|
1043 |
||
1044 |
"Created: / 07-06-2010 / 12:09:34 / cg" |
|
1045 |
"Modified: / 05-05-2011 / 15:23:33 / cg" |
|
1046 |
! |
|
1047 |
||
1048 |
methodsOnly |
|
1049 |
^ showOnly == #methods |
|
1050 |
||
1051 |
"Created: / 07-06-2010 / 12:12:26 / cg" |
|
1052 |
"Modified: / 07-06-2010 / 14:18:38 / cg" |
|
1053 |
! |
|
1054 |
||
1055 |
methodsOnly:aBoolean |
|
1056 |
showOnly := nil. |
|
1057 |
aBoolean ifTrue:[ |
|
1058 |
showOnly := DefaultShowOnly := #methods |
|
1059 |
]. |
|
1060 |
||
1061 |
"Created: / 07-06-2010 / 12:12:30 / cg" |
|
1062 |
"Modified: / 05-05-2011 / 15:23:35 / cg" |
|
1063 |
! |
|
1064 |
||
1065 |
ozClassesOnly |
|
1066 |
^ showOnly == #ozClasses |
|
1067 |
||
1068 |
"Modified: / 07-06-2010 / 14:18:41 / cg" |
|
1069 |
! |
|
1070 |
||
1071 |
ozClassesOnly:aBoolean |
|
1072 |
showOnly := nil. |
|
1073 |
aBoolean ifTrue:[ |
|
1074 |
showOnly := DefaultShowOnly := #ozClasses |
|
1075 |
]. |
|
1076 |
||
1077 |
"Modified: / 05-05-2011 / 15:23:38 / cg" |
|
1078 |
! |
|
1079 |
||
1080 |
ozFunctionsOnly |
|
1081 |
^ showOnly == #ozFunctions |
|
1082 |
||
1083 |
"Modified: / 07-06-2010 / 14:18:44 / cg" |
|
1084 |
! |
|
1085 |
||
1086 |
ozFunctionsOnly:aBoolean |
|
1087 |
showOnly := nil. |
|
1088 |
aBoolean ifTrue:[ |
|
1089 |
showOnly := DefaultShowOnly := #ozFunctions |
|
1090 |
]. |
|
1091 |
self updateContentsFromRawList. |
|
1092 |
||
1093 |
"Modified: / 05-05-2011 / 15:18:51 / cg" |
|
1094 |
! |
|
1095 |
||
1096 |
ozMethodsOnly |
|
1097 |
^ showOnly == #ozMethods |
|
1098 |
||
1099 |
"Modified: / 07-06-2010 / 14:18:47 / cg" |
|
1100 |
! |
|
1101 |
||
1102 |
ozMethodsOnly:aBoolean |
|
1103 |
showOnly := nil. |
|
1104 |
aBoolean ifTrue:[ |
|
1105 |
showOnly := DefaultShowOnly := #ozMethods |
|
1106 |
]. |
|
1107 |
||
1108 |
"Modified: / 05-05-2011 / 15:23:44 / cg" |
|
1109 |
! |
|
1110 |
||
1111 |
pythonClassesOnly |
|
1112 |
^ showOnly == #pythonClasses |
|
1113 |
||
1114 |
"Modified: / 07-06-2010 / 14:18:52 / cg" |
|
1115 |
! |
|
1116 |
||
1117 |
pythonClassesOnly:aBoolean |
|
1118 |
showOnly := nil. |
|
1119 |
aBoolean ifTrue:[ |
|
1120 |
showOnly := DefaultShowOnly := #pythonClasses |
|
1121 |
]. |
|
1122 |
||
1123 |
"Modified: / 05-05-2011 / 15:23:46 / cg" |
|
1124 |
! |
|
1125 |
||
1126 |
pythonFunctionsOnly |
|
1127 |
^ showOnly == #pythonFunctions |
|
1128 |
||
1129 |
"Modified: / 07-06-2010 / 14:18:55 / cg" |
|
1130 |
! |
|
1131 |
||
1132 |
pythonFunctionsOnly:aBoolean |
|
1133 |
showOnly := nil. |
|
1134 |
aBoolean ifTrue:[ |
|
1135 |
showOnly := DefaultShowOnly := #pythonFunctions |
|
1136 |
]. |
|
1137 |
||
1138 |
"Modified: / 05-05-2011 / 15:23:48 / cg" |
|
1139 |
! |
|
1140 |
||
1141 |
pythonMethodsOnly |
|
1142 |
^ showOnly == #pythonMethods |
|
1143 |
||
1144 |
"Modified: / 07-06-2010 / 14:18:58 / cg" |
|
1145 |
! |
|
1146 |
||
1147 |
pythonMethodsOnly:aBoolean |
|
1148 |
showOnly := nil. |
|
1149 |
aBoolean ifTrue:[ |
|
1150 |
showOnly := DefaultShowOnly := #pythonMethods |
|
1151 |
]. |
|
1152 |
||
1153 |
"Modified: / 05-05-2011 / 15:23:51 / cg" |
|
1154 |
! |
|
1155 |
||
1156 |
showOnly |
|
1157 |
tagTypesPresent == false ifTrue:[ |
|
1158 |
^ nil "/ showing everything |
|
1159 |
]. |
|
1160 |
^ showOnly "? DefaultShowOnly" |
|
1161 |
||
1162 |
"Modified: / 20-06-2010 / 01:44:13 / cg" |
|
1163 |
! |
|
1164 |
||
1165 |
showOnly:aSymbol |
|
1166 |
showOnly := aSymbol |
|
1167 |
||
1168 |
"Modified: / 05-05-2011 / 15:23:55 / cg" |
|
1169 |
! |
|
1170 |
||
1171 |
structsOnly |
|
1172 |
^ showOnly == #structs |
|
1173 |
||
1174 |
"Created: / 25-06-2010 / 10:42:27 / cg" |
|
1175 |
! |
|
1176 |
||
1177 |
structsOnly:aBoolean |
|
1178 |
showOnly := DefaultShowOnly := nil. |
|
1179 |
aBoolean ifTrue:[ |
|
1180 |
showOnly := "DefaultShowOnly :=" #structs |
|
1181 |
]. |
|
1182 |
||
1183 |
"Created: / 25-06-2010 / 10:42:39 / cg" |
|
1184 |
"Modified: / 05-05-2011 / 15:23:58 / cg" |
|
1185 |
! |
|
1186 |
||
1187 |
targetsOnly |
|
1188 |
^ showOnly == #targets |
|
1189 |
||
1190 |
"Modified: / 07-06-2010 / 14:19:03 / cg" |
|
1191 |
! |
|
1192 |
||
1193 |
targetsOnly:aBoolean |
|
1194 |
showOnly := DefaultShowOnly := nil. |
|
1195 |
aBoolean ifTrue:[ |
|
1196 |
showOnly := DefaultShowOnly := #targets |
|
1197 |
]. |
|
1198 |
||
1199 |
"Modified: / 05-05-2011 / 15:24:02 / cg" |
|
1200 |
! |
|
1201 |
||
1202 |
typesOnly |
|
1203 |
^ showOnly == #types |
|
1204 |
||
1205 |
"Modified: / 07-06-2010 / 14:19:06 / cg" |
|
1206 |
! |
|
1207 |
||
1208 |
typesOnly:aBoolean |
|
1209 |
showOnly := DefaultShowOnly := nil. |
|
1210 |
aBoolean ifTrue:[ |
|
1211 |
showOnly := "DefaultShowOnly :=" #types |
|
1212 |
]. |
|
1213 |
||
1214 |
"Modified: / 05-05-2011 / 15:24:04 / cg" |
|
1215 |
! |
|
1216 |
||
1217 |
variablesOnly |
|
1218 |
^ showOnly == #variables |
|
1219 |
||
1220 |
"Modified: / 07-06-2010 / 14:19:09 / cg" |
|
1221 |
! |
|
1222 |
||
1223 |
variablesOnly:aBoolean |
|
1224 |
showOnly := nil. |
|
1225 |
aBoolean ifTrue:[ |
|
1226 |
showOnly := DefaultShowOnly := #variables |
|
1227 |
]. |
|
1228 |
||
1229 |
"Modified: / 05-05-2011 / 15:24:06 / cg" |
|
1230 |
! ! |
|
1231 |
||
1232 |
!TagList methodsFor:'accessing-presentation'! |
|
1233 |
||
1234 |
groupBy |
|
1235 |
^ groupBy |
|
1236 |
||
1237 |
"Created: / 05-05-2011 / 14:31:37 / cg" |
|
1238 |
"Modified: / 05-05-2011 / 15:34:14 / cg" |
|
1239 |
! |
|
1240 |
||
1241 |
groupBy:aSymbolOrNil |
|
1242 |
groupBy ~~ aSymbolOrNil ifTrue:[ |
|
1243 |
groupBy := DefaultGroupBy := aSymbolOrNil. |
|
1244 |
self updateContentsFromFilteredList |
|
1245 |
]. |
|
1246 |
||
1247 |
"Created: / 05-05-2011 / 14:32:00 / cg" |
|
1248 |
! |
|
1249 |
||
1250 |
groupedByType |
|
1251 |
^ self groupBy == #byType |
|
1252 |
||
1253 |
"Created: / 05-05-2011 / 14:32:53 / cg" |
|
1254 |
! |
|
1255 |
||
1256 |
groupedByType:aBoolean |
|
1257 |
aBoolean == true ifTrue:[ |
|
1258 |
self groupBy:#byType |
|
1259 |
] ifFalse:[ |
|
1260 |
self groupBy:nil |
|
1261 |
]. |
|
1262 |
||
1263 |
"Created: / 05-05-2011 / 14:33:05 / cg" |
|
1264 |
! |
|
1265 |
||
1266 |
sortCriteria |
|
1267 |
^ sortCriteria ? DefaultSortCriteria |
|
1268 |
! |
|
1269 |
||
1270 |
sortCriteria:aSymbolOrNil |
|
1271 |
sortCriteria ~~ aSymbolOrNil ifTrue:[ |
|
1272 |
sortCriteria := DefaultSortCriteria := aSymbolOrNil. |
|
1273 |
Sorted := sortCriteria. |
|
1274 |
self updateContentsFromFilteredList |
|
1275 |
]. |
|
1276 |
||
1277 |
"Modified: / 05-05-2011 / 14:50:18 / cg" |
|
1278 |
! |
|
1279 |
||
1280 |
sorted |
|
1281 |
"backward compatibility" |
|
1282 |
||
1283 |
^ self sortCriteria notNil |
|
1284 |
! |
|
1285 |
||
1286 |
sorted:aBoolean |
|
1287 |
"backward compatibility" |
|
1288 |
||
1289 |
aBoolean ifTrue:[ |
|
1290 |
self sortCriteria:#byName |
|
1291 |
] ifFalse:[ |
|
1292 |
self sortCriteria:nil |
|
1293 |
]. |
|
1294 |
! |
|
1295 |
||
1296 |
sortedByLineNumber |
|
1297 |
^ self sortCriteria isNil |
|
1298 |
or:[ self sortCriteria == #lineNumber ] |
|
1299 |
||
1300 |
"Modified: / 05-05-2011 / 14:30:33 / cg" |
|
1301 |
! |
|
1302 |
||
1303 |
sortedByLineNumber:aBoolean |
|
1304 |
aBoolean == true ifTrue:[ |
|
1305 |
self sortCriteria:#lineNumber |
|
1306 |
]. |
|
1307 |
||
1308 |
"Modified: / 27-06-2010 / 21:31:44 / cg" |
|
1309 |
! |
|
1310 |
||
1311 |
sortedByName |
|
1312 |
^ self sortCriteria == #byName |
|
1313 |
! |
|
1314 |
||
1315 |
sortedByName:aBoolean |
|
1316 |
aBoolean == true ifTrue:[ |
|
1317 |
self sortCriteria:#byName |
|
1318 |
]. |
|
1319 |
! |
|
1320 |
||
1321 |
sortedByNameIgnoringCase |
|
1322 |
^ self sortCriteria == #byNameIgnoringCase |
|
1323 |
! |
|
1324 |
||
1325 |
sortedByNameIgnoringCase:aBoolean |
|
1326 |
aBoolean == true ifTrue:[ |
|
1327 |
self sortCriteria:#byNameIgnoringCase |
|
1328 |
]. |
|
1329 |
! |
|
1330 |
||
1331 |
sortedByNameIgnoringLeadingUnderscores |
|
1332 |
^ self sortCriteria == #byNameIgnoringLeadingUnderscores |
|
1333 |
! |
|
1334 |
||
1335 |
sortedByNameIgnoringLeadingUnderscores:aBoolean |
|
1336 |
aBoolean == true ifTrue:[ |
|
1337 |
self sortCriteria:#byNameIgnoringLeadingUnderscores |
|
1338 |
]. |
|
1339 |
! |
|
1340 |
||
1341 |
sortedByNameIgnoringLeadingUnderscoresAndCase |
|
1342 |
^ self sortCriteria == #byNameIgnoringLeadingUnderscoresAndCase |
|
1343 |
! |
|
1344 |
||
1345 |
sortedByNameIgnoringLeadingUnderscoresAndCase:aBoolean |
|
1346 |
aBoolean == true ifTrue:[ |
|
1347 |
self sortCriteria:#byNameIgnoringLeadingUnderscoresAndCase |
|
1348 |
]. |
|
1349 |
! |
|
1350 |
||
1351 |
sortedByType |
|
1352 |
^ self sortCriteria == #byType |
|
1353 |
! |
|
1354 |
||
1355 |
sortedByType:aBoolean |
|
1356 |
aBoolean == true ifTrue:[ |
|
1357 |
self sortCriteria:#byType |
|
1358 |
]. |
|
1359 |
! |
|
1360 |
||
1361 |
tagTypesPresent |
|
1362 |
^ tagTypesPresent |
|
1363 |
! ! |
|
1364 |
||
1365 |
!TagList methodsFor:'private'! |
|
1366 |
||
1367 |
applyFilterToList:aList |
|
1368 |
^ aList |
|
1369 |
select:[:tag | |
|
1370 |
tag label includesString:filter caseSensitive:false |
|
1371 |
] |
|
1372 |
! |
|
1373 |
||
1374 |
getCtagsVersion |
|
1375 |
" parse major and minor version from ctags by operating system command |
|
1376 |
cehck for the 'Exuberant Ctags' string being present |
|
1377 |
return an Array with mafor and minor part of version or nil if not available" |
|
1378 |
||
1379 |
| stream string index majorVersion minorVersion indexOfPoint| |
|
1380 |
||
1381 |
stream := WriteStream on:''. |
|
1382 |
OperatingSystem |
|
1383 |
executeCommand:'ctags --version' |
|
1384 |
inputFrom:nil |
|
1385 |
outputTo:stream |
|
1386 |
errorTo:stream |
|
1387 |
inDirectory:nil |
|
1388 |
onError:[:status| false]. |
|
1389 |
string := stream contents. |
|
1390 |
index := string findString:'Exuberant Ctags' ifAbsent:[nil]. |
|
1391 |
index notNil ifTrue:[ |
|
1392 |
string := (string copyFrom:(index + ('Exuberant Ctags' size))) asArrayOfSubstrings first. |
|
1393 |
(string includes:$,) ifTrue:[ string := string copyTo:((string indexOf:$,) - 1)]. |
|
1394 |
indexOfPoint := string indexOf:$. ifAbsent:nil. |
|
1395 |
indexOfPoint notNil ifTrue:[ |
|
1396 |
majorVersion := (string copyFrom:1 to:indexOfPoint - 1) asInteger. |
|
1397 |
minorVersion := (string copyFrom:indexOfPoint + 1 to:string size) asInteger. |
|
1398 |
^ Array with:majorVersion with:minorVersion. |
|
1399 |
] |
|
1400 |
]. |
|
1401 |
^ nil |
|
1402 |
||
1403 |
"Modified: / 05-05-2011 / 14:48:08 / cg" |
|
1404 |
! |
|
1405 |
||
1406 |
setFilteredList:aList |
|
1407 |
filteredList := aList. |
|
1408 |
self updateContentsFromFilteredList |
|
1409 |
||
1410 |
"Created: / 05-05-2011 / 14:46:12 / cg" |
|
1411 |
! |
|
1412 |
||
1413 |
setRawList:aList |
|
1414 |
rawList := aList. |
|
1415 |
self updateContentsFromRawList |
|
1416 |
||
1417 |
"Created: / 05-05-2011 / 14:46:22 / cg" |
|
1418 |
! |
|
1419 |
||
1420 |
shellCommandFor:aFilenameString |
|
1421 |
"returns the shellCommand to be used" |
|
1422 |
||
12125 | 1423 |
|template| |
1424 |
||
1425 |
(template := self shellCommandTemplateFor:aFilenameString) isNil ifTrue:[ |
|
1426 |
^ nil |
|
1427 |
]. |
|
1428 |
^ template bindWith:aFilenameString |
|
1429 |
||
1430 |
"Modified: / 05-01-2012 / 11:10:03 / cg" |
|
1431 |
! |
|
1432 |
||
1433 |
shellCommandTemplateFor:aFilenameString |
|
1434 |
"returns the shellCommand to be used (contains %1 for the filename)" |
|
1435 |
||
9891 | 1436 |
|lcSuffix shellCommand isCSuffix isCPlusPlusSuffix isJavaSuffix isEiffelSuffix isFortranSuffix |
1437 |
showOnly response suff fn| |
|
1438 |
||
1439 |
ctagsCommand isNil ifTrue:[ |
|
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1440 |
remoteTarget isNil ifTrue:[ |
9891 | 1441 |
"/ local use |
1442 |
suff := (OperatingSystem isMSWINDOWSlike) ifTrue:'.exe' ifFalse:''. |
|
1443 |
||
1444 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags-5.0.1/ctags',suff. |
|
1445 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
|
1446 |
ctagsCommand := fn pathName. |
|
1447 |
ctagsIsExCtags := ctagsIsExCtags5x := true. |
|
1448 |
] ifFalse:[ |
|
1449 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags-3.2.2/ctags',suff. |
|
1450 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
|
1451 |
ctagsCommand := fn pathName. |
|
1452 |
ctagsIsExCtags := true. |
|
1453 |
ctagsIsExCtags5x := false. |
|
1454 |
] ifFalse:[ |
|
1455 |
ctagsIsExCtags := nil. |
|
1456 |
ctagsIsExCtags5x := nil. |
|
1457 |
ctagsCommand := Smalltalk getPackageFileName:'stx/support/tools/ctags/ctags',suff. |
|
1458 |
(ctagsCommand notNil and:[(fn := ctagsCommand asFilename) isExecutableProgram]) ifTrue:[ |
|
1459 |
ctagsCommand := fn pathName. |
|
1460 |
] ifFalse:[ |
|
1461 |
"/ use systems default ctags command |
|
1462 |
ctagsCommand := 'ctags'. |
|
1463 |
] |
|
1464 |
] |
|
1465 |
]. |
|
1466 |
] ifFalse:[ |
|
1467 |
"/ cross-development |
|
1468 |
"/ target remoteOperatingSystem = 'Linux' ifTrue:[ |
|
1469 |
"/ use systems default ctags command |
|
1470 |
ctagsCommand := 'ctags'. |
|
1471 |
ctagsIsExCtags := nil. |
|
1472 |
ctagsIsExCtags5x := nil. |
|
1473 |
"/ ] |
|
1474 |
]. |
|
1475 |
]. |
|
1476 |
||
1477 |
(ctagsIsExCtags isNil or:[ctagsIsExCtags5x isNil]) ifTrue:[ |
|
1478 |
ctagsCommand notNil ifTrue:[ |
|
1479 |
response := OperatingSystem getCommandOutputFrom:(ctagsCommand, ' --version'). |
|
1480 |
(response notNil |
|
1481 |
and:[response asLowercase startsWith:'exuberant ctags']) ifTrue:[ |
|
1482 |
ctagsIsExCtags := true. |
|
1483 |
||
1484 |
response := (response copyFrom:'exuberant ctags' size + 1) withoutSeparators. |
|
1485 |
ctagsIsExCtags5x := response startsWith:'5.' |
|
1486 |
]. |
|
1487 |
]. |
|
1488 |
]. |
|
1489 |
||
1490 |
shellCommand := ctagsCommand. |
|
1491 |
(shellCommand includes:Character space) ifTrue:[ |
|
1492 |
shellCommand := '"',shellCommand,'"'. |
|
1493 |
]. |
|
1494 |
||
1495 |
showOnly := self showOnly. |
|
1496 |
||
1497 |
lcSuffix := aFilenameString asFilename suffix asLowercase. |
|
1498 |
||
1499 |
isCSuffix := self class isCSuffix:lcSuffix. |
|
1500 |
isCPlusPlusSuffix := self class isCPlusPlusSuffix:lcSuffix. |
|
1501 |
||
1502 |
(shellCommand notNil and:[(ctagsIsExCtags ? false)]) ifTrue:[ |
|
1503 |
isJavaSuffix := self class isJavaSuffix:lcSuffix. |
|
1504 |
isEiffelSuffix := self class isEiffelSuffix:lcSuffix. |
|
1505 |
isFortranSuffix := self class isFortranSuffix:lcSuffix. |
|
1506 |
||
1507 |
"/ ex_ctags supports c, c++, java, fortran and a few others |
|
1508 |
(isCSuffix or:[isCPlusPlusSuffix or:[isJavaSuffix or:[isEiffelSuffix or:[isFortranSuffix]]]]) ifFalse:[ |
|
1509 |
(ctagsIsExCtags5x ? false) ifFalse:[ |
|
1510 |
^ nil |
|
1511 |
]. |
|
1512 |
"/ ex_ctags5.x also supports awk, lisp, perl, pascal and a few others |
|
1513 |
"/ ^ nil |
|
1514 |
]. |
|
1515 |
||
1516 |
usingDefaultCTags := false. |
|
1517 |
shellCommand := shellCommand asFilename asAbsoluteFilename pathName. |
|
1518 |
"/ shellCommand := shellCommand, ' -f - --c-types=f --file-scope=no'. |
|
1519 |
"/ shellCommand := shellCommand, ' -f - --file-scope=yes'. |
|
1520 |
"/ shellCommand := shellCommand, ' -f - --file-scope=yes'. |
|
1521 |
shellCommand := shellCommand, ' -f - --file-scope=yes --excmd=number'. |
|
1522 |
||
1523 |
(isCSuffix or:[isCPlusPlusSuffix]) ifTrue:[ |
|
1524 |
isCPlusPlusSuffix |
|
1525 |
ifTrue:[ shellCommand := shellCommand, ' --lang=c++'] |
|
1526 |
ifFalse:[ shellCommand := shellCommand, ' --lang=c']. |
|
1527 |
||
1528 |
showOnly == #classes ifTrue:[ |
|
1529 |
shellCommand := shellCommand, ' --c-types=c' |
|
1530 |
] ifFalse:[ |
|
1531 |
showOnly == #functions ifTrue:[ |
|
1532 |
shellCommand := shellCommand, ' --c-types=f' |
|
1533 |
] ifFalse:[ |
|
1534 |
showOnly == #functionsAndVariables ifTrue:[ |
|
1535 |
shellCommand := shellCommand, ' --c-types=fv' |
|
1536 |
] ifFalse:[ |
|
1537 |
showOnly == #classesFunctionsAndVariables ifTrue:[ |
|
1538 |
shellCommand := shellCommand, ' --c-types=cfv' |
|
1539 |
] ifFalse:[ |
|
1540 |
showOnly == #variables ifTrue:[ |
|
1541 |
shellCommand := shellCommand, ' --c-types=v' |
|
1542 |
] ifFalse:[ |
|
1543 |
showOnly == #types ifTrue:[ |
|
1544 |
shellCommand := shellCommand, ' --c-types=t' |
|
1545 |
] |
|
1546 |
] |
|
1547 |
] |
|
1548 |
] |
|
1549 |
] |
|
1550 |
]. |
|
1551 |
hideStructMembers == true ifTrue:[ |
|
1552 |
shellCommand := shellCommand, ' --c-types=-m' |
|
1553 |
]. |
|
1554 |
hideDefines == true ifTrue:[ |
|
1555 |
shellCommand := shellCommand, ' --c-types=-d' |
|
1556 |
]. |
|
1557 |
hideTypedefs == true ifTrue:[ |
|
1558 |
shellCommand := shellCommand, ' --c-types=-t' |
|
1559 |
]. |
|
1560 |
hideStructures == true ifTrue:[ |
|
1561 |
shellCommand := shellCommand, ' --c-types=-s' |
|
1562 |
]. |
|
1563 |
hideVariables == true ifTrue:[ |
|
1564 |
shellCommand := shellCommand, ' --c-types=-v' |
|
1565 |
]. |
|
1566 |
hideFunctions == true ifTrue:[ |
|
1567 |
shellCommand := shellCommand, ' --c-types=-f' |
|
1568 |
]. |
|
1569 |
hideClasses == true ifTrue:[ |
|
1570 |
shellCommand := shellCommand, ' --c-types=-c' |
|
1571 |
]. |
|
1572 |
]. |
|
1573 |
isJavaSuffix ifTrue:[ |
|
1574 |
shellCommand := shellCommand, ' --lang=java'. |
|
1575 |
||
1576 |
showOnly == #javaClasses ifTrue:[ |
|
1577 |
shellCommand := shellCommand, ' --java-types=c' |
|
1578 |
] ifFalse:[ |
|
1579 |
showOnly == #javaMethods ifTrue:[ |
|
1580 |
shellCommand := shellCommand, ' --java-types=m' |
|
1581 |
] ifFalse:[ |
|
1582 |
showOnly == #javaClassesAndMethods ifTrue:[ |
|
1583 |
shellCommand := shellCommand, ' --java-types=mc' |
|
1584 |
] |
|
1585 |
] |
|
1586 |
]. |
|
1587 |
hideJavaClasses == true ifTrue:[ |
|
1588 |
shellCommand := shellCommand, ' --java-types=-c' |
|
1589 |
]. |
|
1590 |
hideJavaMethods == true ifTrue:[ |
|
1591 |
shellCommand := shellCommand, ' --java-types=-m' |
|
1592 |
]. |
|
1593 |
hideJavaInterfaces == true ifTrue:[ |
|
1594 |
shellCommand := shellCommand, ' --java-types=-i' |
|
1595 |
]. |
|
1596 |
hideJavaFields == true ifTrue:[ |
|
1597 |
shellCommand := shellCommand, ' --java-types=-f' |
|
1598 |
]. |
|
1599 |
hideJavaPackages == true ifTrue:[ |
|
1600 |
shellCommand := shellCommand, ' --java-types=-p' |
|
1601 |
]. |
|
1602 |
]. |
|
1603 |
isEiffelSuffix ifTrue:[ |
|
1604 |
shellCommand := shellCommand, ' --lang=eiffel'. |
|
1605 |
||
1606 |
showOnly == #classes ifTrue:[ |
|
1607 |
shellCommand := shellCommand, ' --eiffel-types=c' |
|
1608 |
] ifFalse:[ |
|
1609 |
showOnly == #features ifTrue:[ |
|
1610 |
shellCommand := shellCommand, ' --eiffel-types=f' |
|
1611 |
] |
|
1612 |
]. |
|
1613 |
"/ hideEiffelClasses == true ifTrue:[ |
|
1614 |
"/ shellCommand := shellCommand, ' --eiffel-types=-c' |
|
1615 |
"/ ]. |
|
1616 |
"/ hideEiffelFeatures == true ifTrue:[ |
|
1617 |
"/ shellCommand := shellCommand, ' --eiffel-types=-m' |
|
1618 |
"/ ]. |
|
1619 |
]. |
|
1620 |
||
1621 |
isFortranSuffix ifTrue:[ |
|
1622 |
shellCommand := shellCommand, ' --lang=fortran'. |
|
1623 |
||
1624 |
showOnly == #functions ifTrue:[ |
|
1625 |
shellCommand := shellCommand, ' --fortran-types=f' |
|
1626 |
] ifFalse:[ |
|
1627 |
showOnly == #interfaces ifTrue:[ |
|
1628 |
shellCommand := shellCommand, ' --fortran-types=i' |
|
1629 |
] ifFalse:[ |
|
1630 |
showOnly == #subroutines ifTrue:[ |
|
1631 |
shellCommand := shellCommand, ' --fortran-types=s' |
|
1632 |
] ifFalse:[ |
|
1633 |
showOnly == #commonBlocks == true ifTrue:[ |
|
1634 |
shellCommand := shellCommand, ' --fortran-types=c' |
|
1635 |
] |
|
1636 |
] |
|
1637 |
] |
|
1638 |
]. |
|
1639 |
"/ hideFortranFunctions == true ifTrue:[ |
|
1640 |
"/ shellCommand := shellCommand, ' --fortran-types=-f' |
|
1641 |
"/ ]. |
|
1642 |
"/ hideFortranInterfaces == true ifTrue:[ |
|
1643 |
"/ shellCommand := shellCommand, ' --fortran-types=-i' |
|
1644 |
"/ ]. |
|
1645 |
"/ hideFortranSubroutines == true ifTrue:[ |
|
1646 |
"/ shellCommand := shellCommand, ' --fortran-types=-s' |
|
1647 |
"/ ]. |
|
1648 |
"/ hideFortranCommonBlocks == true ifTrue:[ |
|
1649 |
"/ shellCommand := shellCommand, ' --fortran-types=-c' |
|
1650 |
"/ ]. |
|
1651 |
"/ hideFortranEntryPoints == true ifTrue:[ |
|
1652 |
"/ shellCommand := shellCommand, ' --fortran-types=-e' |
|
1653 |
"/ ]. |
|
1654 |
"/ hideFortranLabels == true ifTrue:[ |
|
1655 |
"/ shellCommand := shellCommand, ' --fortran-types=-l' |
|
1656 |
"/ ]. |
|
1657 |
"/ hideFortranDerivedTypes == true ifTrue:[ |
|
1658 |
"/ shellCommand := shellCommand, ' --fortran-types=-t' |
|
1659 |
"/ ]. |
|
1660 |
]. |
|
1661 |
||
1662 |
"/ shellCommand := shellCommand, ' -f -'. |
|
12125 | 1663 |
shellCommand := shellCommand, ' "%1"'. |
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1664 |
remoteTarget notNil ifTrue:[ |
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1665 |
^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./'). |
9891 | 1666 |
]. |
1667 |
^ shellCommand. |
|
1668 |
]. |
|
1669 |
||
1670 |
"/ regular ctags: assume supports c, c++ only |
|
1671 |
isCSuffix ifFalse:[ |
|
1672 |
^ nil |
|
1673 |
]. |
|
1674 |
||
1675 |
usingDefaultCTags := true. |
|
1676 |
||
1677 |
shellCommand := 'ctags'. |
|
1678 |
||
1679 |
"/ "sunos and realIX have no option -s" |
|
1680 |
"/ (OperatingSystem getOSType = 'linux') ifTrue:[ |
|
1681 |
"/ shellCommand := 'ctags -S' |
|
1682 |
"/ ]. |
|
1683 |
Transcript showCR:('using default ctags command (not ctags from stx): <', shellCommand, '>'). |
|
1684 |
ctagsCommand := nil. "/ flush - so we will check again. |
|
1685 |
||
12125 | 1686 |
shellCommand := shellCommand, ' "%1"'. |
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1687 |
remoteTarget notNil ifTrue:[ |
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1688 |
^ (remoteTarget makeRemoteCommandFrom:shellCommand inDirectory:'./'). |
9891 | 1689 |
]. |
1690 |
^ shellCommand |
|
1691 |
||
1692 |
"Modified: / 08-07-2010 / 00:23:24 / cg" |
|
12125 | 1693 |
"Created: / 05-01-2012 / 11:07:41 / cg" |
9891 | 1694 |
! |
1695 |
||
1696 |
sortBlock |
|
1697 |
"sort AND group" |
|
1698 |
||
1699 |
|sortBlock| |
|
1700 |
||
1701 |
sortCriteria := self sortCriteria. |
|
1702 |
sortBlock := self sortBlockForSortCriteria. |
|
1703 |
||
1704 |
groupBy isNil ifTrue:[ |
|
1705 |
^ sortBlock |
|
1706 |
]. |
|
1707 |
||
1708 |
^ [:a :b| |
|
1709 |
|t1 t2 l1 l2| |
|
1710 |
||
1711 |
t1 := a typeIdentifierInList ? ' '. |
|
1712 |
t2 := b typeIdentifierInList ? ' '. |
|
1713 |
t1 = t2 ifTrue:[ |
|
1714 |
sortBlock value:a value:b |
|
1715 |
] ifFalse:[ |
|
1716 |
t1 < t2 |
|
1717 |
] |
|
1718 |
]. |
|
1719 |
||
1720 |
"Modified: / 05-05-2011 / 15:35:02 / cg" |
|
1721 |
! |
|
1722 |
||
1723 |
sortBlockForSortCriteria |
|
1724 |
sortCriteria == #byName ifTrue:[ |
|
1725 |
^ [:a :b| |
|
1726 |
|l1 l2| |
|
1727 |
||
9939
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
1728 |
l1 := a label ? ''. |
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
1729 |
l2 := b label ? ''. |
9891 | 1730 |
l1 = l2 ifTrue:[ |
1731 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
1732 |
] ifFalse:[ |
|
1733 |
l1 < l2 |
|
1734 |
] |
|
1735 |
] |
|
1736 |
]. |
|
1737 |
||
1738 |
sortCriteria == #byNameIgnoringCase ifTrue:[ |
|
1739 |
^ [:a :b| |
|
1740 |
|l1 l2| |
|
1741 |
||
1742 |
l1 := a label asLowercase. |
|
1743 |
l2 := b label asLowercase. |
|
1744 |
l1 = l2 ifTrue:[ |
|
1745 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
1746 |
] ifFalse:[ |
|
1747 |
l1 < l2 |
|
1748 |
] |
|
1749 |
] |
|
1750 |
]. |
|
1751 |
||
1752 |
sortCriteria == #byNameIgnoringLeadingUnderscores ifTrue:[ |
|
1753 |
^ [:a :b| |
|
1754 |
|l1 l2 i| |
|
1755 |
||
1756 |
l1 := a label. |
|
1757 |
l2 := b label. |
|
1758 |
l1 = l2 ifTrue:[ |
|
1759 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
1760 |
] ifFalse:[ |
|
1761 |
i := l1 findFirst:[:c | (c ~~ $_)]. |
|
1762 |
i > 1 ifTrue:[ |
|
1763 |
l1 := l1 copyFrom:i |
|
1764 |
]. |
|
1765 |
i := l2 findFirst:[:c | (c ~~ $_)]. |
|
1766 |
i > 1 ifTrue:[ |
|
1767 |
l2 := l2 copyFrom:i |
|
1768 |
]. |
|
1769 |
l1 < l2 |
|
1770 |
] |
|
1771 |
]. |
|
1772 |
]. |
|
1773 |
||
1774 |
sortCriteria == #byNameIgnoringLeadingUnderscoresAndCase ifTrue:[ |
|
1775 |
^ [:a :b| |
|
1776 |
|l1 l2 i| |
|
1777 |
||
1778 |
l1 := a label asLowercase. |
|
1779 |
l2 := b label asLowercase. |
|
1780 |
l1 = l2 ifTrue:[ |
|
1781 |
(a lineNumber ? 0) < (b lineNumber ? 0) |
|
1782 |
] ifFalse:[ |
|
1783 |
i := l1 findFirst:[:c | (c ~~ $_)]. |
|
1784 |
i > 1 ifTrue:[ |
|
1785 |
l1 := l1 copyFrom:i |
|
1786 |
]. |
|
1787 |
i := l2 findFirst:[:c | (c ~~ $_)]. |
|
1788 |
i > 1 ifTrue:[ |
|
1789 |
l2 := l2 copyFrom:i |
|
1790 |
]. |
|
1791 |
l1 < l2 |
|
1792 |
] |
|
1793 |
]. |
|
1794 |
]. |
|
1795 |
||
1796 |
"/ sortCriteria == #byType ifTrue:[ |
|
1797 |
"/ ^ [:a :b| |
|
1798 |
"/ |t1 t2 l1 l2| |
|
1799 |
"/ t1 := a typeIdentifierInList ? ' '. |
|
1800 |
"/ t2 := b typeIdentifierInList ? ' '. |
|
1801 |
"/ t1 = t2 ifTrue:[ |
|
1802 |
"/ l1 := a label. |
|
1803 |
"/ l2 := b label. |
|
1804 |
"/ l1 = l2 ifTrue:[ |
|
1805 |
"/ (a lineNumber ? 0) < (b lineNumber ? 0) |
|
1806 |
"/ ] ifFalse:[ |
|
1807 |
"/ l1 < l2 |
|
1808 |
"/ ] |
|
1809 |
"/ ] ifFalse:[ |
|
1810 |
"/ t1 < t2 |
|
1811 |
"/ ] |
|
1812 |
"/ ]. |
|
1813 |
"/ ]. |
|
1814 |
||
1815 |
^ [:a :b| a lineNumber < b lineNumber ] |
|
1816 |
||
1817 |
"Created: / 05-05-2011 / 14:37:25 / cg" |
|
9939
b9bfde3e776b
changed: #sortBlockForSortCriteria
Claus Gittinger <cg@exept.de>
parents:
9921
diff
changeset
|
1818 |
"Modified: / 18-06-2011 / 19:30:45 / cg" |
9891 | 1819 |
! |
1820 |
||
1821 |
updateContentsFromFilteredList |
|
1822 |
"call this, if only the sort order has changed (no need to call ctags or filter again)" |
|
1823 |
||
1824 |
|list| |
|
1825 |
||
1826 |
list := filteredList. |
|
1827 |
list notEmptyOrNil ifTrue:[ |
|
1828 |
list := list asSortedCollection:(self sortBlock). |
|
1829 |
]. |
|
1830 |
self contents:(list ? #()). |
|
1831 |
||
1832 |
"Created: / 05-05-2011 / 14:45:41 / cg" |
|
1833 |
! |
|
1834 |
||
1835 |
updateContentsFromRawList |
|
1836 |
"call this, if only the filter has changed (no need to call ctags again)" |
|
1837 |
||
1838 |
filteredList := (filter isEmptyOrNil or:[rawList isNil]) |
|
1839 |
ifTrue:[ rawList ] |
|
1840 |
ifFalse:[ self applyFilterToList:rawList ]. |
|
1841 |
||
1842 |
self updateContentsFromFilteredList |
|
1843 |
||
1844 |
"Modified: / 05-05-2011 / 15:13:14 / cg" |
|
1845 |
! ! |
|
1846 |
||
1847 |
!TagList methodsFor:'queries'! |
|
1848 |
||
1849 |
bestTagForLine:lineNr |
|
1850 |
|bestTag sortedByLineNumber| |
|
1851 |
||
1852 |
sortedByLineNumber := self sortedByLineNumber. |
|
1853 |
self do:[:eachTag | |
|
1854 |
eachTag notNil ifTrue:[ |
|
1855 |
eachTag lineNumber <= lineNr ifTrue:[ |
|
1856 |
bestTag isNil ifTrue:[ |
|
1857 |
bestTag := eachTag. |
|
1858 |
"/ sortedByLineNumber ifTrue:[^ eachTag]. |
|
1859 |
] ifFalse:[ |
|
1860 |
eachTag lineNumber > bestTag lineNumber ifTrue:[ |
|
1861 |
bestTag := eachTag |
|
1862 |
] |
|
1863 |
] |
|
1864 |
]. |
|
1865 |
]. |
|
1866 |
]. |
|
1867 |
||
1868 |
^ bestTag |
|
1869 |
! ! |
|
1870 |
||
1871 |
!TagList methodsFor:'tag generation'! |
|
1872 |
||
1873 |
fromFile:aFile in:aTempDirectory |
|
1874 |
"create tags from a file; |
|
1875 |
either use the ctags/etags command, or an intenral naive, simple method." |
|
1876 |
||
1877 |
|list shellCmd numTags fileContents| |
|
1878 |
||
1879 |
rawList := nil. |
|
1880 |
list := OrderedCollection new. |
|
1881 |
||
1882 |
shellCmd := (self shellCommandFor:aFile pathName). |
|
1883 |
shellCmd isNil ifTrue:[ |
|
12125 | 1884 |
list := self getSimpleTagListFromFile:aFile in:aTempDirectory. |
9891 | 1885 |
] ifFalse:[ |
1886 |
tagTypesPresent := false. "/ will be set again, when ctags command provides types |
|
12125 | 1887 |
list := self getTagListFromFile:aFile usingCommand:shellCmd mode:nil in:aTempDirectory |
9891 | 1888 |
]. |
1889 |
tagTypesPresent := true. |
|
1890 |
||
1891 |
numTags := list size. |
|
1892 |
fileContents := aFile contents. |
|
1893 |
||
1894 |
(numTags > 1 and:[fileContents notEmptyOrNil]) ifTrue:[ |
|
1895 |
numTags to:1 by:-1 do:[:i| |
|
1896 |
|tag lnr| |
|
1897 |
||
1898 |
tag := list at:i ifAbsent:nil. |
|
1899 |
||
1900 |
lnr := tag lineNumberIn:fileContents. |
|
1901 |
lnr == 0 ifTrue:[ |
|
1902 |
list removeIndex:i |
|
1903 |
] ifFalse:[ |
|
1904 |
tag lineNumber:lnr |
|
1905 |
] |
|
1906 |
] |
|
1907 |
]. |
|
1908 |
self setRawList:list. |
|
1909 |
||
12125 | 1910 |
"Modified: / 05-01-2012 / 11:03:29 / cg" |
9891 | 1911 |
! |
1912 |
||
1913 |
fromFile:aFile in:aTempDirectory onTarget:aTarget |
|
1914 |
"create tags from a file; |
|
1915 |
either use the ctags/etags command, or an intenral naive, simple method. |
|
1916 |
" |
|
1917 |
|list| |
|
1918 |
||
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1919 |
remoteTarget := aTarget. |
9891 | 1920 |
|
1921 |
[ |
|
1922 |
list := self fromFile:aFile in:aTempDirectory |
|
1923 |
] valueNowOrOnUnwindDo:[ |
|
9915
923eae65fc70
fixes for reusability in cc browser
Claus Gittinger <cg@exept.de>
parents:
9891
diff
changeset
|
1924 |
remoteTarget := nil. |
9891 | 1925 |
]. |
1926 |
^ list |
|
1927 |
! |
|
1928 |
||
1929 |
getModeFromFileSuffixOf:aFile |
|
1930 |
|suffix mode| |
|
1931 |
||
1932 |
suffix := aFile suffix. |
|
1933 |
(self class isCSuffix:suffix) ifTrue:[ |
|
1934 |
^ #c. |
|
1935 |
]. |
|
1936 |
(self class isCPlusPlusSuffix:suffix) ifTrue:[ |
|
1937 |
^ #c. |
|
1938 |
]. |
|
1939 |
(self class isJavaSuffix:suffix) ifTrue:[ |
|
1940 |
^ #java. |
|
1941 |
]. |
|
1942 |
(self class isFortranSuffix:suffix) ifTrue:[ |
|
1943 |
^ #fortran. |
|
1944 |
]. |
|
1945 |
(self class isEiffelSuffix:suffix) ifTrue:[ |
|
1946 |
^ #eiffel. |
|
1947 |
]. |
|
1948 |
(self class isHTMLSuffix:suffix) ifTrue:[ |
|
1949 |
^ #html. |
|
1950 |
]. |
|
1951 |
^ mode |
|
1952 |
||
1953 |
"Modified: / 20-04-2011 / 19:02:54 / cg" |
|
1954 |
! |
|
1955 |
||
12125 | 1956 |
getTagListFromFile:aFile usingCommand:scmd mode:modeOrNil in:aTempDirectory |
9891 | 1957 |
"create ctags-list from a file, using cmd (which is etags / ctags)" |
1958 |
||
1959 |
|list pipe tag tagFile contents mode infoDictionary| |
|
1960 |
||
12125 | 1961 |
(mode := modeOrNil) isNil ifTrue:[ |
1962 |
mode := self getModeFromFileSuffixOf:aFile. |
|
1963 |
]. |
|
9891 | 1964 |
list := OrderedCollection new:512. |
1965 |
||
1966 |
infoDictionary := Dictionary new. |
|
1967 |
||
1968 |
"/ Transcript showCR:'execute tags command: ', scmd. |
|
1969 |
usingDefaultCTags ifFalse:[ |
|
1970 |
(pipe := PipeStream readingFrom:scmd) notNil ifTrue:[ |
|
1971 |
[ |
|
1972 |
|line atEnd| |
|
1973 |
||
1974 |
atEnd := false. |
|
1975 |
ReadError |
|
1976 |
handle:[:ex | ] |
|
1977 |
do:[ |
|
1978 |
[atEnd] whileFalse:[ |
|
1979 |
(line := pipe nextLine) isNil ifTrue:[ |
|
1980 |
atEnd := pipe atEnd |
|
1981 |
] ifFalse:[ |
|
1982 |
"/ Transcript showCR:line. |
|
1983 |
tag := self tagFromLine:line mode:mode using:infoDictionary. |
|
1984 |
||
1985 |
tag notNil ifTrue:[ |
|
1986 |
list add:tag |
|
1987 |
] |
|
1988 |
] |
|
1989 |
] |
|
1990 |
] |
|
1991 |
] ensure:[pipe close]. |
|
1992 |
]. |
|
1993 |
^ list. |
|
1994 |
]. |
|
1995 |
||
1996 |
(OperatingSystem executeCommand:scmd inDirectory:aTempDirectory) ifTrue:[ |
|
1997 |
tagFile := aTempDirectory construct:'tags'. |
|
1998 |
||
1999 |
tagFile exists ifTrue:[ |
|
2000 |
contents := tagFile contents. |
|
2001 |
||
2002 |
contents notNil ifTrue:[ |
|
2003 |
contents do:[:aLine| |
|
2004 |
(tag := self tagFromLine:aLine mode:mode using:infoDictionary) notNil ifTrue:[list add:tag] |
|
2005 |
] |
|
2006 |
]. |
|
2007 |
Exception |
|
2008 |
handle:[:ex| ] |
|
2009 |
do:[tagFile remove]. |
|
2010 |
]. |
|
2011 |
^ list. |
|
2012 |
]. |
|
2013 |
||
2014 |
scmd = 'ctags' ifFalse:[ |
|
2015 |
"/ try default ctags without any options |
|
12125 | 2016 |
^ self getTagListFromFile:aFile usingCommand:'ctags' mode:modeOrNil in:aTempDirectory |
9891 | 2017 |
]. |
2018 |
^ #() |
|
12125 | 2019 |
|
2020 |
"Created: / 05-01-2012 / 11:03:04 / cg" |
|
9891 | 2021 |
! |
2022 |
||
2023 |
tagFromLine:aLine mode:languageMode using:infoDictionary |
|
2024 |
"analyze the line as returned from ctags and create a corresponding tag object for it" |
|
2025 |
||
2026 |
|stream word1 word2 tagType pattern key |
|
2027 |
file className lineNumber tagClass fmtString fmt |
|
2028 |
showOnly| |
|
2029 |
||
2030 |
"/ Transcript showCR:aLine. |
|
2031 |
aLine size < 6 ifTrue:[ |
|
2032 |
^ nil |
|
2033 |
]. |
|
2034 |
aLine first == $!! ifTrue:[ |
|
2035 |
(aLine startsWith:'!!_TAG_FILE_FORMAT') ifTrue:[ |
|
2036 |
"/ aha - ex. ctags |
|
2037 |
stream := aLine readStream. |
|
2038 |
stream upTo:Character tab. |
|
2039 |
stream skipSeparators. |
|
2040 |
fmtString := stream upTo:Character tab. |
|
2041 |
fmt := Integer readFrom:fmtString onError:nil. |
|
2042 |
fmt notNil ifTrue:[ |
|
2043 |
infoDictionary at:#formatVersion put:fmt |
|
2044 |
] |
|
2045 |
]. |
|
2046 |
^ nil |
|
2047 |
]. |
|
2048 |
||
2049 |
"/ tab separated list; except for the pattern, which might include a tab. |
|
2050 |
stream := aLine readStream. |
|
2051 |
key := stream upTo:Character tab. |
|
2052 |
stream skipSeparators. |
|
2053 |
file := stream upTo:Character tab. |
|
2054 |
stream skipSeparators. |
|
2055 |
stream peek == $/ ifTrue:[ |
|
2056 |
stream next. |
|
2057 |
pattern := stream upTo:$/. |
|
2058 |
[(pattern last) == $\] whileTrue:[ |
|
2059 |
pattern at:(pattern size) put:$/. |
|
2060 |
pattern := pattern , (stream upTo:$/). |
|
2061 |
]. |
|
2062 |
] ifFalse:[ |
|
2063 |
stream peek isDigit ifTrue:[ |
|
2064 |
lineNumber := Integer readFrom:stream onError:nil. |
|
2065 |
lineNumber isNil ifTrue:[ |
|
2066 |
self halt:'should not happen - please debug'. |
|
2067 |
] ifFalse:[ |
|
2068 |
pattern := key. |
|
2069 |
]. |
|
2070 |
] ifFalse:[ |
|
2071 |
self halt:'should not happen - please debug'. |
|
2072 |
]. |
|
2073 |
]. |
|
2074 |
stream peekFor:$;. |
|
2075 |
stream peekFor:$". |
|
2076 |
stream skipSeparators. |
|
2077 |
tagType := stream upTo:Character tab. |
|
2078 |
stream skipSeparators. |
|
2079 |
word1 := stream upTo:Character tab. "/ optional file: (scope) |
|
2080 |
stream skipSeparators. |
|
2081 |
word2 := stream upTo:Character tab. "/ optional class: |
|
2082 |
||
2083 |
(word1 startsWith:'file:') ifTrue:[ "/ file: (scope) |
|
2084 |
hideStatic == true ifTrue:[^ nil]. |
|
2085 |
]. |
|
2086 |
||
2087 |
(word2 startsWith: 'class:') ifTrue:[ |
|
2088 |
className := word2 copyFrom:('class:' size) |
|
2089 |
] ifFalse:[ |
|
2090 |
(word1 startsWith: 'class:') ifTrue:[ |
|
2091 |
className := word1 copyFrom:('class:' size) |
|
2092 |
] |
|
2093 |
]. |
|
2094 |
"/ (word1 startsWith: 'class:') ifTrue:[ |
|
2095 |
"/ className := word1 copyFrom:('class:' size) |
|
2096 |
"/ ]. |
|
2097 |
"/ (word2 startsWith: 'class:') ifTrue:[ |
|
2098 |
"/ className := word2 copyFrom:('class:' size) |
|
2099 |
"/ ]. |
|
2100 |
||
2101 |
tagClass := Tag. |
|
2102 |
tagClass autoload. |
|
2103 |
||
2104 |
"/ typeCharacter to tag-Class mapping... |
|
2105 |
languageMode == #c ifTrue:[ |
|
2106 |
tagType = 'v' ifTrue:[ |
|
2107 |
hideVariables == true ifTrue:[^ nil]. |
|
2108 |
tagClass := Tag::TVariable |
|
2109 |
] ifFalse:[ tagType = 'f' ifTrue:[ |
|
2110 |
hideFunctions == true ifTrue:[^ nil]. |
|
2111 |
tagClass := Tag::TFunction |
|
2112 |
] ifFalse:[ tagType = 'd' ifTrue:[ |
|
2113 |
hideDefines == true ifTrue:[^ nil]. |
|
2114 |
tagClass := Tag::TMacro |
|
2115 |
] ifFalse:[ tagType = 't' ifTrue:[ |
|
2116 |
hideTypedefs == true ifTrue:[^ nil]. |
|
2117 |
tagClass := Tag::TTypedef |
|
2118 |
] ifFalse:[ tagType = 'm' ifTrue:[ |
|
2119 |
hideStructMembers == true ifTrue:[^ nil]. |
|
2120 |
tagClass := Tag::TMember |
|
2121 |
] ifFalse:[ tagType = 's' ifTrue:[ |
|
2122 |
hideStructures == true ifTrue:[^ nil]. |
|
2123 |
tagClass := Tag::TStruct |
|
2124 |
] ifFalse:[ tagType = 'u' ifTrue:[ |
|
2125 |
hideStructures == true ifTrue:[^ nil]. |
|
2126 |
tagClass := Tag::TUnion |
|
2127 |
] ifFalse:[ tagType = 'c' ifTrue:[ |
|
2128 |
hideClasses == true ifTrue:[^ nil]. |
|
2129 |
tagClass := Tag::TClass |
|
2130 |
] ifFalse:[ tagType = 'e' ifTrue:[ |
|
2131 |
tagClass := Tag::TEnumMember. |
|
2132 |
] ifFalse:[ tagType = 'g' ifTrue:[ |
|
2133 |
tagClass := Tag::TEnum. |
|
2134 |
"/ ] ifFalse:[ tagType = 'n' ifTrue:[ |
|
2135 |
"/ tagClass := Tag::TNamespace |
|
2136 |
"/ ] ifFalse:[ tagType = 'p' ifTrue:[ |
|
2137 |
"/ tagClass := Tag::TFunctionPrototype |
|
2138 |
"/ ] ifFalse:[ tagType = 'x' ifTrue:[ |
|
2139 |
"/ tagClass := Tag::TExternVariable |
|
2140 |
] ifFalse:[ |
|
2141 |
"/ add more here |
|
2142 |
]]]]]]]]]] |
|
2143 |
] ifFalse:[ languageMode == #java ifTrue:[ |
|
2144 |
tagType = 'c' ifTrue:[ |
|
2145 |
hideJavaClasses == true ifTrue:[^ nil]. |
|
2146 |
tagClass := Tag::TClass |
|
2147 |
] ifFalse:[ tagType = 'm' ifTrue:[ |
|
2148 |
hideJavaMethods == true ifTrue:[^ nil]. |
|
2149 |
tagClass := Tag::TMethod |
|
2150 |
] ifFalse:[ tagType = 'f' ifTrue:[ |
|
2151 |
hideJavaFields == true ifTrue:[^ nil]. |
|
2152 |
tagClass := Tag::TField |
|
2153 |
] ifFalse:[ tagType = 'i' ifTrue:[ |
|
2154 |
hideJavaInterfaces == true ifTrue:[^ nil]. |
|
2155 |
tagClass := Tag::TInterface |
|
2156 |
] ifFalse:[ tagType = 'p' ifTrue:[ |
|
2157 |
hideJavaPackages == true ifTrue:[^ nil]. |
|
2158 |
tagClass := Tag::TPackage |
|
2159 |
] ifFalse:[ |
|
2160 |
"/ add more here */ |
|
2161 |
]]]]] |
|
2162 |
] ifFalse:[ languageMode == #eiffel ifTrue:[ |
|
2163 |
tagType = 'c' ifTrue:[ |
|
2164 |
hideClasses == true ifTrue:[^ nil]. |
|
2165 |
tagClass := Tag::TClass |
|
2166 |
"/ ] ifFalse:[ tagType = 'f' ifTrue:[ |
|
2167 |
"/ tagClass := Tag::TFeature |
|
2168 |
"/ ] ifFalse:[ tagType = 'l' ifTrue:[ |
|
2169 |
"/ tagClass := Tag::TLocalEntity |
|
2170 |
] ifFalse:[ |
|
2171 |
"/ add more here */ |
|
2172 |
] |
|
2173 |
] ifFalse:[ languageMode == #fortran ifTrue:[ |
|
2174 |
tagType = 'f' ifTrue:[ |
|
2175 |
hideFunctions == true ifTrue:[^ nil]. |
|
2176 |
tagClass := Tag::TFunction |
|
2177 |
] ifFalse:[ tagType = 'i' ifTrue:[ |
|
2178 |
"/ hideInterfaces == true ifTrue:[^ nil]. |
|
2179 |
tagClass := Tag::TInterface |
|
2180 |
] ifFalse:[ tagType = 't' ifTrue:[ |
|
2181 |
hideTypedefs == true ifTrue:[^ nil]. |
|
2182 |
tagClass := Tag::TTypedef |
|
2183 |
"/ ] ifFalse:[ tagType = 'l' ifTrue:[ |
|
2184 |
"/ tagClass := Tag::TLabel |
|
2185 |
"/ ] ifFalse:[ tagType = 'm' ifTrue:[ |
|
2186 |
"/ tagClass := Tag::TModule |
|
2187 |
"/ ] ifFalse:[ tagType = 'n' ifTrue:[ |
|
2188 |
"/ tagClass := Tag::TNameList |
|
2189 |
"/ ] ifFalse:[ tagType = 'p' ifTrue:[ |
|
2190 |
"/ tagClass := Tag::TProgram |
|
2191 |
"/ ] ifFalse:[ tagType = 's' ifTrue:[ |
|
2192 |
"/ tagClass := Tag::TSubroutine |
|
2193 |
"/ ] ifFalse:[ tagType = 'b' ifTrue:[ |
|
2194 |
"/ tagClass := Tag::TBlockData |
|
2195 |
"/ ] ifFalse:[ tagType = 'c' ifTrue:[ |
|
2196 |
"/ tagClass := Tag::TCommonBlock |
|
2197 |
"/ ] ifFalse:[ tagType = 'e' ifTrue:[ |
|
2198 |
"/ tagClass := Tag::TEntryPoint |
|
2199 |
] ifFalse:[ |
|
2200 |
"/ add more here */ |
|
2201 |
]]] |
|
2202 |
]]]]. |
|
2203 |
||
2204 |
tagTypesPresent := true. |
|
2205 |
||
2206 |
tagType size == 0 ifTrue:[ |
|
2207 |
tagType := '' |
|
2208 |
] ifFalse:[ |
|
2209 |
(showOnly := self showOnly) notNil ifTrue:[ |
|
2210 |
showOnly == #classes ifTrue:[ |
|
2211 |
tagClass ~~ Tag::TClass ifTrue:[^ nil]. |
|
2212 |
] ifFalse:[ showOnly == #functions ifTrue:[ |
|
2213 |
tagClass ~~ Tag::TFunction ifTrue:[^ nil]. |
|
2214 |
] ifFalse:[ showOnly == #variables ifTrue:[ |
|
2215 |
tagClass ~~ Tag::TVariable ifTrue:[^ nil]. |
|
2216 |
] ifFalse:[ showOnly == #types ifTrue:[ |
|
2217 |
(tagClass ~~ Tag::TTypedef |
|
2218 |
and:[ true "tagClass ~~ Tag::TUnion" |
|
2219 |
and:[ tagClass ~~ Tag::TStruct ]])ifTrue:[^ nil]. |
|
2220 |
] ifFalse:[ showOnly == #functionsAndVariables ifTrue:[ |
|
2221 |
((tagClass ~~ Tag::TFunction) |
|
2222 |
and:[tagClass ~~ Tag::TVariable]) ifTrue:[^ nil]. |
|
2223 |
] ifFalse:[ showOnly == #classesFunctionsAndVariables ifTrue:[ |
|
2224 |
((tagClass ~~ Tag::TFunction) |
|
2225 |
and:[(tagClass ~~ Tag::TVariable) |
|
2226 |
and:[tagClass ~~ Tag::TClass]]) ifTrue:[^ nil]. |
|
2227 |
] ifFalse:[ showOnly == #defines ifTrue:[ |
|
2228 |
tagClass ~~ Tag::TMacro ifTrue:[^ nil]. |
|
2229 |
] ifFalse:[ showOnly == #structs ifTrue:[ |
|
2230 |
tagClass ~~ Tag::TStruct ifTrue:[^ nil]. |
|
2231 |
] ifFalse:[ showOnly == #everything ifTrue:[ |
|
2232 |
] ifFalse:[ |
|
2233 |
self halt:'unhandled showOnly'. |
|
2234 |
]]]]]]]]] |
|
2235 |
] |
|
2236 |
]. |
|
2237 |
||
2238 |
^ tagClass label:key |
|
2239 |
pattern:pattern |
|
2240 |
type:tagType |
|
2241 |
lineNumber:lineNumber |
|
2242 |
className:className. |
|
2243 |
||
2244 |
"Modified: / 05-05-2011 / 15:45:55 / cg" |
|
2245 |
! ! |
|
2246 |
||
2247 |
!TagList methodsFor:'tag generation - simple'! |
|
2248 |
||
2249 |
assemblerTagsInFile:aFilePath |
|
2250 |
"assembler tags: |
|
2251 |
naive, q&d scan for lines matching: |
|
2252 |
<anything>: |
|
2253 |
CAVEAT: |
|
2254 |
the code below handles linux-i386 assembler only (for now) |
|
2255 |
" |
|
2256 |
||
2257 |
|targets line l lineNr nm s words w directive |
|
12229 | 2258 |
hideLocals hideLocals2 hideData hideText currentSegment| |
9891 | 2259 |
|
2260 |
Tag autoload. |
|
2261 |
||
2262 |
targets := OrderedCollection new. |
|
2263 |
s := aFilePath asFilename readStream. |
|
2264 |
s notNil ifTrue:[ |
|
9921 | 2265 |
hideLocals := hideLocalLabels ? false. |
12229 | 2266 |
hideLocals2 := hideLocalLabels2 ? false. |
9921 | 2267 |
hideData := hideDataLabels ? false. |
2268 |
hideText := hideTextLabels ? false. |
|
9891 | 2269 |
currentSegment := #text. |
2270 |
||
2271 |
s := LineNumberReadStream readingFrom:s. |
|
2272 |
[s atEnd] whileFalse:[ |
|
2273 |
lineNr := s lineNumber. |
|
2274 |
line := s nextLine. |
|
2275 |
l := line withoutSeparators. |
|
2276 |
words := l asCollectionOfWords. |
|
2277 |
words size >= 1 ifTrue:[ |
|
2278 |
w := words first. |
|
2279 |
(w endsWith:$:) ifTrue:[ |
|
2280 |
(hideText and:[currentSegment == #text]) ifFalse:[ |
|
2281 |
(hideData and:[currentSegment == #data]) ifFalse:[ |
|
2282 |
(hideLocals and:[(w startsWith:$.)]) ifFalse:[ |
|
12229 | 2283 |
(hideLocals2 and:[(w startsWith:$_) not]) ifFalse:[ |
2284 |
nm := w copyWithoutLast:1. |
|
2285 |
targets add:(Tag::TLabel |
|
2286 |
label:nm |
|
2287 |
pattern:nil |
|
2288 |
type:nil |
|
2289 |
lineNumber:lineNr). |
|
2290 |
]. |
|
9891 | 2291 |
]. |
2292 |
]. |
|
2293 |
]. |
|
2294 |
words size >= 2 ifTrue:[ |
|
2295 |
directive := words second |
|
2296 |
] ifFalse:[ |
|
2297 |
directive := nil. |
|
2298 |
] |
|
2299 |
] ifFalse:[ |
|
2300 |
directive := w. |
|
2301 |
]. |
|
2302 |
(directive notNil and:[directive startsWith:$.]) ifTrue:[ |
|
2303 |
directive = '.text' ifTrue:[ |
|
2304 |
currentSegment := #text |
|
2305 |
] ifFalse:[ directive = '.data' ifTrue:[ |
|
2306 |
currentSegment := #data |
|
2307 |
] ifFalse:[ directive = '.bss' ifTrue:[ |
|
2308 |
currentSegment := #data |
|
2309 |
] ifFalse:[ directive = '.rodata' ifTrue:[ |
|
2310 |
currentSegment := #data |
|
2311 |
]]]] |
|
2312 |
] |
|
2313 |
] |
|
2314 |
]. |
|
2315 |
s close |
|
2316 |
]. |
|
2317 |
^ targets |
|
2318 |
||
12229 | 2319 |
"Modified: / 24-03-2012 / 23:24:22 / cg" |
9891 | 2320 |
! |
2321 |
||
12125 | 2322 |
getSimpleTagListFromFile:aFileOrString in:aTempDirectory |
9891 | 2323 |
"fallback, if no ctags is present, or if the file is not a c-file. |
2324 |
Implemented here for some other file types (Makefiles) |
|
2325 |
" |
|
12125 | 2326 |
|file lcName pathName suffix| |
2327 |
||
2328 |
file := aFileOrString asFilename. |
|
2329 |
lcName := file baseName asLowercase. |
|
2330 |
pathName := file pathName. |
|
2331 |
||
9891 | 2332 |
self class makeFilePatterns do:[:aPattern | |
2333 |
(aPattern match:lcName) ifTrue:[ |
|
2334 |
^ self class makeTargetTagsInFile:pathName filter:showOnly |
|
2335 |
] |
|
2336 |
]. |
|
2337 |
||
2338 |
suffix := lcName asFilename suffix. |
|
2339 |
||
2340 |
(self class isSmalltalkSuffix:suffix) ifTrue:[ |
|
2341 |
"/ smalltalk tags - simulated |
|
12125 | 2342 |
^ self stTagsInFile:pathName in:aTempDirectory |
9891 | 2343 |
]. |
2344 |
(self class isPythonSuffix:suffix) ifTrue:[ |
|
2345 |
"/ python tags - simulated |
|
2346 |
^ self pythonTagsInFile:pathName |
|
2347 |
]. |
|
2348 |
(self class isPhpSuffix:suffix) ifTrue:[ |
|
2349 |
"/ php tags - simulated |
|
2350 |
^ self phpTagsInFile:pathName |
|
2351 |
]. |
|
2352 |
(self class isLispSuffix:suffix) ifTrue:[ |
|
2353 |
"/ lisp tags - simulated |
|
2354 |
^ self lispTagsInFile:pathName |
|
2355 |
]. |
|
2356 |
(self class isOzSuffix:suffix) ifTrue:[ |
|
2357 |
"/ oz tags - simulated |
|
2358 |
^ self ozTagsInFile:pathName |
|
2359 |
]. |
|
2360 |
(self class isPrologSuffix:suffix) ifTrue:[ |
|
2361 |
"/ prolog tags - simulated |
|
2362 |
^ self prologTagsInFile:pathName |
|
2363 |
]. |
|
2364 |
(self class isTCLSuffix:suffix) ifTrue:[ |
|
2365 |
"/ tcl tags - simulated |
|
2366 |
^ self tclTagsInFile:pathName |
|
2367 |
]. |
|
2368 |
(self class isAssemblerSuffix:suffix) ifTrue:[ |
|
2369 |
"/ assembler tags - simulated |
|
2370 |
^ self assemblerTagsInFile:pathName |
|
2371 |
]. |
|
2372 |
(self class isRubySuffix:suffix) ifTrue:[ |
|
2373 |
"/ ruby tags - simulated |
|
2374 |
^ self rubyTagsInFile:pathName |
|
2375 |
]. |
|
2376 |
(self class isYaccSuffix:suffix) ifTrue:[ |
|
2377 |
"/ yacc tags - simulated |
|
2378 |
^ self yaccTagsInFile:pathName |
|
2379 |
]. |
|
2380 |
(self class isJavaScriptSuffix:suffix) ifTrue:[ |
|
2381 |
"/ js tags - simulated |
|
2382 |
^ self javaScriptTagsInFile:pathName |
|
2383 |
]. |
|
2384 |
||
2385 |
(self class isHTMLSuffix:suffix) ifTrue:[ |
|
2386 |
"/ html tags - simulated |
|
2387 |
^ self htmlTagsInFile:pathName |
|
2388 |
]. |
|
2389 |
||
2390 |
"/ could add more here ... |
|
2391 |
^ nil. |
|
2392 |
||
12125 | 2393 |
"Created: / 05-01-2012 / 10:55:03 / cg" |
9891 | 2394 |
! |
2395 |
||
2396 |
htmlTagsInFile:aFilePath |
|
2397 |
"hatml tags: |
|
2398 |
naive, q&d scan for lines containing with: |
|
2399 |
<textarea> |
|
2400 |
<input> |
|
2401 |
<table> |
|
2402 |
<script> |
|
2403 |
" |
|
2404 |
||
2405 |
|targets line l lineNr s tag| |
|
2406 |
||
2407 |
"/ TODO: use HTMPParser to read all of them !! |
|
2408 |
||
2409 |
Tag autoload. |
|
2410 |
||
2411 |
targets := OrderedCollection new. |
|
2412 |
s := aFilePath asFilename readStream. |
|
2413 |
s notNil ifTrue:[ |
|
2414 |
s := LineNumberReadStream readingFrom:s. |
|
2415 |
[s atEnd] whileFalse:[ |
|
2416 |
lineNr := s lineNumber. |
|
2417 |
line := s nextLine. |
|
9918 | 2418 |
line := line withoutSeparators. |
2419 |
l := line asLowercase. |
|
9891 | 2420 |
|
2421 |
#( |
|
2422 |
'textarea' hideHTMLTextArea |
|
2423 |
'input' hideHTMLInput |
|
2424 |
'table' hideHTMLTable |
|
2425 |
'script' hideHTMLScript |
|
9918 | 2426 |
'form' hideHTMLForm |
9891 | 2427 |
) pairWiseDo:[:nm :hideInstVarName| |
2428 |
|type hideHolder idx tagText doc markup label| |
|
2429 |
||
2430 |
type := hideHolder := nil. |
|
2431 |
||
2432 |
idx := l indexOfSubCollection:('<',nm). |
|
2433 |
idx ~~ 0 ifTrue:[ |
|
2434 |
type := Tag::TElement. |
|
2435 |
hideHolder := self instVarNamed:hideInstVarName. |
|
2436 |
||
9918 | 2437 |
tagText := line copyFrom:idx. |
9891 | 2438 |
doc := HTMLParser new parseText:tagText. |
2439 |
markup := doc markup. |
|
2440 |
markup id notEmptyOrNil ifTrue:[ |
|
2441 |
label := nm , ' (',markup id,')' |
|
2442 |
] ifFalse:[ |
|
2443 |
markup name notEmptyOrNil ifTrue:[ |
|
2444 |
label := nm , ' (',markup name,')' |
|
2445 |
] ifFalse:[ |
|
9918 | 2446 |
(markup type == #input and:[ markup valueString notEmptyOrNil ]) ifTrue:[ |
2447 |
label := nm , ' (',markup valueString,')' |
|
2448 |
] ifFalse:[ |
|
2449 |
(markup type == #script and:[ markup src notEmptyOrNil ]) ifTrue:[ |
|
2450 |
label := nm , ' ("',markup src,'")' |
|
2451 |
] ifFalse:[ |
|
2452 |
label := nm |
|
2453 |
] |
|
2454 |
] |
|
9891 | 2455 |
]. |
2456 |
]. |
|
2457 |
||
2458 |
||
2459 |
hideHolder value ~~ true ifTrue:[ |
|
2460 |
tag := type |
|
2461 |
label:label |
|
2462 |
pattern:nil |
|
2463 |
type:nil |
|
2464 |
lineNumber:lineNr. |
|
2465 |
targets add:tag. |
|
2466 |
] |
|
2467 |
]. |
|
2468 |
]. |
|
2469 |
]. |
|
2470 |
s close |
|
2471 |
]. |
|
2472 |
^ targets |
|
2473 |
||
2474 |
"Created: / 20-04-2011 / 18:59:29 / cg" |
|
9918 | 2475 |
"Modified: / 07-05-2011 / 17:04:53 / cg" |
9891 | 2476 |
! |
2477 |
||
2478 |
javaScriptTagsInFile:aFilePath |
|
2479 |
"javaScript tags: |
|
2480 |
naive, q&d scan for lines matching: |
|
2481 |
(function foo |
|
2482 |
" |
|
2483 |
||
2484 |
|targets line l lineNr nm s| |
|
2485 |
||
2486 |
Tag autoload. |
|
2487 |
||
2488 |
targets := OrderedCollection new. |
|
2489 |
s := aFilePath asFilename readStream. |
|
2490 |
s notNil ifTrue:[ |
|
2491 |
s := LineNumberReadStream readingFrom:s. |
|
2492 |
[s atEnd] whileFalse:[ |
|
2493 |
lineNr := s lineNumber. |
|
2494 |
line := s nextLine. |
|
2495 |
l := line withoutSeparators. |
|
2496 |
||
2497 |
(l startsWith:'function ') ifTrue:[ |
|
2498 |
(showOnly isNil or:[showOnly == #functions]) ifTrue:[ |
|
9921 | 2499 |
hideFunctions ~~ true ifTrue:[ |
9891 | 2500 |
nm := l copyFrom:('function ' size + 1). |
2501 |
nm := nm copyTo:(nm |
|
2502 |
findFirst:[:ch | (ch isLetterOrDigit or:['$_' includes:ch]) not] |
|
2503 |
ifNone:nm size+1)-1. |
|
2504 |
targets add:(Tag::TFunction |
|
2505 |
label:nm |
|
2506 |
pattern:nil |
|
2507 |
type:nil |
|
2508 |
lineNumber:lineNr). |
|
2509 |
] |
|
2510 |
] |
|
2511 |
] ifFalse:[ |
|
2512 |
(l startsWith:'var ') ifTrue:[ |
|
2513 |
(showOnly isNil or:[showOnly == #variables]) ifTrue:[ |
|
9921 | 2514 |
hideVariables ~~ true ifTrue:[ |
9891 | 2515 |
nm := l copyFrom:('var ' size + 1). |
2516 |
nm := nm copyTo:(nm |
|
2517 |
findFirst:[:ch | (ch isLetterOrDigit or:['$_' includes:ch]) not] |
|
2518 |
ifNone:nm size+1)-1. |
|
2519 |
targets add:(Tag::TVariable |
|
2520 |
label:nm |
|
2521 |
pattern:nil |
|
2522 |
type:nil |
|
2523 |
lineNumber:lineNr). |
|
2524 |
]. |
|
2525 |
]. |
|
2526 |
]. |
|
2527 |
] |
|
2528 |
]. |
|
2529 |
s close |
|
2530 |
]. |
|
2531 |
^ targets |
|
2532 |
||
2533 |
"Created: / 28-06-2010 / 12:44:25 / cg" |
|
9921 | 2534 |
"Modified: / 08-05-2011 / 10:39:55 / cg" |
9891 | 2535 |
! |
2536 |
||
2537 |
lispTagFromLine:line lineNr:lineNr |
|
2538 |
"lisp tags: |
|
2539 |
naive, q&d scan for lines starting with (not syntax-aware): |
|
2540 |
(define ... |
|
2541 |
(defun ... |
|
2542 |
(defvar ... |
|
2543 |
(defmacro ... |
|
2544 |
(defclass ... |
|
2545 |
(defmethod ... |
|
2546 |
(defpackage ... |
|
2547 |
(eval-when ... |
|
2548 |
(define- ... |
|
2549 |
(def* ... |
|
2550 |
(set ... |
|
2551 |
(constant ... |
|
2552 |
(defconstant ... |
|
9921 | 2553 |
;;; more documentation |
9891 | 2554 |
" |
2555 |
||
9921 | 2556 |
|l nm words def arg inParens rest| |
9891 | 2557 |
|
2558 |
l := line withoutSeparators. |
|
2559 |
||
9921 | 2560 |
(l startsWith:'(') ifFalse:[ |
2561 |
(showOnly notNil and:[showOnly ~~ #documentation]) ifTrue:[^ nil]. |
|
2562 |
hideDocumentation == true ifTrue:[ ^ nil ]. |
|
2563 |
||
2564 |
(l startsWith:';;;') ifFalse:[^ nil]. |
|
2565 |
rest := (l copyFrom:4) withoutSeparators. |
|
2566 |
rest isEmpty ifTrue:[^ nil]. |
|
2567 |
^ Tag::TDocumentation |
|
2568 |
label:(rest colorizeAllWith:(Color blue "grey")) |
|
2569 |
pattern:nil |
|
2570 |
type:nil |
|
2571 |
lineNumber:lineNr. |
|
2572 |
]. |
|
9891 | 2573 |
|
2574 |
words := (l copyFrom:2) asCollectionOfWords. |
|
2575 |
words size >= 2 ifFalse:[^ nil]. |
|
2576 |
||
2577 |
def := words first. |
|
2578 |
nm := words second. |
|
2579 |
(inParens := nm startsWith:'(') ifTrue:[ |
|
2580 |
nm := nm copyFrom:2. |
|
2581 |
] ifFalse:[ |
|
2582 |
nm := nm upTo:$(. "/ in case it is (define foo() - without space after name |
|
2583 |
arg := l copyFrom:(l indexOf:$( startingAt:2 ifAbsent:2). |
|
2584 |
(inParens := nm startsWith:'(') ifTrue:[ |
|
2585 |
nm := nm copyFrom:2. |
|
2586 |
]. |
|
2587 |
]. |
|
2588 |
(nm endsWith:')') ifTrue:[ |
|
2589 |
nm := nm copyWithoutLast:1 |
|
2590 |
]. |
|
2591 |
||
2592 |
def = 'defun' ifTrue:[ |
|
2593 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
9921 | 2594 |
hideFunctions == true ifTrue:[ ^ nil ]. |
9891 | 2595 |
^ Tag::TFunction |
2596 |
label:nm |
|
2597 |
pattern:nil |
|
2598 |
type:nil |
|
2599 |
lineNumber:lineNr. |
|
2600 |
]. |
|
2601 |
def = 'define' ifTrue:[ "/ scheme |
|
2602 |
inParens ifTrue:[ |
|
2603 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
9921 | 2604 |
hideFunctions == true ifTrue:[ ^ nil ]. |
9891 | 2605 |
^ Tag::TFunction |
2606 |
label:nm |
|
2607 |
pattern:nil |
|
2608 |
type:nil |
|
2609 |
lineNumber:lineNr. |
|
2610 |
] ifFalse:[ |
|
2611 |
(showOnly notNil and:[showOnly ~~ #variables]) ifTrue:[^ nil]. |
|
9921 | 2612 |
hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 2613 |
^ Tag::TVariable |
2614 |
label:nm |
|
2615 |
pattern:nil |
|
2616 |
type:nil |
|
2617 |
lineNumber:lineNr. |
|
2618 |
]. |
|
2619 |
^ nil |
|
2620 |
]. |
|
2621 |
||
2622 |
def = 'defvar' ifTrue:[ |
|
2623 |
(showOnly notNil and:[showOnly ~~ #variables]) ifTrue:[^ nil]. |
|
9921 | 2624 |
hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 2625 |
^ Tag::TVariable |
2626 |
label:nm |
|
2627 |
pattern:nil |
|
2628 |
type:nil |
|
2629 |
lineNumber:lineNr. |
|
2630 |
]. |
|
2631 |
def = 'set' ifTrue:[ |
|
9921 | 2632 |
hideVariables == true ifTrue:[ ^ nil ]. |
9891 | 2633 |
^ Tag::TVariable |
2634 |
label:nm |
|
2635 |
pattern:nil |
|
2636 |
type:nil |
|
2637 |
lineNumber:lineNr. |
|
2638 |
]. |
|
2639 |
(def = 'defconstant' or:[def = 'constant']) ifTrue:[ |
|
2640 |
(showOnly notNil and:[showOnly ~~ #constants]) ifTrue:[^ nil]. |
|
9921 | 2641 |
hideLispConstants == true ifTrue:[ ^ nil ]. |
9891 | 2642 |
^ Tag::TLispConstant |
2643 |
label:nm |
|
2644 |
pattern:nil |
|
2645 |
type:nil |
|
2646 |
lineNumber:lineNr. |
|
2647 |
]. |
|
2648 |
(def = 'mac' or:[def = 'defmacro' or:[def = 'define-macro']]) ifTrue:[ |
|
2649 |
(showOnly notNil and:[showOnly ~~ #macros]) ifTrue:[^ nil]. |
|
9921 | 2650 |
hideLispMacros == true ifTrue:[ ^ nil ]. |
9891 | 2651 |
^ Tag::TLispMacro |
2652 |
label:nm |
|
2653 |
pattern:nil |
|
2654 |
type:nil |
|
2655 |
lineNumber:lineNr. |
|
2656 |
]. |
|
2657 |
(def = 'defclass' or:[def = 'define-class']) ifTrue:[ |
|
2658 |
(showOnly notNil and:[showOnly ~~ #classes]) ifTrue:[^ nil]. |
|
9921 | 2659 |
hideClasses == true ifTrue:[ ^ nil ]. |
9891 | 2660 |
^ Tag::TClass |
2661 |
label:nm |
|
2662 |
pattern:nil |
|
2663 |
type:nil |
|
2664 |
lineNumber:lineNr. |
|
2665 |
]. |
|
2666 |
(def = 'defmethod' or:[def = 'define-method' or:[def = 'define-generic']]) ifTrue:[ |
|
2667 |
(showOnly notNil and:[showOnly ~~ #methods]) ifTrue:[^ nil]. |
|
9921 | 2668 |
hideLispMethods == true ifTrue:[ ^ nil ]. |
9891 | 2669 |
^ Tag::TMethod |
2670 |
label:nm |
|
2671 |
pattern:nil |
|
2672 |
type:nil |
|
2673 |
lineNumber:lineNr. |
|
2674 |
]. |
|
2675 |
(def = 'defpackage') ifTrue:[ |
|
9921 | 2676 |
hideLispMethods == true ifTrue:[ ^ nil ]. |
9891 | 2677 |
^ Tag::TPackage |
2678 |
label:nm |
|
2679 |
pattern:nil |
|
2680 |
type:nil |
|
2681 |
lineNumber:lineNr. |
|
2682 |
]. |
|
2683 |
def = 'eval-when' ifTrue:[ |
|
9921 | 2684 |
hideLispEvaluations == true ifTrue:[ ^ nil ]. |
9891 | 2685 |
^ Tag::TLispEval |
2686 |
label:arg |
|
2687 |
pattern:nil |
|
2688 |
type:nil |
|
2689 |
lineNumber:lineNr. |
|
2690 |
]. |
|
2691 |
def = 'defstruct' ifTrue:[ |
|
9921 | 2692 |
hideStructures == true ifTrue:[ ^ nil ]. |
9891 | 2693 |
^ Tag::TStruct |
2694 |
label:nm |
|
2695 |
pattern:nil |
|
2696 |
type:nil |
|
2697 |
lineNumber:lineNr. |
|
2698 |
]. |
|
2699 |
(def startsWith:'def') ifTrue:[ |
|
2700 |
(showOnly notNil and:[showOnly ~~ #functions]) ifTrue:[^ nil]. |
|
9921 | 2701 |
hideFunctions == true ifTrue:[ ^ nil ]. |
9891 | 2702 |
^ Tag::TFunction |
2703 |
label:nm |
|
2704 |
pattern:nil |
|
2705 |
type:nil |
|
2706 |
lineNumber:lineNr. |
|
2707 |
]. |
|
2708 |
^ nil |
|
2709 |
||
9921 | 2710 |
"Modified: / 08-05-2011 / 10:57:03 / cg" |
9891 | 2711 |
! |
2712 |
||
2713 |
lispTagsInFile:aFilePath |
|
2714 |
"lisp tags: |
|
2715 |
naive, q&d scan for lines starting with (not syntax-aware): |
|
2716 |
(define ... |
|
2717 |
(defun ... |
|
2718 |
(defvar ... |
|
2719 |
(defmacro ... |
|
2720 |
(defclass ... |
|
2721 |
(defmethod ... |
|
2722 |
(defpackage ... |
|
2723 |
(eval-when ... |
|
2724 |
(define- ... |
|
2725 |
(def* ... |
|
2726 |
(set ... |
|
2727 |
(constant ... |
|
2728 |
(defconstant ... |
|
9921 | 2729 |
;;; moretext documentation |
9891 | 2730 |
" |
2731 |
||
2732 |
|targets line lineNr s tag| |
|
2733 |
||
2734 |
Tag autoload. |
|
2735 |
||
2736 |
targets := OrderedCollection new. |
|
2737 |
s := aFilePath asFilename readStream. |
|
2738 |
s notNil ifTrue:[ |
|
2739 |
s := LineNumberReadStream readingFrom:s. |
|
2740 |
[s atEnd] whileFalse:[ |
|
2741 |
lineNr := s lineNumber. |
|
2742 |
line := s nextLine. |
|
2743 |
||
2744 |
tag := self lispTagFromLine:line lineNr:lineNr. |
|
2745 |
tag notNil ifTrue:[ |
|
2746 |
targets add:tag |
|
2747 |
]. |
|
2748 |
]. |
|
2749 |
s close |
|
2750 |
]. |
|
2751 |
^ targets |
|
2752 |
||
9921 | 2753 |
"Modified: / 08-05-2011 / 10:12:29 / cg" |
9891 | 2754 |
! |
2755 |
||
2756 |
ozTagsInFile:aFilePath |
|
2757 |
"oz tags: |
|
2758 |
naive, q&d scan for lines starting with: |
|
2759 |
fun { name ... |
|
2760 |
" |
|
2761 |
||
2762 |
|targets line l lineNr nm s tag lineStream kwLen skipBrace type hideHolder| |
|
2763 |
||
2764 |
Tag autoload. |
|
2765 |
||
2766 |
targets := OrderedCollection new. |
|
2767 |
s := aFilePath asFilename readStream. |
|
2768 |
s notNil ifTrue:[ |
|
2769 |
s := LineNumberReadStream readingFrom:s. |
|
2770 |
[s atEnd] whileFalse:[ |
|
2771 |
lineNr := s lineNumber. |
|
2772 |
line := s nextLine. |
|
2773 |
l := line withoutSeparators. |
|
2774 |
||
2775 |
kwLen := nil. |
|
2776 |
skipBrace := false. |
|
2777 |
||
2778 |
(l startsWith:'class') ifTrue:[ |
|
2779 |
kwLen := 5. |
|
2780 |
type := Tag::TClass. |
|
2781 |
hideHolder := hideOzClasses. |
|
2782 |
]. |
|
2783 |
(l startsWith:'meth') ifTrue:[ |
|
2784 |
kwLen := 4. |
|
2785 |
type := Tag::TMethod. |
|
2786 |
hideHolder := hideOzMethods. |
|
2787 |
]. |
|
2788 |
(l startsWith:'fun') ifTrue:[ |
|
2789 |
kwLen := 3. |
|
2790 |
skipBrace := true. |
|
2791 |
type := Tag::TFunction. |
|
2792 |
hideHolder := hideOzFunctions. |
|
2793 |
]. |
|
2794 |
(l startsWith:'proc') ifTrue:[ |
|
2795 |
kwLen := 4. |
|
2796 |
skipBrace := true. |
|
2797 |
type := Tag::TFunction. |
|
2798 |
hideHolder := hideOzFunctions. |
|
2799 |
]. |
|
2800 |
hideHolder value ~~ true ifTrue:[ |
|
2801 |
kwLen notNil ifTrue:[ |
|
2802 |
lineStream := l readStream. |
|
2803 |
lineStream skip:kwLen; skipSeparators. |
|
2804 |
||
2805 |
(skipBrace not or:[lineStream peek = ${ ]) ifTrue:[ |
|
2806 |
skipBrace ifTrue:[lineStream skip:1; skipSeparators]. |
|
2807 |
nm := lineStream upToMatching:[:ch | (ch isLetterOrDigit or:['_' includes:ch]) not]. |
|
2808 |
(nm notEmpty and:[nm first isLetter or:[nm first = $_]]) ifTrue:[ |
|
2809 |
tag := type |
|
2810 |
label:nm |
|
2811 |
pattern:nil |
|
2812 |
type:nil |
|
2813 |
lineNumber:lineNr. |
|
2814 |
targets add:tag. |
|
2815 |
] |
|
2816 |
] |
|
2817 |
]. |
|
2818 |
] |
|
2819 |
]. |
|
2820 |
s close |
|
2821 |
]. |
|
2822 |
^ targets |
|
2823 |
! |
|
2824 |
||
2825 |
phpTagsInFile:aFilePath |
|
2826 |
"php tags: |
|
2827 |
naive, q&d scan for lines starting with: |
|
2828 |
var ... |
|
2829 |
class ... |
|
2830 |
function ... |
|
2831 |
" |
|
2832 |
||
2833 |
|targets line l lineNr nm s lineStream| |
|
2834 |
||
2835 |
Tag autoload. |
|
2836 |
||
2837 |
targets := OrderedCollection new. |
|
2838 |
s := aFilePath asFilename readStream. |
|
2839 |
s notNil ifTrue:[ |
|
2840 |
s := LineNumberReadStream readingFrom:s. |
|
2841 |
[s atEnd] whileFalse:[ |
|
2842 |
lineNr := s lineNumber. |
|
2843 |
line := s nextLine. |
|
2844 |
l := line withoutSeparators. |
|
2845 |
||
2846 |
(l startsWith:'var ') ifTrue:[ |
|
2847 |
lineStream := (l copyFrom:4) readStream. |
|
2848 |
lineStream skipSeparators. |
|
2849 |
lineStream peek == $$ ifTrue:[ |
|
2850 |
lineStream next. |
|
2851 |
nm := lineStream |
|
2852 |
nextMatching:[:c | c isLetter] |
|
2853 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
|
2854 |
targets add:(Tag::TVariable |
|
2855 |
label:nm |
|
2856 |
pattern:nil |
|
2857 |
type:nil |
|
2858 |
lineNumber:lineNr). |
|
2859 |
] |
|
2860 |
] ifFalse:[ |
|
2861 |
(l startsWith:'class ') ifTrue:[ |
|
2862 |
lineStream := (l copyFrom:6) readStream. |
|
2863 |
lineStream skipSeparators. |
|
2864 |
nm := lineStream |
|
2865 |
nextMatching:[:c | c isLetter] |
|
2866 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
|
2867 |
targets add:(Tag::TClass |
|
2868 |
label:nm |
|
2869 |
pattern:nil |
|
2870 |
type:nil |
|
2871 |
lineNumber:lineNr). |
|
2872 |
] ifFalse:[ |
|
2873 |
(l startsWith:'function ') ifTrue:[ |
|
2874 |
lineStream := (l copyFrom:9) readStream. |
|
2875 |
lineStream skipSeparators. |
|
2876 |
nm := lineStream |
|
2877 |
nextMatching:[:c | c isLetter] |
|
2878 |
thenMatching:[:c | c isLetterOrDigit or:[c == $_]]. |
|
2879 |
targets add:(Tag::TFunction |
|
2880 |
label:nm |
|
2881 |
pattern:nil |
|
2882 |
type:nil |
|
2883 |
lineNumber:lineNr). |
|
2884 |
]. |
|
2885 |
]. |
|
2886 |
]. |
|
2887 |
]. |
|
2888 |
s close |
|
2889 |
]. |
|
2890 |
^ targets |
|
2891 |
! |
|
2892 |
||
2893 |
prologTagsInFile:aFilePath |
|
2894 |
"prolog tags: |
|
2895 |
naive, q&d scan for lines matching: |
|
2896 |
<anything> :- |
|
2897 |
" |
|
2898 |
||
2899 |
|targets line l lineNr nm s| |
|
2900 |
||
2901 |
Tag autoload. |
|
2902 |
||
2903 |
targets := OrderedCollection new. |
|
2904 |
s := aFilePath asFilename readStream. |
|
2905 |
s notNil ifTrue:[ |
|
2906 |
s := LineNumberReadStream readingFrom:s. |
|
2907 |
[s atEnd] whileFalse:[ |
|
2908 |
lineNr := s lineNumber. |
|
2909 |
line := s nextLine. |
|
2910 |
l := line withoutSeparators. |
|
2911 |
||
2912 |
(l includesString:':-') ifTrue:[ |
|
2913 |
(l startsWith:':-') ifFalse:[ |
|
2914 |
nm := l copyTo:(l indexOfSubCollection:':-'). |
|
2915 |
targets add:(Tag::TPrologClause |
|
2916 |
label:nm |
|
2917 |
pattern:nil |
|
2918 |
type:nil |
|
2919 |
lineNumber:lineNr). |
|
2920 |
] |
|
2921 |
] |
|
2922 |
]. |
|
2923 |
s close |
|
2924 |
]. |
|
2925 |
^ targets |
|
2926 |
||
2927 |
||
2928 |
||
2929 |
||
2930 |
||
2931 |
! |
|
2932 |
||
2933 |
pythonTagsInFile:aFilePath |
|
2934 |
"python tags: |
|
2935 |
naive, q&d scan for lines matching |
|
2936 |
class <anything> : |
|
2937 |
or |
|
2938 |
def <anything> : |
|
2939 |
" |
|
2940 |
||
2941 |
|targets line l lineNr nm s inClass indent classIndent| |
|
2942 |
||
2943 |
Tag autoload. |
|
2944 |
||
2945 |
inClass := nil. |
|
2946 |
targets := OrderedCollection new. |
|
2947 |
s := aFilePath asFilename readStream. |
|
2948 |
inClass := OrderedCollection new. |
|
2949 |
classIndent := 0. |
|
2950 |
||
2951 |
s notNil ifTrue:[ |
|
2952 |
s := LineNumberReadStream readingFrom:s. |
|
2953 |
[s atEnd] whileFalse:[ |
|
2954 |
lineNr := s lineNumber. |
|
2955 |
line := s nextLine. |
|
2956 |
l := line withoutSeparators. |
|
2957 |
l size > 0 ifTrue:[ |
|
2958 |
||
2959 |
line := line withTabsExpanded:8. |
|
2960 |
indent := line findFirst:[:c | c ~~ Character space]. |
|
2961 |
indent := indent // 8. |
|
2962 |
indent < classIndent ifTrue:[ |
|
2963 |
inClass removeFirstIfAbsent:nil. |
|
2964 |
classIndent := classIndent - 1. |
|
2965 |
]. |
|
2966 |
||
2967 |
(l startsWith:'class ') ifTrue:[ |
|
2968 |
(l endsWith:':') ifTrue:[ |
|
2969 |
nm := l copyFrom:7 to:(l size - 1). |
|
2970 |
nm := nm withoutSeparators. |
|
2971 |
(showOnly ~~ #pythonFunctions |
|
2972 |
and:[showOnly ~~ #pythonMethods]) ifTrue:[ |
|
9921 | 2973 |
hidePythonClasses ~~ true ifTrue:[ |
9891 | 2974 |
targets add:(Tag::TClass |
2975 |
label:nm |
|
2976 |
pattern:nil |
|
2977 |
type:nil |
|
2978 |
lineNumber:lineNr). |
|
2979 |
]. |
|
2980 |
]. |
|
2981 |
nm := nm upTo:$(. |
|
2982 |
inClass addFirst:nm. |
|
2983 |
classIndent := indent + 1. |
|
2984 |
] |
|
2985 |
] ifFalse:[ |
|
2986 |
(l startsWith:'def ') ifTrue:[ |
|
2987 |
(l endsWith:':') ifTrue:[ |
|
2988 |
nm := l copyFrom:5 to:(l size - 1). |
|
2989 |
nm := nm withoutSeparators. |
|
2990 |
||
2991 |
inClass size > 0 ifTrue:[ |
|
2992 |
(showOnly ~~ #pythonFunctions |
|
2993 |
and:[showOnly ~~ #pythonClasses]) ifTrue:[ |
|
9921 | 2994 |
hidePythonMethods ~~ true ifTrue:[ |
9891 | 2995 |
nm := inClass first , '.' , nm. |
2996 |
targets add:(Tag::TMethod |
|
2997 |
label:nm |
|
2998 |
pattern:nil |
|
2999 |
type:nil |
|
3000 |
lineNumber:lineNr). |
|
3001 |
] |
|
3002 |
] |
|
3003 |
] ifFalse:[ |
|
3004 |
(showOnly ~~ #pythonClasses |
|
3005 |
and:[showOnly ~~ #pythonMethods]) ifTrue:[ |
|
9921 | 3006 |
hidePythonFunctions ~~ true ifTrue:[ |
9891 | 3007 |
targets add:(Tag::TFunction |
3008 |
label:nm |
|
3009 |
pattern:nil |
|
3010 |
type:nil |
|
3011 |
lineNumber:lineNr). |
|
3012 |
] |
|
3013 |
] |
|
3014 |
] |
|
3015 |
] |
|
3016 |
] |
|
3017 |
] |
|
3018 |
] |
|
3019 |
]. |
|
3020 |
s close |
|
3021 |
]. |
|
3022 |
^ targets |
|
9921 | 3023 |
|
3024 |
"Modified: / 08-05-2011 / 10:39:10 / cg" |
|
9891 | 3025 |
! |
3026 |
||
3027 |
rubyTagsInFile:aFilePath |
|
3028 |
"ruby tags: |
|
3029 |
naive, q&d scan for lines matching: |
|
3030 |
def any |
|
3031 |
" |
|
3032 |
||
3033 |
|targets line l lineNr nm s| |
|
3034 |
||
3035 |
Tag autoload. |
|
3036 |
||
3037 |
targets := OrderedCollection new. |
|
3038 |
s := aFilePath asFilename readStream. |
|
3039 |
s notNil ifTrue:[ |
|
3040 |
s := LineNumberReadStream readingFrom:s. |
|
3041 |
[s atEnd] whileFalse:[ |
|
3042 |
lineNr := s lineNumber. |
|
3043 |
line := s nextLine. |
|
3044 |
l := line withoutSeparators. |
|
3045 |
||
3046 |
(l startsWith:'def ') ifTrue:[ |
|
3047 |
nm := l copyFrom:5. |
|
3048 |
targets add:(Tag::TFunction |
|
3049 |
label:nm |
|
3050 |
pattern:nil |
|
3051 |
type:nil |
|
3052 |
lineNumber:lineNr). |
|
3053 |
] ifFalse:[ |
|
3054 |
(l startsWith:'class ') ifTrue:[ |
|
9921 | 3055 |
hideClasses == true ifFalse:[ |
3056 |
nm := l copyFrom:6. |
|
3057 |
targets add:(Tag::TClass |
|
3058 |
label:nm |
|
3059 |
pattern:nil |
|
3060 |
type:nil |
|
3061 |
lineNumber:lineNr). |
|
3062 |
] |
|
9891 | 3063 |
]. |
3064 |
]. |
|
3065 |
]. |
|
3066 |
s close |
|
3067 |
]. |
|
3068 |
^ targets |
|
9921 | 3069 |
|
3070 |
"Modified: / 08-05-2011 / 10:38:44 / cg" |
|
9891 | 3071 |
! |
3072 |
||
12125 | 3073 |
stTagsInFile:aFilePath in:aTempDirectory |
9891 | 3074 |
"smalltalk tags: |
12125 | 3075 |
not so naive: generate a changeList from the contents and convert it into a tag-list |
9891 | 3076 |
" |
3077 |
||
12125 | 3078 |
|targets s anyPrimitiveDefinitions shellCmd cTagsList| |
9891 | 3079 |
|
3080 |
Tag autoload. |
|
3081 |
||
12125 | 3082 |
anyPrimitiveDefinitions := false. |
9891 | 3083 |
targets := OrderedCollection new. |
3084 |
s := aFilePath asFilename readStream. |
|
3085 |
s notNil ifTrue:[ |
|
3086 |
s := LineNumberReadStream readingFrom:s. |
|
3087 |
s skipSeparators. |
|
3088 |
||
3089 |
"/ new interface: block-arg to #changesFromStream:do: gets 3 args |
|
3090 |
[ |
|
3091 |
ChangeSet::InvalidChangeChunkError handle:[:ex | |
|
3092 |
Dialog warn:('Error while processing changes - skipping: ' , aFilePath asFilename pathName). |
|
3093 |
] do:[ |
|
3094 |
ChangeSet changesFromStream:s do:[:aChange :lNr :pos| |
|
3095 |
aChange isClassDefinitionChange ifTrue:[ |
|
9921 | 3096 |
hideClasses == true ifFalse:[ |
3097 |
targets add:(Tag::TClass |
|
9891 | 3098 |
label:(aChange className) |
3099 |
pattern:('/subclass:') |
|
3100 |
type:nil |
|
3101 |
lineNumber:lNr). |
|
9921 | 3102 |
] |
9891 | 3103 |
] ifFalse:[ |
3104 |
aChange isMethodChange ifTrue:[ |
|
9921 | 3105 |
hideMethods == true ifFalse:[ |
3106 |
targets add:(Tag::TMethod |
|
9891 | 3107 |
label:(aChange selector) |
3108 |
pattern:('/^' , aChange selector) |
|
3109 |
type:nil |
|
3110 |
lineNumber:lNr). |
|
9921 | 3111 |
] |
12125 | 3112 |
] ifFalse:[ |
3113 |
aChange isPrimitiveChange ifTrue:[ |
|
3114 |
targets add:(Tag::TMacro |
|
3115 |
label:(aChange isPrimitiveDefinitionsChange |
|
3116 |
ifTrue:['<< primitive definitions >>'] |
|
3117 |
ifFalse:[ (aChange isPrimitiveFunctionsChange |
|
3118 |
ifTrue:['<< primitive functions >>'] |
|
3119 |
ifFalse:['<< primitive variables >>'])]) |
|
3120 |
pattern:('/^' , aChange source asStringCollection first) |
|
3121 |
type:nil |
|
3122 |
lineNumber:lNr). |
|
3123 |
anyPrimitiveDefinitions := true |
|
3124 |
] |
|
9891 | 3125 |
] |
3126 |
]. |
|
3127 |
] |
|
3128 |
] |
|
3129 |
] ensure:[ |
|
3130 |
s close. |
|
3131 |
]. |
|
3132 |
]. |
|
12125 | 3133 |
|
3134 |
anyPrimitiveDefinitions ifTrue:[ |
|
3135 |
"/ also invoke ctags on the file, merge those tags. |
|
3136 |
"/ sorry: not perfect, because ctags seems to get confused by the extra %{ %} nesting. |
|
3137 |
shellCmd := (self shellCommandTemplateFor:(aFilePath asFilename withSuffix:'c') pathName) |
|
3138 |
bindWith:aFilePath. |
|
3139 |
shellCmd notNil ifTrue:[ |
|
3140 |
cTagsList := self getTagListFromFile:aFilePath asFilename usingCommand:shellCmd mode:#c in:aTempDirectory. |
|
3141 |
cTagsList notEmptyOrNil ifTrue:[ |
|
3142 |
^ cTagsList , targets |
|
3143 |
]. |
|
3144 |
]. |
|
3145 |
]. |
|
3146 |
||
9891 | 3147 |
^ targets |
9921 | 3148 |
|
12125 | 3149 |
"Created: / 05-01-2012 / 10:56:26 / cg" |
9891 | 3150 |
! |
3151 |
||
3152 |
tclTagsInFile:aFilePath |
|
3153 |
"tcl tags: |
|
3154 |
naive, q&d scan for lines matching: |
|
3155 |
proc any |
|
3156 |
" |
|
3157 |
||
3158 |
|targets line l lineNr nm s words| |
|
3159 |
||
3160 |
Tag autoload. |
|
3161 |
||
3162 |
targets := OrderedCollection new. |
|
3163 |
s := aFilePath asFilename readStream. |
|
3164 |
s notNil ifTrue:[ |
|
3165 |
s := LineNumberReadStream readingFrom:s. |
|
3166 |
[s atEnd] whileFalse:[ |
|
3167 |
lineNr := s lineNumber. |
|
3168 |
line := s nextLine. |
|
3169 |
l := line withoutSeparators. |
|
3170 |
||
3171 |
(l startsWith:'proc ') ifTrue:[ |
|
3172 |
nm := l copyFrom:6. |
|
3173 |
targets add:(Tag::TFunction |
|
3174 |
label:nm |
|
3175 |
pattern:nil |
|
3176 |
type:nil |
|
3177 |
lineNumber:lineNr). |
|
3178 |
] ifFalse:[ (l startsWith:'tixWidgetClass ') ifTrue:[ |
|
3179 |
nm := l copyFrom:'tixWidgetClass ' size + 1. |
|
3180 |
(nm endsWith:'{') ifTrue:[ |
|
3181 |
nm := (nm copyWithoutLast:1) withoutSeparators. |
|
3182 |
]. |
|
3183 |
targets add:(Tag::TClass |
|
3184 |
label:nm |
|
3185 |
pattern:nil |
|
3186 |
type:nil |
|
3187 |
lineNumber:lineNr). |
|
3188 |
] ifFalse:[ (l startsWith:'set ') ifTrue:[ |
|
3189 |
hideVariables value ~~ true ifTrue:[ |
|
3190 |
words := l asCollectionOfWords. |
|
3191 |
words size >= 2 ifTrue:[ |
|
3192 |
nm := words second. |
|
3193 |
targets add:(Tag::TVariable |
|
3194 |
label:nm |
|
3195 |
pattern:nil |
|
3196 |
type:nil |
|
3197 |
lineNumber:lineNr). |
|
3198 |
] |
|
3199 |
]]]]. |
|
3200 |
]. |
|
3201 |
s close |
|
3202 |
]. |
|
3203 |
^ targets |
|
3204 |
||
3205 |
||
3206 |
||
3207 |
||
3208 |
||
3209 |
! |
|
3210 |
||
3211 |
yaccTagsInFile:aFilePath |
|
3212 |
"yacc tags: |
|
3213 |
naive, q&d scan for lines matching: |
|
3214 |
<anything>: |
|
3215 |
" |
|
3216 |
||
3217 |
|targets line l lineNr nm s words w |
|
3218 |
| |
|
3219 |
||
3220 |
Tag autoload. |
|
3221 |
||
3222 |
targets := OrderedCollection new. |
|
3223 |
s := aFilePath asFilename readStream. |
|
3224 |
s notNil ifTrue:[ |
|
3225 |
s := LineNumberReadStream readingFrom:s. |
|
3226 |
[s atEnd] whileFalse:[ |
|
3227 |
line := s nextLine. |
|
3228 |
l := line withoutSeparators. |
|
3229 |
words := l asCollectionOfWords. |
|
3230 |
||
3231 |
words size >= 1 ifTrue:[ |
|
3232 |
w := words first. |
|
3233 |
(w endsWith:$:) ifTrue:[ |
|
3234 |
nm := w copyWithoutLast:1. |
|
3235 |
||
3236 |
lineNr := s lineNumber - 1. |
|
3237 |
targets add:(Tag::TLabel |
|
3238 |
label:nm |
|
3239 |
pattern:nil |
|
3240 |
type:nil |
|
3241 |
lineNumber:lineNr). |
|
3242 |
]. |
|
3243 |
] |
|
3244 |
]. |
|
3245 |
s close |
|
3246 |
]. |
|
3247 |
^ targets |
|
3248 |
! ! |
|
3249 |
||
3250 |
!TagList methodsFor:'testing'! |
|
3251 |
||
3252 |
supportsFile:aFile |
|
3253 |
"return true, if we can generate tags for a file" |
|
3254 |
||
3255 |
|suffix lcSuffix lcName selfClass| |
|
3256 |
||
3257 |
aFile isReadable ifFalse:[^ false]. |
|
3258 |
||
3259 |
"/ cg: now always return true - let generateTag run against the wall... |
|
3260 |
^ true. |
|
3261 |
||
3262 |
"/ suffix := aFile suffix. |
|
3263 |
"/ lcSuffix := suffix asLowercase. |
|
3264 |
"/ |
|
3265 |
"/ selfClass := self class. |
|
3266 |
"/ |
|
3267 |
"/ suffix size ~~ 0 ifTrue:[ |
|
3268 |
"/ ((selfClass isCSuffix:lcSuffix) |
|
3269 |
"/ or:[(selfClass isJavaSuffix:lcSuffix) |
|
3270 |
"/ or:[(selfClass isEiffelSuffix:lcSuffix) |
|
3271 |
"/ or:[(selfClass isFortranSuffix:lcSuffix) |
|
3272 |
"/ or:[(selfClass isPythonSuffix:lcSuffix) |
|
3273 |
"/ or:[(selfClass isLispSuffix:lcSuffix) |
|
3274 |
"/ or:[(selfClass isPrologSuffix:lcSuffix) |
|
3275 |
"/ or:[(selfClass isTCLSuffix:lcSuffix) |
|
3276 |
"/ or:[(selfClass isAssemblerSuffix:lcSuffix) |
|
3277 |
"/ or:[(selfClass isSmalltalkSuffix:lcSuffix) |
|
3278 |
"/ or:[(selfClass isRubySuffix:lcSuffix)]]]]]]]]]]) |
|
3279 |
"/ ifTrue:[ |
|
3280 |
"/ ^ true |
|
3281 |
"/ ]. |
|
3282 |
"/ ]. |
|
3283 |
"/ |
|
3284 |
"/ lcName := aFile baseName asLowercase. |
|
3285 |
"/ (selfClass makeFilePatterns contains:[:pattern | pattern match:lcName]) ifTrue:[ |
|
3286 |
"/ ^ true |
|
3287 |
"/ ]. |
|
3288 |
"/ ^ false |
|
3289 |
! ! |
|
3290 |
||
3291 |
!TagList class methodsFor:'documentation'! |
|
3292 |
||
12125 | 3293 |
version |
12229 | 3294 |
^ '$Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.10 2012/03/24 22:26:07 cg Exp $' |
12125 | 3295 |
! |
3296 |
||
9891 | 3297 |
version_CVS |
12229 | 3298 |
^ '§Header: /cvs/stx/stx/libtool/Tools__TagList.st,v 1.10 2012/03/24 22:26:07 cg Exp §' |
10054 | 3299 |
! |
3300 |
||
3301 |
version_SVN |
|
12229 | 3302 |
^ '$Id: Tools__TagList.st 7978 2012-04-13 13:15:47Z vranyj1 $' |
12125 | 3303 |
! ! |