vendredi 3 novembre 2023

I need a way of parsing C file's contents, including #if macros [closed]

I'm working on a converter that can convert old assets declared in c to some new formats. I decided to once more do research on this, so far my options look... limited... also a lot of old websites. Ideally I'd like something that keeps it simple-ish, can handle macros properly (including #if, #ifdef and other conditionals), etc. There is some stuff I think I'll have to handle myself in some way but I'm ok with thinking about all that as needed. Right now I just want to know what my options are for my c++ (c++11 specifically, because of tiny_glTF) project. Aside from a library/tool/method I honestly just want some suggestions on what I should do, what I could use and just general comment. Thank you for reading all of this!

I attempted to write my own parsers in the past and while I'd say my latest attempt was pretty good (to some extent) handling specific edge cases feels very unsafe (and my previous attempt was lost because of some weird wsl behavior? lesson learned about not committing frequently aha), it also broke with functions which while I don´t really need to parse right now I might in the future and they were hard to ignore.

Aucun commentaire:

Enregistrer un commentaire