Solved

"Code explorer" control

Posted on 2003-11-04
7
218 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
error 1.1 400 Bad request idhttp delphi 18 86
Printing problem 2 91
QRReport  TQrmemo vertical stretching 1 45
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 66
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

10 Experts available now in Live!

Get 1:1 Help Now