[fpc-devel] fpc modifiers
Marco van de Voort
marcov at stack.nl
Thu Apr 28 18:22:38 CEST 2011
In our previous episode, Joerg Schuelke said:
[ Charset UTF-8 unsupported, converting... ]
> First i will note that what i state is not an error or bug in free
> pascal, but it is somehow unclean implemented.
> The decision for modifiers like cvar or cdecl to be an <identifier>
> token or an <modifier> token relies on context information. But what is
> that context? An example:
>
> type
> name=procedure; cdecl
=integer;
The compiler looks for modifier in certain spaces, like after a procedure
declaraction. IOW the compiler reads it like above.
> results in an error, but
>
> type
> cdecl=integer;
> name=procedure;
>
> is correct.
>
> The procedure type declaration consumes the <cdecl> token regardless of
> the following token.
> There is no need for this. The <=> token can be used as context switch,
> but you?ll need a look ahead of 2 tokens. And that conflicts with the
> LL1 base structure of pascal. What a pity.
No, since modifiers can be in any order, it could be a lot more than two
tokens.
More information about the fpc-devel
mailing list