saker.build Documentation TaskDoc JavaDoc Packages
public interface ScriptModellingEngine extends AutoCloseable
Interface for providing modelling related functionality for a scripting language.

Script models are used to retrieve various informations from scripts. The responsibility of a modelling engine is to provide a context for the models to share information.

Modelling engines work with modelling environment which provide overall information about the present scripts for a build configuration. The modelling environment is passed to the engine at creation time.

Modelling engines should not hold references to unmanaged data. (E.g. file handles, network connections, etc...)

Modelling engines are not shared by modelling environments.

Methods
public void
Closes this modelling engine.
public ScriptSyntaxModel
createModel(ScriptParsingOptions parsingoptions, IOSupplier<extends ByteSource> baseinputsupplier)
Creates a model representation for the given script identified by the parsing options.
public void
Destroys a previously created script model from this engine.
public abstract void close()
Closes this modelling engine.

The engine should release references to models, and treat them as invalidated. The engine should not make any further calls to the modelling environment. After closing a modelling engine, further calls to its models might be made, but they should be treated as invalid script models.

This method throws no checked exceptions, as it should not fail. Modelling engines should not keep references to unmanaged resources like files, network connections, etc...

public abstract ScriptSyntaxModel createModel(ScriptParsingOptions parsingoptions, IOSupplier<extends ByteSource> baseinputsupplier)
Creates a model representation for the given script identified by the parsing options.

The created model is to be lazily populated, meaning that creating a model does not entitle parsing it at the time of this function call.

parsingoptionsThe parsing options associated with the created script model.
baseinputsupplierThe base input supplier. (See documentation of ScriptSyntaxModel)
The created script model.
public abstract void destroyModel(ScriptSyntaxModel model)
Destroys a previously created script model from this engine.

Destroying a model should result in releasing any resources associated to it, and treating the corresponding script as no longer existing. Any other models that depend on the currently destroyed model should update their underlying data.

modelThe model to destroy.