[fpc-pascal] Proper preprocessor?

Marco van de Voort marcov at stack.nl
Wed Jun 20 16:12:19 CEST 2018


In our previous episode, Michael Van Canneyt said:
> Till now, the burden of preprocessing is considered simply too big for the
> gain.
> 
> One consequence, for example, is that the ppu files are thrown out of the 
> window. The compiler would have to compile every used unit every time again, 
> since it has no idea what the user of the preprocessor can/will/wants to do.
> Just as the C compiler is forced to do, by the way.
> 
> Second consequence is the generation of debug info: you need to work back to
> the original source location. This places a restriction on the preprocessor,
> since it somehow needs to communicate back the original source locations to the
> compiler. etc.
> 
> Same is true for error locations, and so on.

And afaik you need to introduce (more?) line based parsing in the
preprocessor rather than a token stream. Just try to put #line or #define in
the middle of a statement in C.

This is also alien to pascal.



More information about the fpc-pascal mailing list