[Lazarus] Request for student project ideas
Florian Klaempfl
florian at freepascal.org
Tue Sep 15 18:56:44 CEST 2009
Hans-Peter Diettrich schrieb:
> Florian Klaempfl schrieb:
>
>>>> So you want a hybrid pascal/C compiler? Or at which point do you
>>>> want to
>>>> do macro expansion and translation of the resulting C?
>>> All that is done in the compiler front-end, AKA parser.
>>
>> (preprocessing is never part of the parser, it's a separate compiler
>> module or part of the, but this doesn't matter)
>
> At least since C98
There is no C98, only C89 and C99. Which one do you mean?
>
> You missed the goal :-(
And you the point :) Such a compiler has to deal with *any* kind of ugly
macro stuff not only of specially tailored code for this purpose. If
this would be doable, it could be also done with h2pas, ToPas or whatever.
>
> The C code is translated into separate ppu/o files, which can be added
> to the Uses clauses. Eventually a library unit or (package?) project can
> enumerate the types, constants, variables and functions of the C
> modules, which shall become available in other units. In the case of a
> library unit this unit can be added to the Uses of other Pascal units.
>
> If you ever had used CBuilder, you would better understand how a
> compiler can compile modules of various languages, and create object
> files usable from all languages.
This works only because the headers are made for this purpose.
More information about the Lazarus
mailing list