You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The typechecker of Language.C checks types but does not store any infomation on the statement/expression level. Currently I can think of only one proper way that requires changes to the language-c module, unfortunately it seems like a lot of work.
1.) Extend the AST annotation type from a single type a to a whole type family. For our compiler class we used this approach that was first described in the "Trees that Grow"(TTG) paper by Najd and Jones(2017).
2.) Add an extra version of the MonadTrav class that changes the return types of its handlers from () to the type of the original fragment, parametrized by the expected output.
3.) Rewrite the Typechecker to use the new MonadTrav'.
Pro: Clean, potential contribution to language-c.
Con: Lot of work, might end up with a unmaintained fork of language-c.
Okay, so there's also SemRep which is a more semantic representation of the AST, whcih fortunately contains type information. Unfortunately there's no way yet to export SemRep back into an AST, as some crucial functions in Language.C.Export have not been implemented yet.
I opened an issue, offering to implement the missing feature in language-c:
We can also use the typechecker in
Language.C.Analyzer
to use type information.The text was updated successfully, but these errors were encountered: