UoY-RoboStar / robochart-textual

This repository contains the plugins for the RoboChart textual editor
Eclipse Public License 2.0
0 stars 1 forks source link

Consider refactoring of extension RoboCalcTypeProvider in RoboChartValidator #53

Open pefribeiro opened 2 years ago

pefribeiro commented 2 years ago

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.