This is initial work on some refactoring of the AST and front-end. The main "accomplishment" in this batch of changes is to remove the StructSymbol type, in favor of just using the front-end StructSyntaxNode directly.
Other changes that happened, to enable this:
Type layout rules were moved into their own file, so that type layouts can be computed easily using either the front-end or back-end type representations (this is important because the SpireLib code was using the back-end type representation to expose reflection info, which mean it was coupled to the StructSymbol which ties front- and back-end together).
The logic for translating types from front-end to back-end representation was then moved out of its own file, and into the core code generator, since that is now the only place where we need to translate from front-end types to IL types.
I intend to systematically remove all the Symbol types, but to do so piece by piece. The StructSymbol case seemed like the least entangled one, and so the easiest place to start.
This is initial work on some refactoring of the AST and front-end. The main "accomplishment" in this batch of changes is to remove the
StructSymbol
type, in favor of just using the front-endStructSyntaxNode
directly.Other changes that happened, to enable this:
Type layout rules were moved into their own file, so that type layouts can be computed easily using either the front-end or back-end type representations (this is important because the SpireLib code was using the back-end type representation to expose reflection info, which mean it was coupled to the
StructSymbol
which ties front- and back-end together).The logic for translating types from front-end to back-end representation was then moved out of its own file, and into the core code generator, since that is now the only place where we need to translate from front-end types to IL types.
I intend to systematically remove all the
Symbol
types, but to do so piece by piece. TheStructSymbol
case seemed like the least entangled one, and so the easiest place to start.