Although for C++ this is very hairy and you will probably not get too far using grammars, it may still be worth seeing what is regular and what you can achieve here (especially since mbeddr.cpp follows the architecture of mbeddr, which has the language nicely split up in expressions, statements, etc., so that may make the problem a bit more manageable for some subparts).