[fpc-devel] Macro Processing

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri May 13 16:36:32 CEST 2011

Mattias Gaertner schrieb:

> Compiler errors in macros are often confusing/misleading, because the 
> user does not see the expanded code.

That's where a compiler listing comes into the play, generated e.g. by 
the preprocessor option (-m).

> Same for debugger positions and handling.

Not really different from conditional compilation.

> Macros can confuse other parsers. For example the fcl parser or the ones 
> in IDEs. Especially imported macros from other units and conditional 
> macros are not supported.

True, it should be possible to re-create parsers from a common grammar.

> Code editing functions in IDEs are mislead by macros especially 
> conditional macros.

A nowadays IDE already must recognize many conditionals and 
declarations. It may be worth to spend some time with a consideration, 
what makes life hard to the coder and the CodeTools, and how this can be 

Even if FPC is designed as a highly speed-optimized prodcution compiler, 
what's that speed gain worth when a coder spends most of its time in 
reading and updating source code? What about an "interactive" compiler, 
that can be created from the same codebase as the production compiler, 
but which interfaces much better with an IDE and its CodeTools?


More information about the fpc-devel mailing list