Re: [fpc-pascal] Read Field names from VMT

2023-12-26 Thread Amir--- via fpc-pascal


On 12/26/23 01:14, Sven Barth via fpc-pascal wrote:
Amir--- via fpc-pascal  schrieb am 
Di., 26. Dez. 2023, 07:03:


Hi,

   I want to retrieve the name of the fields in a record/class, at
run
time. It looks like "TVmt.vFieldTable" is what I need. But I
cannot find
any documentation about how to explore the content of this table. I
appreciate any pointer.


This only works for published fields and only fields of type class or 
interface can be published.

That would work for me. How can I enumerate over those fields?

Best,
Amir

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Read Field names from VMT

2023-12-26 Thread Sven Barth via fpc-pascal
Amir--- via fpc-pascal  schrieb am Di.,
26. Dez. 2023, 07:03:

> Hi,
>
>I want to retrieve the name of the fields in a record/class, at run
> time. It looks like "TVmt.vFieldTable" is what I need. But I cannot find
> any documentation about how to explore the content of this table. I
> appreciate any pointer.
>

This only works for published fields and only fields of type class or
interface can be published.

Anything more requires extended RTTI, which is not yet implemented in FPC
(it's already more or less ready in a merge request, but there's still the
one or other issue that needs to be addressed).

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] More syntax questions (part 3)

2023-12-26 Thread Sven Barth via fpc-pascal
Wayne Sherman via fpc-pascal  schrieb am
Mo., 25. Dez. 2023, 15:46:

> On Mon, Dec 25, 2023 Michael Van Canneyt wrote:
> > In short: To make a EBNF grammar which is 100% correct is not so simple
> > and will make the scheme extremely difficult to understand for a reader.
> > So I prefer to present a simpler version, and mention some limitations
> >  only in the text
> ...
> > There are simply so many exceptions and limitations that the 100% correct
> > diagram would be incomprehensible and needlessly complicated if you
> tried to
> > capture every aspect for the full 100%.
>
> If the EBNF grammar is only a guide provided as documentation for a
> human reader then you might want that.  But if the EBNF grammar is
> used to drive a parser then it needs to be fully complete, accurate,
> and machine readable (see below).
>

The grammar embedded in the documentation is just that: a guide.
Though that doesn't mean that Michael isn't trying to fix as many of the
points that Adriaan mentioned as reasonably possible, because there
obviously have been mistakes and oversights.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal