TompaD wrote:
> Yes probably......but it would be nice to manage it :-)
> You see - I think the new versions of Delphi is marvelous,
> but I havnÂt yet learned to make out the most of Delphi 4
> so buying the latest version seems like overkill.
> 
> Any hint there I can find information to start?

First, you'll need an IDE add-in, known as an expert. It will require 
access to the current edit buffer, and it will need to watch for a 
keyboard shortcut to trigger its command. Editor experts are written 
using the Open Tools API, which is not documented very much. It was in 
either version 4 or version 5 that OTA experienced some significant 
changes, so whatever information you find might not be relevant to your 
version. (Whever version the change occured in also supports the 
previous OTA edition, so you might get lucky and have a choice.)

The second part of your task will involve parsing the Delphi source 
file. The Delphi grammar is tricky; you can use the grammar from the 
help file to get you started, but the help file is neither complete nor 
entirely accurate (and it never was). Just be glad you're writing this 
for Delphi 4; the language has gotten more complicated in each version.

For OTA help, start with Eric Berry's OTA FAQ:

http://www.gexperts.org/opentools/

That page is on the GExperts site. GExperts consists almost entirely of 
IDE experts. I don't think the latest version of GExperts works with 
Delphi 4 at all, but you should be able to get an older version of the 
source code.

For the parser, I'm not sure what to recommend, except for Google. I'm 
sure there used to be a project around that aimed to have a grammar and 
parser for Delphi, and I think it was even from the Delphi 4 era. I 
don't remember what it was called, though. There are a few parser 
generators available that generate Delphi code. DelForExp might contain 
the bulk of what you need already.

As you parse a unit, you'll need to recognize classes and their methods, 
fields, and properties. You'll also have to recognize which methods are 
declared but not implemented. Delphi also does the reverse, allowing you 
to implement a method and have Class Completion insert the declaration 
for you. Delphi doesn't always handle overloaded methods correctly, so 
watch out for that when you write your class completor.

Good luck.

-- 
Rob


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to