[fpc-devel] Progress of pure function research

Sven Barth pascaldragon at googlemail.com
Wed Jul 18 07:39:18 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am Mi., 18. Juli 2018,
01:27:

>
>
> > On Jul 15, 2018, at 11:01 PM, J. Gareth Moreton <
> gareth at moreton-family.com> wrote:
> >
> > So far I'm mostly researching how the node builder works, specifically
> how inline
> > functions are handled, since that's a situation where a 'call' node is
> > effectively replaced, and I intend to builda similar system to handle
> pure functions.
>
> I’ve looked at the FPC sources recently but I still don’t understand the
> basics. I see lots of TDef,TSym,TSymTable classes. What are those used for?
> You mentioned nodes and I wonder if that’s what those are.
>

Symbols are the named variables, types, functions, etc. of a module.
Definitions are their type. Two different symbols can point to the same
type, e.g. when using a type alias or simply when declaring two variables
of the same type.
Symbol tables are exactly what it says on the tin: a table of symbols.
They're either the fields of a class/record, local variables of a routine,
the parameters of a routine or symbols declared in the interface or
implementation part of a unit.
Nodes are essentially FPC's abstract syntax tree. They represent operations
(e.g. load symbol X, add symbols Y and Z, access symbol V using symbol I as
index, etc.). These nodes are then converted by the code generator to
machine code. Or are also stored as is in the PPU for inline functions, so
that the compiler does not need to reparse the source (which might not be
available after all).

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180718/ac711ea9/attachment.html>


More information about the fpc-devel mailing list