User friendliness suggestion.
Arguably there is some duplication of information in two different spots. We declare vars in both C patch and in hvars.
FrontC needs the declarations. We could splice in the computed type declarations to the patch string.
It is not clear why do you need to declare them at all. The parser needs only to know the type names, not the variable names. And type names could be easily declared via the Clexer.add_type.
User friendliness suggestion. Arguably there is some duplication of information in two different spots. We declare vars in both C patch and in hvars. FrontC needs the declarations. We could splice in the computed type declarations to the patch string.