[fpc-pascal] Resource compilation

Martok listbox at martoks-place.de
Sat Aug 4 00:41:57 CEST 2018


Am 25.09.2017 um 14:24 schrieb Sven Barth via fpc-pascal:
> The RC language itself isn't *that* difficult. Main difficulty would be to essentially implement a C-preprocessor-compatible
> preprocessor.

Just "a few" months later, I finally got around to checking this out.

You were completely right, the language itself is not very difficult, and can be processed into a TResource in one pass in a
tply-generated parser. The preprocessor is also just a subset of C's (i.e.: no macros), so it would not be too complicated (I've
done the same for idlproc before). There are dialect issues between windres and Microsoft RC, but they are minor.

The more difficult part is implementing the remaining resource access classes for fcl-res. Well, not difficult per se, but the
copy-on-write-sharing thing done there adds a lot of complexity for (IMHO) very little benefit and makes it a bit awkward to
work with. There's also a lot of endian conversions that could probably be factored out.

That sounds challenging. How much interest would there be in having a full resource compiler, with the appropriate
changes/extensions to fcl-res?

-- 
Regards,
Martok




More information about the fpc-pascal mailing list