[lazarus] Using RTTI to get properties and methods

Shane Miller SMiller1 at stvgb.org
Mon Feb 5 15:46:12 EST 2001


I'm not familiar with this stuff ata all so I'm a bit over my head so bear with me.

You guys are saying that I should create some browser database that I could reference for the classes in the LCL and the current unit that's loaded and then run through that for the code completion?

I was planning on just compiling the unit with browser information then parsing the browser.log file for the information I need.  However, that' going to be tough because I can find the 
***FORM1***
 (or whatever they typed and then pressed the period).  Then I have to parse the source to find out what FORM1 is a declaration of!

That isn't terribly easy because there could be comments or whatever between the text FORM1 and the text TFORM1.

Is parsing the browser.log file the way to go?  If not, please explain the other options a bit more.  I'm not sure what you guys mean when you say I should build a browser database.  During runtime?  ????

Shane



>>> Michael.VanCanneyt at wisa.be 02/05/01 02:27PM >>>


On Mon, 5 Feb 2001, Peter Vreman wrote:

> 
> >>PT := GetTypeData(Form1.ClassInfo)
> >>
> >>Pt only reflects the published properties and methods.  Is there a way to 
> >>get the other methods or am I doing this wrong?
> >
> >Not with RTTI.
> >
> >>Should I be using something else to implement code completion?
> >
> >Yes, the browser info. Maybe have a look at the implementation
> >of browser info in the text mode IDE. The important files for
> >browser implementation are:
> >
> >ide/text/fpsymbol.pas
> >compiler/browcol.pas
> >compiler/browlog.pas
> >
> >Afaik the disadvantage is that the current implementation needs parts of 
> >the compiler (symtable etc.).
> >The browser.log generated by the switch -bl isn't very helpful.
> >
> >If you need more info, Pierre or Peter may help.
> 
> A way to be independent of the compiler is to create a browser database 
> file that lazarus then can load. MSDev does it also that way. The IDE 
> should also keep track of the line number changes made by insertion or 
> deletion.

I think this is actually the only way you can do it, without including
the compiler in the IDE, and I don't think that doing that is a good idea.

Michael.

_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list