Services

Todo

Descriptions for services have not been added yet.

This manual describes all services in Spoofax Core. A service is a class (and typically a singleton) that provides a single piece of functionality to the Spoofax Core system. Services can be accessed through facades, or injected through dependency injection.

Both MetaBorg, Spoofax, non-meta, and meta services are described. Each service has a corresponding interface which is the Java API to that service. Some services have specializations that specialize the interface in order to provide more specialized return types or additional method arguments.

MetaBorg services

Basic

Basic services provide low-level functionality.

Resource service
Interface:org.metaborg.core.resource.IResourceService
Source text service
Interface:org.metaborg.core.source.ISourceTextService

Language

Language services provide all language, language implementation, and language component related functionality.

Language service
Interface:org.metaborg.core.language.ILanguageService
Language identifier service
Interface:org.metaborg.core.language.ILanguageIdentifierService
Language discovery service
Interface:org.metaborg.core.language.ILanguageDiscoveryService
Dialect service
Interface:org.metaborg.core.language.dialect.IDialectService
Language paths service
Interface:org.metaborg.core.build.paths.ILanguagePathService
Language dependency service
Interface:org.metaborg.core.build.dependency.IDependencyService

Language processing

Language processing services provide services for the processing of files of a language.

Syntax service
Interface:org.metaborg.core.syntax.ISyntaxService
Specialization:org.metaborg.spoofax.core.syntax.ISpoofaxSyntaxService
Analysis service
Interface:org.metaborg.core.analysis.IAnalysisService
Specialization:org.metaborg.spoofax.core.analysis.ISpoofaxAnalysisService
Transformation service
Interface:org.metaborg.core.transform.ITransformService
Specialization:org.metaborg.spoofax.core.transform.ISpoofaxTransformService
Unit service
Interface:org.metaborg.core.unit.IUnitService
Specialization:org.metaborg.spoofax.core.unit.ISpoofaxUnitService
Input unit service

Sub-interface of the unit service that only provides methods for creating input units. Use this sub-interface when you only require creating input units for parsing.

Interface:org.metaborg.core.unit.IInputUnitService
Specialization:org.metaborg.spoofax.core.unit.ISpoofaxInputUnitService
Builder
Interface:org.metaborg.core.build.IBuilder
Specialization:org.metaborg.spoofax.core.build.ISpoofaxBuilder
Parse result processor
Interface:org.metaborg.core.processing.parse.IParseResultProcessor
Specialization:org.metaborg.spoofax.core.processing.parse.ISpoofaxParseResultProcessor
Analysis result processor
Interface:org.metaborg.core.processing.analyze.IAnalysisResultProcessor
Specialization:org.metaborg.spoofax.core.processing.analyze.ISpoofaxAnalysisResultProcessor

Context

Context services in MetaBorg provide a context for language processing tasks.

Project service
Interface:org.metaborg.core.project.IProjectService
Specialization:org.metaborg.core.project.ISimpleProjectService
Context service
Interface:org.metaborg.core.context.IContextService

Configuration

Configuration services provide read and write access to project and language component configuration at runtime.

See the language development manual on configuration for documentation about the Spoofax language specification configuration, which is a superset of the language specification, component, and project configuration.

Project configuration
Service
Interface:org.metaborg.core.config.IProjectConfigService
Builder
Interface:org.metaborg.core.config.IProjectConfigBuilder
Writer
Interface:org.metaborg.core.config.IProjectConfigWriter
Language component configuration
Service
Interface:org.metaborg.core.config.ILanguageComponentConfigService
Builder
Interface:org.metaborg.core.config.ILanguageComponentConfigBuilder
Writer
Interface:org.metaborg.core.config.ILanguageComponentConfigWriter

Spoofax services

Term factory service
Interface:org.metaborg.spoofax.core.terms.ITermFactoryService
Stratego runtime service
Interface:org.metaborg.spoofax.core.stratego.IStrategoRuntimeService
Common Stratego functionality
Interface:org.metaborg.spoofax.core.stratego.IStrategoCommon

MetaBorg-meta services

Project

Project services in MetaBorg-meta provide a context for language specification builds.

Language specification project service
Interface:org.metaborg.meta.core.project.ILanguageSpecService
Specialization:org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpecService

Configuration

Configuration services for language specifications. See the language development manual on configuration for documentation about the Spoofax language specification configuration.

Language specification configuration
Service
Interface:org.metaborg.meta.core.config.ILanguageSpecConfigService
Specialization:org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfigService
Builder
Interface:org.metaborg.meta.core.config.ILanguageSpecConfigBuilder
Specialization:org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfigBuilder
Writer
Interface:org.metaborg.meta.core.config.ILanguageSpecConfigWriter
Specialization:org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfigWriter

Spoofax-meta services

Language specification builder
Interface:org.metaborg.spoofax.meta.core.build.LanguageSpecBuilder