Currently, the RoboChart validator uses a fixed injected type RoboCalcTypeProvider for the type-checker, which makes it difficult to reuse the implementation, for example, for RoboSim.
The RoboSim validator RoboSimValidator extends RoboChartValidator, which uses RoboSimTypeProvider, a subclass of RoboCalcTypeProvider that knows how to handle the expressions specific to RoboSim. This has been ok so far, but is not ideal when extending the RoboSim language with further constructs.
I believe one way around this would be to follow @alvarohm's strategy in the implementation of the RoboChart CSP generator, where in addition to an injector, we have methods that return the object to be used. Subclasses can thus override the correct method to customize the implementation. I would suggest making a similar change in RoboChartValidator.
Currently, the RoboChart validator uses a fixed injected type RoboCalcTypeProvider for the type-checker, which makes it difficult to reuse the implementation, for example, for RoboSim.
The RoboSim validator RoboSimValidator extends RoboChartValidator, which uses RoboSimTypeProvider, a subclass of RoboCalcTypeProvider that knows how to handle the expressions specific to RoboSim. This has been ok so far, but is not ideal when extending the RoboSim language with further constructs.
I believe one way around this would be to follow @alvarohm's strategy in the implementation of the RoboChart CSP generator, where in addition to an injector, we have methods that return the object to be used. Subclasses can thus override the correct method to customize the implementation. I would suggest making a similar change in RoboChartValidator.