[fpc-pascal] alternative source format
Michael Van Canneyt
michael at freepascal.org
Tue Jul 12 11:15:02 CEST 2005
On Tue, 12 Jul 2005, Rimgaudas Laucius wrote:
> Hello,
>
> the problem is that IDEs like FP and others have no exact
> place where to store compiler configuration switches and
> other program (project) related info. For examle if user set
> switches in FP, they effect all opened units, so there is no
> possibility to configure each unit differently if you do not use
> directives. That is problem for less experienced users, like students.
> I want to propose an idea of implementation alternative
> source format able to carry all additional information.
> This can be open format realized using xml. It will not make problems
> with conversion to native "pas" format. Additional argument that FPC
> will support UTF-8 soon.
>
> Something like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fpc>
> <version>1.0</version>
> <switches target="debug">-viewh -g -Cotir -Sd</switches>
> <switches target="release">-viewh -O2 -Sd</switches>
> <todo>There is nothing to do</todo>
> <target>win32</target>
> ...
> <body>
> begin
> writeln('hi');
> readln;
> end.
> </body>
> </fpc>
>
> What do you think about this?
This is something for an IDE, not for the compiler itself.
An IDE is free to store it's sources as it wants.
Parsing XML adds a lot of processing overhead, so should not be
supported in the compiler. What is more, most relevant
command-line options can be specified with directives, so you don't
really need the 'extra' info in the compiler sources.
But if you want to add such an extension to the IDE, please do.
Michael.
More information about the fpc-pascal
mailing list