[lazarus] All right, Cliff !!

Peter Vreman pfvreman at wins.uva.nl
Wed Jun 2 12:59:29 EDT 1999


At 07:35 2-6-99 , you wrote:
>Yes that would be very nice but I could not find any examples of doing this
>either. I looked at some
>windows stuff but it was doing the same thing I did. There are some units
>like compiler.pp in the CVS source directory that
>is supposed to be able to do this.
>
>Peter told me to look at the  the text based ide which is in the CVS also.

the main units for the compiler including are 'compiler.pas' and 
'comphook.pas'. But as you already stated, you can best take a look at the 
textmode ide (it's in fpcompil.pas)

But the basics are very simple:

in compiler.pas there is a function 'Compile()' just call it like you start 
from the commandline.

compiler.compile('-Tlinux -Fu~/pp/rtl/linux filename.pas'); { this will 
load ppc386.cfg }


or use an other trick (which is used by the text ide to overcome the 255 
char limit):

compiler.compile('[fp.cfg] -g filename.pas');

this will load fp.cfg instead of ppc386.cfg, and you can still add switches 
to the commandline.



Now the hooking in the ide works with the comphook.pas.

this unit has a global variable, status which holds the latest information 
about the current source postion and errorcount, etc.

and contains some procvars which can be assigned:

do_comment
do_status
do_stop
do_internalerror

these van be assigned by your own routines.

the important ones are 'do_stop' which normally calls halt(1), which you 
ofcourse don't want ;), just an empty procedure will be enough.

do_status is called for every line that has been scanned, you need to add a 
check for, run every .. lines yourselves, this is mainly there for progress 
info

do_comment is the main output routine, which gets a verbosity level and a 
string. the main use is to check if the level matches the current settings, 
and then output it to the screen or more in IDE style, add it to a listbox.


To only get fpcompil.pas with cvs type:

cvs -z3 co ide/text/fpcompil.pas


Peter

>Cliff
>
>
>
>Curtis White wrote:
>
> > Is there any info anywhere that could help me understand the compiler
> > interface or how to include it in another program?  I would like to do
> > this.
> >
> > Curtis
> >
> > On 31-May-99 Peter Vreman wrote:
> > >
> > > Why do you call the commandline compiler? It's possible to include the
> > > compiler in the editor itself. Including it is faster and allows you to
> > > get
> > > the line info from the messages more easily so source tracking can be
> > > build
> > >
> >
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request at miraclec.com with
> >                 "unsubscribe" as the Subject
> >     archives at http://www.miraclec.com/list_archives/lazarus
>
>_________________________________________________________________
>      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