Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-02

ptop

15 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jan Ruzicka

Hi

is anybody updating the ptop utility?

I was attempting to run a legacy source code by it but it fails to deliver.
Problems are
1) keywords
- ptop does not recognize all fpc keywords

2) nested comments
- ptop does not recognize nested comments

3) comment endings
- ptop does not differentiate between '{','}' and '(*','*)' comments
- ptop does not even recognize '*)' most of the time (it matches it as '*' and ')'.

4) multi line comments
- ptop does not handle multiline comments properly it ends the comment at the end of line.

I attempted to fix issues mentioned above, but I don't know who should be contacted for a patch submission.

Can I use Ansi strings or does it have to be portable?

I ask because multi line comments are too big for a string.

Is there a keeper of the utils ?

Jan Ruzicka

Reply by email

Florian Klaempfl
to Jan Ruzicka: Hi is anybody updating the ptop utility? I was attempting to run a legacy source code by…
Jan Ruzicka wrote 25 lines
Hi is anybody updating the ptop utility? I was attempting to run a legacy source code by it but it fails to deliver. Problems are 1) keywords - ptop does not recognize all fpc keywords 2) nested comments - ptop does not recognize nested comments 3) comment endings - ptop does not differentiate between '{','}' and '(*','*)' comments - ptop does not even recognize '*)' most of the time (it matches it as '*' and ')'. 4) multi line comments - ptop does not handle multiline comments properly it ends the comment at the end of line. I attempted to fix issues mentioned above, but I don't know who should be contacted for a patch submission. Can I use Ansi strings or does it have to be portable?

Ansitrings are always portable so they can be used.

I ask because multi line comments are too big for a string. Is there a keeper of the utils ?

Post them zipped here; if the zip is too large, the list admin will handle it :)

Reply by email

Jan Ruzicka
to Florian Klaempfl

OK here is the first patch.
- keywords 'virtual' and 'uses' were added.
- '{}' and '(**)' comment types were separated.

I am fighting with AnsiString now for the rest of changes. Attempt to change the Token type to AnsiString ended up in unusable code.
The sym value did not get cleaned and caused repeating of comments over and over again.
It also seemed that there was some endless loop.

Jan Ruzicka

Florian Klaempfl wrote 36 lines
Jan Ruzicka wrote: > Hi > is anybody updating the ptop utility? > I was attempting to run a legacy source code by it but it fails to > deliver. > Problems are > 1) keywords > - ptop does not recognize all fpc keywords > 2) nested comments > - ptop does not recognize nested comments > 3) comment endings > - ptop does not differentiate between '{','}' and '(*','*)' > comments > - ptop does not even recognize '*)' most of the time (it matches > it as '*' and ')'. > 4) multi line comments > - ptop does not handle multiline comments properly it ends the > comment at the end of line. > I attempted to fix issues mentioned above, but I don't know who > should be contacted for a patch submission. > Can I use Ansi strings or does it have to be portable? Ansitrings are always portable so they can be used. > I ask because multi line comments are too big for a string. > Is there a keeper of the utils ? Post them zipped here; if the zip is too large, the list admin will handle it :) _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jan Ruzicka
to Jan Ruzicka

Hi
here comes next incremental patch:
- tokens now AnsiStrings
- the comments are now handled better, ptop now does a multi line comments.
- added debug prints to verbose option
'line in-<number> out-<number> symbol "<name>" = "<value>"' the <value> is truncated in the middle. this means visible beginning and the end.

only outstanding issue are new lines in front of long comments. The procedure PPSymbol is trying to fit the symbol on a line by inserting a new line.

This is working so it can be checked in.

Jan Ruzicka

Jan Ruzicka wrote 48 lines
OK here is the first patch. - keywords 'virtual' and 'uses' were added. - '{}' and '(**)' comment types were separated. I am fighting with AnsiString now for the rest of changes. Attempt to change the Token type to AnsiString ended up in unusable code. The sym value did not get cleaned and caused repeating of comments over and over again. It also seemed that there was some endless loop. Jan Ruzicka On Feb 19, 2005, at 09:57, Florian Klaempfl wrote: > Jan Ruzicka wrote: > >> Hi >> is anybody updating the ptop utility? >> I was attempting to run a legacy source code by it but it fails to >> deliver. >> Problems are >> 1) keywords >> - ptop does not recognize all fpc keywords >> 2) nested comments >> - ptop does not recognize nested comments >> 3) comment endings >> - ptop does not differentiate between '{','}' and '(*','*)' >> comments >> - ptop does not even recognize '*)' most of the time (it >> matches it as '*' and ')'. >> 4) multi line comments >> - ptop does not handle multiline comments properly it ends the >> comment at the end of line. >> I attempted to fix issues mentioned above, but I don't know who >> should be contacted for a patch submission. >> Can I use Ansi strings or does it have to be portable? > > Ansitrings are always portable so they can be used. > >> I ask because multi line comments are too big for a string. >> Is there a keeper of the utils ? > > Post them zipped here; if the zip is too large, the list admin will > handle it :) >

Reply by email

Unknown author
to Jan Ruzicka
Jan Ruzicka wrote 14 lines
Hi here comes next incremental patch: - tokens now AnsiStrings - the comments are now handled better, ptop now does a multi line comments. - added debug prints to verbose option 'line in-<number> out-<number> symbol "<name>" = "<value>"' the <value> is truncated in the middle. this means visible beginning and the end. only outstanding issue are new lines in front of long comments. The procedure PPSymbol is trying to fit the symbol on a line by inserting a new line. This is working so it can be checked in.

Applied the patch, checked in.

Michael.

Reply by email

Uberto Barbini
to Unknown author

Where can I find info about compiling fpc from cvs? I browsed doc and faq but I wasn't able to understand exactly where to start. BTW today's daily win bin snapshot doesn't run (segmentation fault in install.exe).

Bye Uberto

Reply by email

Uberto Barbini
to Uberto Barbini
Uberto Barbini wrote
Where can I find info about compiling fpc from cvs? I browsed doc and faq but I wasn't able to understand exactly where to start. BTW today's daily win bin snapshot doesn't run (segmentation fault in install.exe).

I forgot to mention that I want to compile under win, with linux I have no problem.

Bye Uberto

Reply by email

Uberto Barbini
to Marco van de Voort
Marco van de Voort wrote
> Where can I find info about compiling fpc from cvs? http://www.stack.nl/~marcov/buildfaq.pdf

If there ain't a simple way to compile on win then study all these 24 pages, I think I'll surrender! ;))

Anyway, page 5 you describe the mess with 3 gcc existings on win, but you don't suggest which is the best and don't mention that in fpc cvs does exist a binw32 directory with gcc tools.
So which is the simplest way to compile it?

Moreover I think that a previous version of fpc binaries will suffice to compile latest cvs sources but reading paragraph 1.2.5 I don't understand if any version of ppc will suffice or what version is needed.

After that there are some pages about obtaining source from cvs, which I skipped, and suddenly I found myself reading without understanding anything.

So let's assume I'm a completely idiot and I have downloaded fpc from cvs to compile it on a windows system. Do I have any hope to compile it?

Bye Uberto

Reply by email

Jan Ruzicka
to Unknown author: Applied the patch, checked in. Michael.
On Mon, 21 Feb 2005, Jan Ruzicka wrote: > Hi >

[... snip ...]

Show quoted text 10 lines
> only outstanding issue are new lines in front of long comments. > The procedure PPSymbol is trying to fit the symbol on a line by > inserting a > new line. > > This is working so it can be checked in. Applied the patch, checked in. Michael.

Thank you Michael.

Now to the multiline comment problem.

Should the comment be interpreted:

a) whole as one symbol?
Meaning as group of characters between comment symbols including a new line.
symbol = '{l1\nl2\nl3\n}'

or

b) series of commented lines?

Meaning as group of symbols characters between comment symbols including a new line.
symbol1 = '{l1'
symbol2 = 'l2'
symbol2 = 'l3'
symbol2 = '}'

I am asking because the current implementation is the variant a), which causes problems with the PPsymbol procedure.
(Inserting empty line in front of comments longer then 'currmargin') ------------------------------------------------------------------------ -----------
Another question is
What do you think about the global variable sets?
From reading code I think that it contains set of settings for current symbol.
As such it should be moved to currsym structure.

If nothing else it should move at least to the TPrettyPrinter object, as it is set in TPrettyPrinter.PrettyPrint according to its options. This means multiple TPrettyPrinter instances would fight over the sets variable.
------------------------------------------------------------------------ -----------
Where could be a good place to create unit test programs for the utils ?

Thanks once more for the check-in.

Jan Ruzicka

Reply by email

Marco van de Voort
to Peter Vreman

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 7 lines
> So let's assume I'm a completely idiot and I have downloaded fpc from cvs > to > compile it on a windows system. Do I have any hope to compile it? Install fpc 1.0.10 Download fpc from cvs Start cmd.exe

- make sure the FPC dir is the first in your path. (\pp\bin\win32)

Go to the new fpc directory Type 'make all' Not much different from compiling any other C project.

To install

- make a copy of the 1.0.10 directory. (e.g. c:\pp19)
- rename the pp19\bin\win32 to pp19\bin\i386-win32
- go back to the fpc/ (CVS) directory
- type make 'install INSTALL_PREFIX=c:\pp19'
- copy the binary files in the CVS over the ones in the pp19\bin\i386-win32
- rename pp to pp10, and then pp19 to pp
- change your path configuration to point to c:\pp\bin\i386-win32 instead of \pp\bin\i386\win32
- post edit the -Fu line in fpc.cfg to point to c:\pp\units\i386-win32\*

Reply by email

SteveG
to Uberto Barbini: If there ain't a simple way to compile on win then study all these 24 pages, I think I'll…

You need a working compiler already installed (use a binary install from to begin - eg 1.0.10)
Download the full FPC from cvs site (eg to folder c:\fpc)

At the command prompt, cd to c:\fpc (or your cvs folder) type - make clean all (clears any rubbish from previous builds) cd c:\fpc\compiler (going to build compiler from source) type - make cycle (builds new ppc386 compiler exe) cd c:\fpc (to main folder for install)
type make install INSTALL_PREFIX=c:\pp (create working fpc at 'location'
- can be INSTALL_PREFIX=d:\Lazarus\pp etc)

lastly, rebuild Lazarus with - make clean all (in Laz directory of course)

Fairly sure this is in correct order - any other suggestions welcome if somebody has them

Show quoted text 13 lines
So let's assume I'm a completely idiot and I have downloaded fpc from cvs to compile it on a windows system. Do I have any hope to compile it? Bye Uberto _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Uberto Barbini
to Peter Vreman: Install fpc 1.0.10 Download fpc from cvs Start cmd.exe Go to the new fpc directory Type…
Peter Vreman wrote 11 lines
> So let's assume I'm a completely idiot and I have downloaded fpc from cvs > to > compile it on a windows system. Do I have any hope to compile it? Install fpc 1.0.10 Download fpc from cvs Start cmd.exe Go to the new fpc directory Type 'make all' Not much different from compiling any other C project.

OK, tried, done... I'm definitely a complete idiot! ;) Thanks to all.

Bye Uberto

Reply by email