Solved

"Code explorer" control

Posted on 2003-11-04
7
215 Views
Last Modified: 2010-04-05
Hi,

I was wondering how Delphi’s Code explorer collects the information it displays?
Especially the names and types of the protected and public class members, and global variables.  Is it possible to write a control, which displays the same information as Code explorer? How? :)

I’m not expecting a whole solution, just basic ideas to get me started on how to collect the different kind of information Code explorer displays.

Regards,
Leslie
0
Comment
Question by:Leslie7
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9685716
>I was wondering how Delphi’s Code explorer collects the information it displays?
It just parse sources and and displays the retrieved 'objects'.
0
 

Author Comment

by:Leslie7
ID: 9686502
Yes, you are right about that!

Originally my Q was about the “Code completion wizard”. Right before sending it I changed to “Code explorer”. Now I see I should have mentioned both of them:

I need a control with the information the Code explorer displays, but the programming technique I need could be behind the Code completion wizard. It shows protected members of classes even when the class was registered from a package without source.

I suppose this quite a unique Q. My guess is that the solution could be getting the information form the IDE somehow. Maybe through the interfaces, which are provided for writing/installing packages or wizards, … maybe through designer interfaces….

My other guess is even weirder: collecting the info from the packages. Delphi does it somehow, when installing a package.  :)

Experts! Please consider this comment as the part of the original Q!

0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9693358
Hi,

The problem is split into several parts:

1) Parse the source code
2) Validate the source code
3) Structuring source code in a class hierarchy
4) Displaying it in a component

1,2 and 3 are the most difficult ones and require a very good knowledge of
many aspects of programming( compilers, OOP, trees, etc ).

If you find a good parser, you've started the right way.

Structuring a good hierarchy is the most time-consuming task,
since it requires huge design abilities.
This is a small example:

-TCodeBase( the base class )

-TCodeLine
-TCodeLines

-TRoutine
-TRoutines

-TInterface
-TInterfaces

-TSourceClass


It should be reworked a lot, but it should be like this.

HTH,

Andrew
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:Leslie7
ID: 9697524
Hi DeerBear

Evaluating the source code is not possible when there is no source code. Delphi knows, how to do it another way. As I see the packages hold the class type information down to protected level. Code explorer might parse the unit code, but for Code completion I think Delphi builds a list about all registered classes.

I’m examining the possibility of making designing, coding, documenting and maintenance easier. Borland is heading this way too. Their decision was mostly buying existing solutions. When it comes to designing, I prefer too build my own tools which really meet my needs.

So I’m thinking about….

1. Improving the Delphi IDE.
2. Connecting designer and documentation tools to the to the IDE.
3. In case no satisfying result in 1 and 2, then writing a new IDE, which can be integrated with other tools. ( Lots of work. Not sure at all if it can be done within reasonable time. )

1. I found GExperts tools. It has some very good tool, which really saves time when coding. It even has a Code explorer’like window.  Since GExperts is opensource, I started to check how it works. It does approximately what you suggested.  
It is interesting that GExperts has some functionality, which I think requires deeper knowledge of the IDE then Delphi documentation provides.  

2. I found, that most of the integration I need can be done through IDesigner, or by writing an Expert. What I was not able to solve yet is providing the registered classes typeinfo, and the packages global variables to the designer tool. That is why I asked this Q. I need to let the designer tool know what classes (Components) the IDE has.
0
 
LVL 5

Accepted Solution

by:
DeerBear earned 500 total points
ID: 9699602
Hi,

Well, this makes things different. Very different.
From what I understood, you wanted a *code explorer*, like
Delphi's one.

Now you speak of integrating things into the IDE, which is quite different.

I'll give you now an overview of what you - imho - should do:

- Create a code base for an UML tool( that's what I think you mean by "designing" ) that
does class diagrams and metadiagrams.

- Create a code base for a documentation tool. You can use DocBook as file format.

Now, opensource the tools, so that a community can grow around them.
This will surely make them better and their development way faster.

Coming to Delphi integration:

Delphi integration is done through Open Tools Api( OTA ) which is mostly undocumented,
unless you regard some comments in the source code without a sample code line
explaining things as "documentation".

OTAs have this approach:

There's an object that implements all the interfaces and it's called BorlandServices.
You get access, through it, to all of the Delphi IDE.
I suggest you use packages instead of DLLs, because using DLLs opens a new
complexity level which makes things more complicated.

There's a specific group on the borland forums called "opentoolsapi" which is
just for those who want to extend the IDE, and among the people you can find
there, there's GExperts' original author.

Now let's come to detail a bit more the documentation issues.

Using DocBook will give you an established base where to start
from. DocBook is a well established standard by now and way
better than WinHelp <g>.

HTML pages for help, imho, are not a good choice, because of
compatibility problems among browsers.

HTML Compiled Help is not a choice either, since you can only use it
under Windows.

Creating a docbook viewer is not very complicated, plus it would be
possible to generate documentation using a JavaDoc-like tool, through
comments in the source code or - a less explored chance - putting text
beyond the last "end." .
All text beyond that is plainly ignored, as the older of us surely know <g>.

Also consider that a JavaDoc-Like tool would perfectly fit as IDE-Addin.

My 2c,

Andrew
0
 

Author Comment

by:Leslie7
ID: 9724880
Thanx!

Need some more time to evaluate the info...

I enjoy the way you help. :)

0
 

Author Comment

by:Leslie7
ID: 10230328
DeerBear

Thanx for your help &  your time! :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now