"Code explorer" control

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
Leslie7Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GloomyFriarCommented:
>I was wondering how Delphi’s Code explorer collects the information it displays?
It just parse sources and and displays the retrieved 'objects'.
0
Leslie7Author Commented:
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
DeerBearCommented:
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Leslie7Author Commented:
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
DeerBearCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Leslie7Author Commented:
Thanx!

Need some more time to evaluate the info...

I enjoy the way you help. :)

0
Leslie7Author Commented:
DeerBear

Thanx for your help &  your time! :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.