Support function pointers and use a state monad in the frontend.
Important changes in the core semantics: * Types extended with function types. Since function types are a special kind of pointer types, types now have an additional mutual part called "ptr_type". * Pointers extended with function pointers. Theses are just names that refer to an actual function in the function environment. * Typing environments extended to assign argument and return types to function names. Before we used a separate environment for these, but since the argument and return types are already needed to type function pointers, this environment would appear in pretty much every typing judgment. As a side-effect, the frontend has been rewritten entirely. The important changes are: * Type checking of expressions is more involved: there is a special kind of expression type corresponding to a function designator. * To handle things like block scoped extern function, more state-fullness was needed. To prepare for future extensions, the entire frontend now uses a state monad.
Showing
- theories/base.v 2 additions, 0 deletionstheories/base.v
- theories/collections.v 9 additions, 8 deletionstheories/collections.v
- theories/error.v 117 additions, 74 deletionstheories/error.v
- theories/fin_maps.v 64 additions, 20 deletionstheories/fin_maps.v
- theories/finite.v 17 additions, 14 deletionstheories/finite.v
- theories/hashset.v 36 additions, 19 deletionstheories/hashset.v
- theories/list.v 12 additions, 18 deletionstheories/list.v
- theories/tactics.v 0 additions, 34 deletionstheories/tactics.v
Loading
Please register or sign in to comment