As ffigen has developed we've gradually added more and more complexity to the addDependencies and toBindingString methods of the bindings classes. We should add a transformation step to the pipeline, before addDependencies, and move any logic that modifies the AST into this step.
It will probably be cleanest to have multiple separate transformations, rather than one big one. So we'll use a similar transformer pattern to the Dart CFE. This will also allow custom transformation steps in future. We'll probably also need to formalize/cleanup the AST representation a bit.
1: Clean up AST
2: Write transformer boilerplate
3 to N: Add a seperate transformer implementation for each of the AST modifying actions that currently happens in addDependencies and toBindingString. Could probably also port addDependencies to a transformer/visitor.
As ffigen has developed we've gradually added more and more complexity to the
addDependencies
andtoBindingString
methods of the bindings classes. We should add a transformation step to the pipeline, beforeaddDependencies
, and move any logic that modifies the AST into this step.It will probably be cleanest to have multiple separate transformations, rather than one big one. So we'll use a similar transformer pattern to the Dart CFE. This will also allow custom transformation steps in future. We'll probably also need to formalize/cleanup the AST representation a bit.
1: Clean up AST 2: Write transformer boilerplate 3 to N: Add a seperate transformer implementation for each of the AST modifying actions that currently happens in
addDependencies
andtoBindingString
. Could probably also port addDependencies to a transformer/visitor.