Spoofax API documentation¶
The API documentation contains all classes in MetaBorg Core, Spoofax Core, and their meta counterparts. This documentation is generated from the source code at the Spoofax GitHub repository.
Javadoc¶
org.metaborg.core¶
AggregateMetaborgException¶
-
public class
AggregateMetaborgException
extends MetaborgException¶
Constructors¶
AggregateMetaborgException¶
-
public
AggregateMetaborgException
(Iterable<MetaborgException> causes)¶
MetaBorg¶
-
public class
MetaBorg
implements AutoCloseable¶ Facade for instantiating and accessing the MetaBorg API. Call the public methods to perform common operations, or use the public final fields to access services directly. All services and operations available in this facade are implemented when using the default
MetaborgModule
.
Fields¶
autoCloseables¶
-
public final Set<AutoCloseable>
autoCloseables
¶
contextService¶
-
public final IContextService
contextService
¶
dependencyService¶
-
public final IDependencyService
dependencyService
¶
dialectProcessor¶
-
public final IDialectProcessor
dialectProcessor
¶
editorRegistry¶
-
public final IEditorRegistry
editorRegistry
¶
languageComponentFactory¶
-
public final ILanguageComponentFactory
languageComponentFactory
¶
languageDiscoveryService¶
-
public final ILanguageDiscoveryService
languageDiscoveryService
¶
languageIdentifierService¶
-
public final ILanguageIdentifierService
languageIdentifierService
¶
languagePathService¶
-
public final ILanguagePathService
languagePathService
¶
languageService¶
-
public final ILanguageService
languageService
¶
projectService¶
-
public final IProjectService
projectService
¶
resourceService¶
-
public final IResourceService
resourceService
¶
sourceTextService¶
-
public final ISourceTextService
sourceTextService
¶
Constructors¶
MetaBorg¶
-
public
MetaBorg
(IModulePluginLoader loader, MetaborgModule module, Module... additionalModules)¶ Instantiate the MetaBorg API.
Parameters: - loader – Module plugin loader to use.
- module – MetaBorg module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
MetaBorg¶
-
public
MetaBorg
(MetaborgModule module, Module... additionalModules)¶ Instantiate the MetaBorg API.
Parameters: - module – MetaBorg module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
MetaBorg¶
-
public
MetaBorg
(IModulePluginLoader loader, Module... additionalModules)¶ Instantiate the MetaBorg API.
Parameters: - loader – Module plugin loader to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Methods¶
close¶
-
public void
close
()¶ Closes the MetaBorg API, closing any resources and services created by the API.
defaultModule¶
-
protected static MetaborgModule
defaultModule
()¶
defaultPluginLoader¶
-
protected static IModulePluginLoader
defaultPluginLoader
()¶
discoverLanguages¶
-
public Iterable<ILanguageComponent>
discoverLanguages
(FileObject location)¶ See also:
ILanguageDiscoveryService.request(FileObject)
,ILanguageDiscoveryService.discover(ILanguageDiscoveryRequest)
identifyResource¶
-
public boolean
identifyResource
(FileObject resource, ILanguageImpl language)¶ See also:
ILanguageIdentifierService.identify(FileObject,ILanguageImpl)
identifyResource¶
-
public ILanguageImpl
identifyResource
(FileObject resource)¶
resolve¶
-
public FileObject
resolve
(String uri)¶ See also:
IResourceService.resolve(String)
resolve¶
-
public FileObject
resolve
(File file)¶ See also:
IResourceService.resolve(File)
resolve¶
-
public FileObject
resolve
(URI uri)¶ See also:
IResourceService.resolve(URI)
scanLanguagesInDirectory¶
-
public Set<ILanguageImpl>
scanLanguagesInDirectory
(FileObject directory)¶ See also:
ILanguageDiscoveryService.scanLanguagesInDirectory(FileObject)
MetaBorgGeneric¶
-
public class
MetaBorgGeneric
<I extends IInputUnit, P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>, F> extends MetaBorg¶ Generic version of the
MetaBorg
facade. Call the public methods to perform common operations, or use the public final fields to access services directly. This facade should only be used with a module that implements these services, like the Spoofax module, or through a subclassed facade like to the Spoofax facade. Using this facade with theMetaborgModule
will cause an exception on construction.Parameters: - <I> – Type of input units.
- <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units with any input.
- <TP> – Type of transform units with parse units as input.
- <TA> – Type of transform units with analyze units as input.
- <F> – Type of fragments.
Fields¶
actionService¶
-
public final IActionService
actionService
¶
analysisResultProcessor¶
-
public final IAnalysisResultProcessor<I, P, A>
analysisResultProcessor
¶
analysisResultRequester¶
-
public final IAnalysisResultRequester<I, A>
analysisResultRequester
¶
analysisService¶
-
public final IAnalysisService<P, A, AU>
analysisService
¶
categorizerService¶
-
public final ICategorizerService<P, A, F>
categorizerService
¶
completionService¶
-
public final ICompletionService<P>
completionService
¶
dialectIdentifier¶
-
public final IDialectIdentifier
dialectIdentifier
¶
dialectService¶
-
public final IDialectService
dialectService
¶
hoverService¶
-
public final IHoverService<P, A>
hoverService
¶
outlineService¶
-
public final IOutlineService<P, A>
outlineService
¶
parseResultProcessor¶
-
public final IParseResultProcessor<I, P>
parseResultProcessor
¶
processorRunner¶
-
public final IProcessorRunner<P, A, AU, T>
processorRunner
¶
resolverService¶
-
public final IResolverService<P, A>
resolverService
¶
stylerService¶
-
public final IStylerService<F>
stylerService
¶
syntaxService¶
-
public final ISyntaxService<I, P>
syntaxService
¶
tracingService¶
-
public final ITracingService<P, A, T, F>
tracingService
¶
transformService¶
-
public final ITransformService<P, A, TP, TA>
transformService
¶
unitService¶
-
public final IUnitService<I, P, A, AU, TP, TA>
unitService
¶
Constructors¶
MetaBorgGeneric¶
-
public
MetaBorgGeneric
(Class<I> iClass, Class<P> pClass, Class<A> aClass, Class<AU> auClass, Type tClass, Type tpClass, Type taClass, Class<F> fClass, IModulePluginLoader loader, MetaborgModule module, Module... additionalModules)¶ Instantiate the generic MetaBorg API.
Parameters: - loader – Module plugin loader to use.
- module – MetaBorg module to use, which should implement all services in this facade. Do not use
MetaborgModule
. - additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
MetaBorgGeneric¶
-
public
MetaBorgGeneric
(Class<I> iClass, Class<P> pClass, Class<A> aClass, Class<AU> auClass, Class<T> tClass, Class<TP> tpClass, Class<TA> taClass, Class<F> fClass, MetaborgModule module, Module... additionalModules)¶ Instantiate the generic MetaBorg API.
Parameters: - module – MetaBorg module to use, which should implement all services in this facade. Do not use
MetaborgModule
. - additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
- module – MetaBorg module to use, which should implement all services in this facade. Do not use
MetaborgException¶
MetaborgModule¶
-
public class
MetaborgModule
extends AbstractModule¶ Guice module that specifies which implementations to use for services and factories.
Fields¶
autoClosableBinder¶
-
protected Multibinder<AutoCloseable>
autoClosableBinder
¶
contextFactoryBinder¶
-
protected MapBinder<String, IContextFactory>
contextFactoryBinder
¶
contextStrategyBinder¶
-
protected MapBinder<String, IContextStrategy>
contextStrategyBinder
¶
languageCacheBinder¶
-
protected Multibinder<ILanguageCache>
languageCacheBinder
¶
languagePathProviderBinder¶
-
protected Multibinder<ILanguagePathProvider>
languagePathProviderBinder
¶
Constructors¶
MetaborgModule¶
-
public
MetaborgModule
(ClassLoader resourceClassLoader)¶
Methods¶
bindContextFactories¶
-
protected void
bindContextFactories
(MapBinder<String, IContextFactory> binder)¶
bindContextStrategies¶
-
protected void
bindContextStrategies
(MapBinder<String, IContextStrategy> binder)¶
bindLanguagePathProviders¶
-
protected void
bindLanguagePathProviders
(Multibinder<ILanguagePathProvider> binder)¶
MetaborgRuntimeException¶
-
public class
MetaborgRuntimeException
extends RuntimeException¶
Constructors¶
org.metaborg.core.action¶
CompileGoal¶
-
public class
CompileGoal
implements ITransformGoal¶
EndNamedGoal¶
-
public class
EndNamedGoal
implements ITransformGoal¶ Named transform goal that points to a builder in a menu, without qualified menu names.
IActionService¶
-
public interface
IActionService
¶
Methods¶
actionContributions¶
-
Iterable<TransformActionContrib>
actionContributions
(ILanguageImpl language, ITransformGoal goal)¶ Gets transform action contributions for given transform goal.
Parameters: - language – Language implementation to get transform actions from.
- goal – Goal to get transform actions for.
Returns: Transform action contributions.
actions¶
-
Iterable<ITransformAction>
actions
(ILanguageImpl language, ITransformGoal goal)¶ Gets transform actions for given goal.
Parameters: - language – Language implementation to get transform actions from.
- goal – Goal to get transform actions for.
Returns: Transform actions.
available¶
-
boolean
available
(ILanguageImpl language, ITransformGoal goal)¶ Checks if transform actions are available for given transform goal.
Parameters: - language – Language implementation to check transform actions from.
- goal – Goal to check transform actions for.
Returns: True if transform actions are available, false if not.
requiresAnalysis¶
-
boolean
requiresAnalysis
(ILanguageImpl language, ITransformGoal goal)¶ Checks if analysis is required for given transform goal.
Parameters: - language – Language implementation to check from.
- goal – Goal to check for.
Returns: True if analysis is required, false if not.
ITransformAction¶
ITransformGoal¶
-
public interface
ITransformGoal
extends Serializable¶ Tag interface for transformation goals.
NamedGoal¶
-
public class
NamedGoal
implements ITransformGoal¶ Named transform goal that points to a builder in a menu via a list of menu names and builder name.
TransformActionContrib¶
-
public class
TransformActionContrib
¶
Fields¶
action¶
-
public final ITransformAction
action
¶
contributor¶
-
public final ILanguageComponent
contributor
¶
Constructors¶
TransformActionContrib¶
-
public
TransformActionContrib
(ITransformAction action, ILanguageComponent contributor)¶
TransformActionFlags¶
-
public class
TransformActionFlags
¶
Fields¶
openEditor¶
-
public boolean
openEditor
¶ Flag indicating if the result of this action should be shown in a new editor.
Constructors¶
Methods¶
merge¶
-
public static TransformActionFlags
merge
(TransformActionFlags x, TransformActionFlags y)¶
org.metaborg.core.analysis¶
AnalysisException¶
-
public class
AnalysisException
extends MetaborgException¶ Exception indicating that analysis failed unexpectedly.
Constructors¶
AnalysisService¶
-
public class
AnalysisService
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate> implements IAnalysisService<P, A, AU>¶
Methods¶
analyze¶
-
public IAnalyzeResult<A, AU>
analyze
(P input, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
public IAnalyzeResults<A, AU>
analyzeAll
(Iterable<P> inputs, IContext context, IProgress progress, ICancel cancel)¶
available¶
-
public boolean
available
(ILanguageImpl langImpl)¶
AnalyzeResult¶
-
public class
AnalyzeResult
<A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate> implements IAnalyzeResult<A, AU>¶
Constructors¶
AnalyzeResult¶
-
public
AnalyzeResult
(A result, Collection<AU> updates, IContext context)¶
AnalyzeResults¶
-
public class
AnalyzeResults
<A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate> implements IAnalyzeResults<A, AU>¶
Constructors¶
AnalyzeResults¶
-
public
AnalyzeResults
(Collection<A> results, Collection<AU> updates, IContext context)¶
AnalyzeResults¶
-
public
AnalyzeResults
(Collection<A> results, IContext context)¶
AnalyzerFacet¶
IAnalysisService¶
-
public interface
IAnalysisService
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate>¶ Interface for context-sensitive analysis of parse units.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
Methods¶
analyze¶
-
IAnalyzeResult<A, AU>
analyze
(P input, IContext context, IProgress progress, ICancel cancel)¶ Analyzes given parse input, in given context, into an analysis result which contains an analyze unit and optionally updates to analyze units.
Parameters: - input – Parse unit to analyze.
- context – Context to perform analysis in.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - InterruptedException – When analysis is cancelled.
- AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains an analyze unit and optionally updates to analyze units.
analyze¶
-
IAnalyzeResult<A, AU>
analyze
(P input, IContext context)¶ Analyzes given parse input, in given context, into an analysis result which contains an analyze unit and optionally updates to analyze units.
Parameters: - input – Parse unit to analyze.
- context – Context to perform analysis in.
Throws: - AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains an analyze unit and optionally updates to analyze units.
analyzeAll¶
-
IAnalyzeResults<A, AU>
analyzeAll
(Iterable<P> inputs, IContext context, IProgress progress, ICancel cancel)¶ Analyzes given parse input, in given context, into an analysis result which contains an analyze unit and optionally updates to analyze units.
Parameters: - input – Parse unit to analyze.
- context – Context to perform analysis in.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - InterruptedException – When analysis is cancelled.
- AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains an analyze unit and optionally updates to analyze units.
analyzeAll¶
-
IAnalyzeResults<A, AU>
analyzeAll
(Iterable<P> inputs, IContext context)¶ Analyzes given parse input, in given context, into an analysis result which contains an analyze unit and optionally updates to analyze units.
Parameters: - input – Parse unit to analyze.
- context – Context to perform analysis in.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains an analyze unit and optionally updates to analyze units.
available¶
-
boolean
available
(ILanguageImpl langImpl)¶ Checks if analysis is available for given language implementation.
Parameters: - langImpl – Language implementation to check.
Returns: True if analysis is a available, false if not.
IAnalyzeResult¶
-
public interface
IAnalyzeResult
<A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate>¶ Result of the analysis of a single parse unit.
Parameters: - <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
IAnalyzeResults¶
-
public interface
IAnalyzeResults
<A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate>¶ Result of the analysis of a multiple parse units.
Parameters: - <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
Methods¶
results¶
-
Collection<A>
results
()¶ Returns: Resulting analyze units of the analysis.
updates¶
-
Collection<AU>
updates
()¶ Returns: Updates to existing analyze units.
IAnalyzeUnit¶
-
public interface
IAnalyzeUnit
extends IUnit¶ Unit representing an analyzed source file. An analyze unit can be passed to the
ITransformService
to transform the parse unit into aITransformUnit
Methods¶
duration¶
-
long
duration
()¶ Returns: Analysis duration in nanoseconds, or -1 if the duration is unknown.
input¶
-
IParseUnit
input
()¶ Returns: The parse unit this unit was made with.
IAnalyzeUnitUpdate¶
-
public interface
IAnalyzeUnitUpdate
¶ An update to an analyze unit, made from analyzing a different unit.
IAnalyzer¶
-
public interface
IAnalyzer
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate>¶ Interface for a context-sensitive analyzer implementation.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
Methods¶
analyze¶
-
IAnalyzeResult<A, AU>
analyze
(P input, IContext context, IProgress progress, ICancel cancel)¶ Analyzes given parse input, in given context, into an analysis result which contains an analyze unit and optionally updates to analyze units.
Parameters: - input – Parse unit to analyze.
- context – Context to perform analysis in.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - InterruptedException – When analysis is cancelled.
- AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains an analyze unit and optionally updates to analyze units.
analyzeAll¶
-
IAnalyzeResults<A, AU>
analyzeAll
(Iterable<P> inputs, IContext context, IProgress progress, ICancel cancel)¶ Analyzes given parse inputs, in given context, into an analysis result which contains analyze units and optionally updates to analyze units.
Parameters: - inputs – Parse units to analyze.
- context – Context to perform analysis in.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - InterruptedException – When analysis is cancelled.
- AnalysisException – When analysis fails unexpectedly.
Returns: Analysis result which contains analyze units and optionally updates to analyze units.
org.metaborg.core.build¶
BuildInput¶
-
public class
BuildInput
¶ Input for a build. Use the
BuildInputBuilder
fluent interface to create objects of this class.See also:
BuildInputBuilder
Fields¶
analyzeSelector¶
-
public final FileSelector
analyzeSelector
¶ File selector to determine which resources should be analyzed, or null to analyze everything.
buildOrder¶
-
public final BuildOrder
buildOrder
¶ Language build order.
includePaths¶
-
public final Multimap<ILanguageImpl, FileObject>
includePaths
¶ Per-language include paths;
messagePrinter¶
-
public final IMessagePrinter
messagePrinter
¶ Message printer to use during build, or null to skip printing messages.
pardonedLanguages¶
-
public final Set<ILanguageImpl>
pardonedLanguages
¶ Languages for which errors are pardoned; prevents throwing an exception when
throwOnErrors
is true.
selector¶
-
public final FileSelector
selector
¶ File selector to determine which resources should be processed, or null to process everything.
sourceChanges¶
-
public final Iterable<ResourceChange>
sourceChanges
¶ Sources that have changed.
state¶
-
public final BuildState
state
¶ Build state with information about previous builds.
throwOnErrors¶
-
public final boolean
throwOnErrors
¶ If an exception should be thrown when there are parsing, analysis, or transformation errors.
transformGoals¶
-
public final Iterable<ITransformGoal>
transformGoals
¶ Transformer goals to execute on analyzed or parsed results.
transformSelector¶
-
public final FileSelector
transformSelector
¶ File selector to determine which resources should be transformed, or null to transform everything.
Constructors¶
BuildInput¶
-
public
BuildInput
(BuildState state, IProject project, Iterable<ResourceChange> resourceChanges, Multimap<ILanguageImpl, FileObject> includePaths, BuildOrder buildOrder, FileSelector parseSelector, boolean analyze, FileSelector analyzeSelector, boolean transform, FileSelector transformSelector, Iterable<ITransformGoal> transformGoals, IMessagePrinter messagePrinter, boolean throwOnErrors, Set<ILanguageImpl> pardonedLanguages)¶
BuildInputBuilder¶
-
public class
BuildInputBuilder
¶ Fluent interface for creating
BuildInput
objects.See also:
BuildInput
Methods¶
addComponent¶
-
public BuildInputBuilder
addComponent
(ILanguageComponent component)¶ Adds languages from given language component.
addComponents¶
-
public BuildInputBuilder
addComponents
(Iterable<? extends ILanguageComponent> components)¶ Adds languages from given language components.
addIdentifiedSources¶
-
public BuildInputBuilder
addIdentifiedSources
(Iterable<IdentifiedResource> sources)¶ Add addition source changes from given identified sources.
addIncludePaths¶
-
public BuildInputBuilder
addIncludePaths
(ILanguageImpl language, Iterable<FileObject> includePaths)¶ Add given include files for given language.
addLanguage¶
-
public BuildInputBuilder
addLanguage
(ILanguageImpl language)¶ Adds a single language implementation.
addLanguages¶
-
public BuildInputBuilder
addLanguages
(Iterable<? extends ILanguageImpl> languages)¶ Adds given language implementations.
addPardonedLanguage¶
-
public BuildInputBuilder
addPardonedLanguage
(ILanguageImpl pardonedLanguage)¶ Adds a single pardoned language.
addPardonedLanguageString¶
-
public BuildInputBuilder
addPardonedLanguageString
(String pardonedLanguage)¶ Adds a single pardoned language from given language name.
addSource¶
-
public BuildInputBuilder
addSource
(IdentifiedResource source)¶ Adds a single addition source change from given identified source.
addSource¶
-
public BuildInputBuilder
addSource
(FileObject source)¶ Adds a single addition source change from given source.
addSourceChanges¶
-
public BuildInputBuilder
addSourceChanges
(Iterable<ResourceChange> sourceChanges)¶ Adds a source change.
addSources¶
-
public BuildInputBuilder
addSources
(Iterable<FileObject> sources)¶ Add addition source changes from given sources.
addSourcesFromSourceLocations¶
-
public BuildInputBuilder
addSourcesFromSourceLocations
(Iterable<FileObject> sourceLocations)¶ Add addition source changes from source files at given source locations.
addTransformGoal¶
-
public BuildInputBuilder
addTransformGoal
(ITransformGoal goal)¶ Adds a single transform goal.
build¶
-
public BuildInput
build
(IDependencyService dependencyService, ILanguagePathService languagePathService)¶ Builds a build input object from the current state.
Throws: - MetaborgException – When
IDependencyService.compileDeps
throws.
- MetaborgException – When
reset¶
-
public BuildInputBuilder
reset
()¶ Resets the builder to its original state.
withAnalysis¶
-
public BuildInputBuilder
withAnalysis
(boolean analyze)¶ Sets if analysis should be executed. Defaults to true.
withAnalyzeSelector¶
-
public BuildInputBuilder
withAnalyzeSelector
(FileSelector analyzeSelector)¶ Sets the analysis file selector to given selector.
withCompileDependencyLanguages¶
-
public BuildInputBuilder
withCompileDependencyLanguages
(boolean addDependencyLanguages)¶ Sets if compile time dependencies should be added to languages when the input is built. Defaults to true.
withComponents¶
-
public BuildInputBuilder
withComponents
(Iterable<ILanguageComponent> components)¶ Sets the languages from given language components.
withDefaultIncludePaths¶
-
public BuildInputBuilder
withDefaultIncludePaths
(boolean addDefaultIncludePaths)¶ Sets if default include files should be added when the input is build. Defaults to true.
withIncludePaths¶
-
public BuildInputBuilder
withIncludePaths
(Multimap<ILanguageImpl, FileObject> includePaths)¶ Sets the include files to given files.
withLanguages¶
-
public BuildInputBuilder
withLanguages
(Set<ILanguageImpl> languages)¶ Sets the languages to given language implementations.
withLanguages¶
-
public BuildInputBuilder
withLanguages
(Iterable<ILanguageImpl> languages)¶ Sets the languages to given language implementations.
withMessagePrinter¶
-
public BuildInputBuilder
withMessagePrinter
(IMessagePrinter messagePrinter)¶ Sets the message printer to given message printer.
withPardonedLanguageStrings¶
-
public BuildInputBuilder
withPardonedLanguageStrings
(Iterable<String> pardonedLanguages)¶ Set the pardoned languages from given language names.
withPardonedLanguages¶
-
public BuildInputBuilder
withPardonedLanguages
(Set<ILanguageImpl> pardonedLanguages)¶ Set the pardoned languages from given set of pardoned languages.
withSelector¶
-
public BuildInputBuilder
withSelector
(FileSelector selector)¶ Sets the file selector to given selector.
withSourceChanges¶
-
public BuildInputBuilder
withSourceChanges
(Collection<ResourceChange> sourceChanges)¶ Sets the source changes to given resource changes.
withSourceChanges¶
-
public BuildInputBuilder
withSourceChanges
(Iterable<ResourceChange> sourceChanges)¶ Sets the source changes to given resource changes.
withSources¶
-
public BuildInputBuilder
withSources
(Iterable<FileObject> sources)¶ Set the source changes to additions from given sources.
withSourcesFromDefaultSourceLocations¶
-
public BuildInputBuilder
withSourcesFromDefaultSourceLocations
(boolean addSourcesFromDefaultSourceLocations)¶ Sets if addition source changes should be added from source at default source locations, when the input is built. Defaults to false.
withState¶
-
public BuildInputBuilder
withState
(BuildState state)¶ Sets the build state to given build state.
withThrowOnErrors¶
-
public BuildInputBuilder
withThrowOnErrors
(boolean throwOnErrors)¶ Sets if a runtime exception should be thrown when errors occur. Defaults to false.
withTransformGoals¶
-
public BuildInputBuilder
withTransformGoals
(Collection<ITransformGoal> transformGoals)¶ Sets the transform goals to given transform goals.
withTransformSelector¶
-
public BuildInputBuilder
withTransformSelector
(FileSelector transformSelector)¶ Sets the transformation file selector to given selector.
withTransformation¶
-
public BuildInputBuilder
withTransformation
(boolean transform)¶ Sets if transformations should be executed. Defaults to true.
BuildOrder¶
-
public class
BuildOrder
¶ Language build order calculation.
Constructors¶
BuildOrder¶
-
public
BuildOrder
(Iterable<ILanguageImpl> languages)¶ Creates a build order for given languages, using their dependencies.
Parameters: - languages – Languages to create a build order for.
Throws: - MetaborgRuntimeException – When there is a cyclic dependency between languages.
Methods¶
buildOrder¶
-
public Iterable<ILanguageImpl>
buildOrder
()¶ Returns: Build order.
languages¶
-
public Iterable<ILanguageImpl>
languages
()¶ Returns: Languages in this build order, in the same order that they were passed in the constructor.
BuildOutput¶
-
public class
BuildOutput
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>> implements IBuildOutputInternal<P, A, AU, T>¶
Fields¶
analysisResults¶
-
public final Collection<A>
analysisResults
¶
analysisUpdates¶
-
public final Collection<AU>
analysisUpdates
¶
changedResources¶
-
public final Collection<FileObject>
changedResources
¶
extraMessages¶
-
public final Collection<IMessage>
extraMessages
¶
parseResults¶
-
public final Collection<P>
parseResults
¶
state¶
-
public BuildState
state
¶
transformResults¶
-
public final Collection<T>
transformResults
¶
Methods¶
add¶
changedResources¶
-
public Iterable<FileObject>
changedResources
()¶
setState¶
-
public void
setState
(BuildState state)¶
state¶
-
public BuildState
state
()¶
BuildState¶
-
public class
BuildState
¶
Methods¶
add¶
-
public void
add
(ILanguageImpl language, LanguageBuildState state)¶
get¶
-
public LanguageBuildState
get
(IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ILanguageImpl language)¶
Builder¶
-
public class
Builder
<I extends IInputUnit, P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>> implements IBuilder<P, A, AU, T>¶ Builder implementation.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units with any input.
- <TP> – Type of transform units with parse units as input.
- <TA> – Type of transform units with analyze units as input.
Constructors¶
Builder¶
-
public
Builder
(IResourceService resourceService, ILanguageIdentifierService languageIdentifier, ILanguagePathService languagePathService, IUnitService<I, P, A, AU, TP, TA> unitService, ISourceTextService sourceTextService, ISyntaxService<I, P> syntaxService, IContextService contextService, IAnalysisService<P, A, AU> analysisService, ITransformService<P, A, TP, TA> transformService, IParseResultUpdater<P> parseResultUpdater, IAnalysisResultUpdater<P, A> analysisResultUpdater, Provider<IBuildOutputInternal<P, A, AU, T>> buildOutputProvider)¶
Methods¶
build¶
-
public IBuildOutput<P, A, AU, T>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
clean¶
-
public void
clean
(CleanInput input, IProgress progress, ICancel cancel)¶
CleanInput¶
-
public class
CleanInput
¶ Input for a clean build.
Fields¶
languages¶
-
public final Iterable<ILanguageImpl>
languages
¶ Languages to run clean operations for.
selector¶
-
public final FileSelector
selector
¶ File selector to determine which resources are eligible for cleaning, or null to allow everything to be cleaned.
Constructors¶
CleanInput¶
-
public
CleanInput
(IProject project, Iterable<ILanguageImpl> languages, FileSelector selector)¶
CleanInputBuilder¶
-
public class
CleanInputBuilder
¶
Methods¶
addComponent¶
-
public CleanInputBuilder
addComponent
(ILanguageComponent component)¶ Adds languages from given language component.
addComponents¶
-
public CleanInputBuilder
addComponents
(Iterable<? extends ILanguageComponent> components)¶ Adds languages from given language components.
addLanguage¶
-
public CleanInputBuilder
addLanguage
(ILanguageImpl language)¶ Adds a single language implementation.
addLanguages¶
-
public CleanInputBuilder
addLanguages
(Iterable<? extends ILanguageImpl> languages)¶ Adds given language implementations.
build¶
-
public CleanInput
build
(IDependencyService dependencyService)¶ Builds a clean input object from the current state.
Throws: - MetaborgException – When
IDependencyService.compileDeps(IProject)
throws.
- MetaborgException – When
withCompileDependencyLanguages¶
-
public CleanInputBuilder
withCompileDependencyLanguages
(boolean addDependencyLanguages)¶ Sets if compile time dependencies should be added to languages when the input is built. Defaults to true.
withComponents¶
-
public CleanInputBuilder
withComponents
(Iterable<ILanguageComponent> components)¶ Sets the languages from given language components.
withLanguages¶
-
public CleanInputBuilder
withLanguages
(Set<ILanguageImpl> languages)¶ Sets the languages to given language implementations.
withSelector¶
-
public CleanInputBuilder
withSelector
(FileSelector selector)¶ Sets the file selector to given selector.
CommonPaths¶
-
public class
CommonPaths
¶
Constructors¶
CommonPaths¶
-
public
CommonPaths
(FileObject root)¶
Methods¶
find¶
-
protected FileObject
find
(Iterable<FileObject> dirs, String path)¶
mbComponentConfigFile¶
-
public FileObject
mbComponentConfigFile
()¶ Returns: Metaborg component configuration file.
replicateDir¶
-
public FileObject
replicateDir
()¶ Returns: Target output directory for replicated resources.
resolve¶
-
protected FileObject
resolve
(FileObject dir, String path)¶
resolve¶
-
protected FileObject
resolve
(FileObject dir, String... paths)
root¶
-
public FileObject
root
()¶ Returns: Root directory.
srcGenDir¶
-
public FileObject
srcGenDir
()¶ Returns: Generated sources directory. All generated source code (Stratego, SDF, config files, etc.) go into this directory.
targetDir¶
-
public FileObject
targetDir
()¶ Returns: Target output directory. All compiled outputs go into this directory.
targetMetaborgDir¶
-
public FileObject
targetMetaborgDir
()¶ Returns: Target output directory for compiled MetaBorg artifacts (Stratego JAR, parse table, etc.). All compiled artifacts that should be included with the language go into this directory.
transDir¶
-
public FileObject
transDir
()¶ Returns: Transformations directory. Contains the Stratego definition, NaBL definition, TS definition, and DynSem definition.
FilesBuildState¶
-
class
FilesBuildState
¶
Fields¶
IBuildOutput¶
-
public interface
IBuildOutput
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>>¶ Output generated by a build.
Parameters: - <P> – Type of parse units
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units.
Methods¶
allMessages¶
analysisResults¶
changedResources¶
-
Iterable<FileObject>
changedResources
()¶ Returns: Resources that were added or changed prior to the build.
includedResources¶
parseResults¶
-
Iterable<P>
parseResults
()¶ Returns: Parse results for changed resources. If parsing fails exceptionally by a ParseException
orIOException
, there is no parse result for that resource.
removedResources¶
state¶
-
BuildState
state
()¶ Returns: State produced by the build.
IBuildOutputInternal¶
-
public interface
IBuildOutputInternal
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>> extends IBuildOutput<P, A, AU, T>¶
IBuilder¶
-
public interface
IBuilder
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>>¶ Incrementally parses, analyzes, and compiles source files.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units with any input.
Methods¶
build¶
-
IBuildOutput<P, A, AU, T>
build
(BuildInput input, IProgress progress, ICancel cancel)¶ Parses, analyses, and compiles changed resources.
Parameters: - input – Build input.
- progress – Progress reporter used for reporting build progress.
- cancel – Cancellation token for canceling the build.
Throws: - InterruptedException – When build is cancelled.
- MetaborgRuntimeException – When
input.throwOnErrors
is set to true and errors occur.
Returns: Result of building.
build¶
-
IBuildOutput<P, A, AU, T>
build
(BuildInput input)¶ Parses, analyzes, and compiles changed resources.
Parameters: - input – Build input.
Throws: - InterruptedException – When build is cancelled.
- MetaborgRuntimeException – When
input.throwOnErrors
is set to true and errors occur.
Returns: Result of building.
clean¶
-
void
clean
(CleanInput input, IProgress progress, ICancel cancellation)¶ Cleans derived resources and contexts from given location.
Parameters: - input – Clean input.
- progress – Progress reporter used for reporting clean progress.
- cancellation – Cancellation token for canceling the clean.
Throws: - InterruptedException – When clean is cancelled.
clean¶
-
void
clean
(CleanInput input)¶ Cleans derived resources and contexts from given location.
Parameters: - input – Clean input.
Throws: - InterruptedException – When clean is cancelled.
LanguageBuildDiff¶
-
public class
LanguageBuildDiff
¶
Fields¶
includeChanges¶
-
public final Iterable<IdentifiedResourceChange>
includeChanges
¶
newState¶
-
public final LanguageBuildState
newState
¶
sourceChanges¶
-
public final Iterable<IdentifiedResourceChange>
sourceChanges
¶
Constructors¶
LanguageBuildDiff¶
-
public
LanguageBuildDiff
(LanguageBuildState newState, Iterable<IdentifiedResourceChange> sourceFileChanges, Iterable<IdentifiedResourceChange> includeFileChanges)¶
LanguageBuildState¶
-
public class
LanguageBuildState
¶
Constructors¶
LanguageBuildState¶
-
public
LanguageBuildState
(IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ILanguageImpl language)¶
Methods¶
diff¶
-
public LanguageBuildDiff
diff
(Iterable<IdentifiedResourceChange> sourceFileChanges, Iterable<IdentifiedResource> newIncludeFiles)¶
ResourceModificationInfo¶
-
class
ResourceModificationInfo
¶
Fields¶
resource¶
-
public final FileObject
resource
¶
Constructors¶
ResourceModificationInfo¶
-
public
ResourceModificationInfo
(FileObject resource)¶
ResourceModificationInfo¶
-
public
ResourceModificationInfo
(FileObject resource, long modificationDate)¶
UpdateKind¶
-
public enum
UpdateKind
¶
Enum Constants¶
Error¶
-
public static final UpdateKind
Error
¶
Invalidate¶
-
public static final UpdateKind
Invalidate
¶
Remove¶
-
public static final UpdateKind
Remove
¶
Update¶
-
public static final UpdateKind
Update
¶
org.metaborg.core.build.dependency¶
DefaultDependencyService¶
-
public final class
DefaultDependencyService
implements IDependencyService¶ Default implementation of the
IDependencyService
interface.
Constructors¶
DefaultDependencyService¶
-
public
DefaultDependencyService
(ILanguageService languageService)¶
Methods¶
checkDependencies¶
-
public MissingDependencies
checkDependencies
(IProject project)¶
compileDeps¶
-
public Collection<ILanguageComponent>
compileDeps
(IProject project)¶
sourceDeps¶
-
public Collection<ILanguageComponent>
sourceDeps
(IProject project)¶
sourceDeps¶
-
public Collection<ILanguageComponent>
sourceDeps
(ILanguageComponent component)¶
IDependencyService¶
-
public interface
IDependencyService
¶ Returns compile and source dependencies for a project or language component.
Methods¶
checkDependencies¶
-
MissingDependencies
checkDependencies
(IProject project)¶ Checks if compile and source dependencies for the given project are loaded; and returns any missing dependencies.
Parameters: - project – Project to check the dependencies for.
Returns: Missing dependencies.
compileDeps¶
-
Collection<ILanguageComponent>
compileDeps
(IProject project)¶ Gets compile dependencies for the given project.
Parameters: - project – Project to get dependencies for.
Returns: Compile dependencies.
sourceDeps¶
-
Collection<ILanguageComponent>
sourceDeps
(IProject project)¶ Gets source dependencies for the given project.
Parameters: - project – Project to get dependencies for.
Returns: Source dependencies.
sourceDeps¶
-
Collection<ILanguageComponent>
sourceDeps
(ILanguageComponent component)¶ Gets source dependencies for the given language component.
Parameters: - component – Language component to get dependencies for.
Returns: Source dependencies.
MissingDependencies¶
-
public class
MissingDependencies
¶
Fields¶
compile¶
-
public final Iterable<LanguageIdentifier>
compile
¶
runtime¶
-
public final Iterable<LanguageIdentifier>
runtime
¶
Constructors¶
MissingDependencies¶
-
public
MissingDependencies
(Iterable<LanguageIdentifier> compile, Iterable<LanguageIdentifier> runtime)¶
MissingDependencyException¶
-
public class
MissingDependencyException
extends MetaborgException¶ Thrown when a dependency is not found or not loaded.
Constructors¶
MissingDependencyException¶
-
public
MissingDependencyException
(String message, Throwable cause)¶ Initializes a new instance of the
MissingDependencyException
class.Parameters: - message – The error message; or
null
. - cause – The exception cause; or
null
.
- message – The error message; or
MissingDependencyException¶
-
public
MissingDependencyException
(String message)¶ Initializes a new instance of the
MissingDependencyException
class.Parameters: - message – The error message; or
null
.
- message – The error message; or
MissingDependencyException¶
-
public
MissingDependencyException
(Throwable cause)¶ Initializes a new instance of the
MissingDependencyException
class.Parameters: - cause – The exception cause; or
null
.
- cause – The exception cause; or
MissingDependencyException¶
-
public
MissingDependencyException
()¶ Initializes a new instance of the
MissingDependencyException
class.
org.metaborg.core.build.paths¶
DependencyPathProvider¶
-
public class
DependencyPathProvider
implements ILanguagePathProvider¶
Constructors¶
DependencyPathProvider¶
-
public
DependencyPathProvider
(IDependencyService dependencyService)¶
ILanguagePathProvider¶
-
public interface
ILanguagePathProvider
¶ Interface for providers for source and include paths.
Methods¶
includePaths¶
-
Iterable<FileObject>
includePaths
(IProject project, String languageName)¶ Gets include paths in given project, for given language.
Parameters: - project – Project to get include paths relative to.
- languageName – Name of the language to get include paths for.
Throws: - MetaborgException – When getting include paths fails unexpectedly.
Returns: Include paths.
sourcePaths¶
-
Iterable<FileObject>
sourcePaths
(IProject project, String languageName)¶ Gets source paths in given project, for given language.
Parameters: - project – Project to get source paths relative to.
- languageName – Name of the language to get source paths for.
Throws: - MetaborgException – When getting source paths fails unexpectedly.
Returns: Source paths.
ILanguagePathService¶
-
public interface
ILanguagePathService
¶ Interface for service that returns source/include paths/files for languages.
Methods¶
includeFiles¶
-
Iterable<IdentifiedResource>
includeFiles
(IProject project, ILanguageImpl language)¶ Gets include files in given project, for given language.
Parameters: - project – Project to get include files relative to.
- language – Language to get include files for.
Returns: Identified include files.
includePaths¶
-
Iterable<FileObject>
includePaths
(IProject project, String languageName)¶ Gets include paths in given project, for given language.
Parameters: - project – Project to get include paths relative to.
- languageName – Name of the language to get include paths for.
Returns: Include paths.
sourceAndIncludeFiles¶
-
Iterable<IdentifiedResource>
sourceAndIncludeFiles
(IProject project, ILanguageImpl language)¶ Gets source and include files in given project, for given language.
Parameters: - project – Project to get source and include files relative to.
- language – Language to get source and include files for.
Returns: Identified source and include files.
sourceAndIncludePaths¶
-
Iterable<FileObject>
sourceAndIncludePaths
(IProject project, String languageName)¶ Gets source and include paths in given project, for given language.
Parameters: - project – Project to get source and include paths relative to.
- languageName – Name of the language to get source and include paths for.
Returns: Source and include paths.
sourceFiles¶
-
Iterable<IdentifiedResource>
sourceFiles
(IProject project, ILanguageImpl language)¶ Gets source files in given project, for given language.
Parameters: - project – Project to get source files relative to.
- language – Language to get source files for.
Returns: Identified source files.
sourcePaths¶
-
Iterable<FileObject>
sourcePaths
(IProject project, String languageName)¶ Gets source paths in given project, for given language.
Parameters: - project – Project to get source paths relative to.
- languageName – Name of the language to get source paths for.
Returns: Source paths.
toFiles¶
-
Iterable<IdentifiedResource>
toFiles
(Iterable<FileObject> paths, ILanguageImpl language)¶ Gets source/include files given source/include paths.
Parameters: - paths – Source and/or include paths to get files for.
- language – Language to get source and include files for.
Returns: Identified source and include files.
LanguagePathService¶
-
public class
LanguagePathService
implements ILanguagePathService¶
Constructors¶
LanguagePathService¶
-
public
LanguagePathService
(ILanguageIdentifierService languageIdentifierService, Set<ILanguagePathProvider> providers)¶
Methods¶
includeFiles¶
-
public Iterable<IdentifiedResource>
includeFiles
(IProject project, ILanguageImpl language)¶
sourceAndIncludeFiles¶
-
public Iterable<IdentifiedResource>
sourceAndIncludeFiles
(IProject project, ILanguageImpl language)¶
sourceAndIncludePaths¶
-
public Iterable<FileObject>
sourceAndIncludePaths
(IProject project, String languageName)¶
sourceFiles¶
-
public Iterable<IdentifiedResource>
sourceFiles
(IProject project, ILanguageImpl language)¶
toFiles¶
-
public Collection<IdentifiedResource>
toFiles
(Iterable<FileObject> paths, ILanguageImpl language)¶
org.metaborg.core.completion¶
Completion¶
-
public class
Completion
implements ICompletion, Serializable¶
Methods¶
items¶
-
public Iterable<ICompletionItem>
items
()¶
kind¶
-
public CompletionKind
kind
()¶
setItems¶
-
public void
setItems
(Iterable<ICompletionItem> items)¶
CompletionKind¶
-
public enum
CompletionKind
¶
Enum Constants¶
expansion¶
-
public static final CompletionKind
expansion
¶
expansionEditing¶
-
public static final CompletionKind
expansionEditing
¶
recovery¶
-
public static final CompletionKind
recovery
¶
ICompletion¶
-
public interface
ICompletion
extends Serializable¶
Methods¶
items¶
-
Iterable<ICompletionItem>
items
()¶
kind¶
-
CompletionKind
kind
()¶
name¶
setItems¶
-
void
setItems
(Iterable<ICompletionItem> items)¶
ICompletionItem¶
-
public interface
ICompletionItem
extends Serializable¶
org.metaborg.core.config¶
AConfig¶
AConfigBuilder¶
-
public class
AConfigBuilder
¶
Fields¶
configReaderWriter¶
-
protected final AConfigurationReaderWriter
configReaderWriter
¶
Constructors¶
AConfigBuilder¶
-
public
AConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
AConfigService¶
-
public abstract class
AConfigService
<TSubject, TConfig>¶ Stores and retrieves configurations using the
Configuration
class.
Fields¶
configReaderWriter¶
-
protected final AConfigurationReaderWriter
configReaderWriter
¶
Constructors¶
AConfigService¶
-
protected
AConfigService
(AConfigurationReaderWriter configReaderWriter)¶ Initializes a new instance of the
AConfigService
class.Parameters: - configReaderWriter – The configuration reader/writer.
Methods¶
available¶
-
public boolean
available
(FileObject rootDirectory)¶ Checks if a configuration exists for a subject.
Parameters: - rootDirectory – The root directory of the subject to get the configuration for.
Returns: True if a configuration exists, false otherwise.
fromConfig¶
-
protected abstract HierarchicalConfiguration<ImmutableNode>
fromConfig
(TConfig config)¶ Creates a new hierarchical configuration for the specified config object.
Parameters: - config – The config object.
Returns: The configuration.
get¶
-
public ConfigRequest<TConfig>
get
(FileObject rootDirectory)¶ Gets the configuration for the a subject.
Parameters: - rootDirectory – The root directory of the subject to get the configuration for.
Returns: The configuration, or
null
when no configuration could be retrieved.
getConfigFile¶
-
protected FileObject
getConfigFile
(TSubject subject)¶ Gets the configuration file for the specified subject.
Parameters: - subject – The subject.
Throws: - FileSystemException –
Returns: The configuration file.
getConfigFile¶
-
protected abstract FileObject
getConfigFile
(FileObject rootFolder)¶ Gets the configuration file for the specified subject.
Parameters: - rootFolder – The root folder.
Throws: - FileSystemException –
Returns: The configuration file.
getFromConfigFile¶
-
public ConfigRequest<TConfig>
getFromConfigFile
(FileObject configFile, FileObject rootFolder)¶ Gets the configuration from the given file.
Parameters: - configFile – The configuration file with the configuration.
Returns: The configuration, or
null
when no configuration could be retrieved.
getRootDirectory¶
-
protected abstract FileObject
getRootDirectory
(TSubject subject)¶ Gets the configuration file for the specified subject.
Parameters: - subject – The subject.
Throws: - FileSystemException –
Returns: The configuration file.
readConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
readConfig
(FileObject configFile, FileObject rootDirectory)¶ Reads a configuration from a file.
Parameters: - configFile – The configuration file to read.
Throws: - IOException –
- ConfigurationException –
Returns: The read configuration, or
null
when the configuration could not be read.
toConfig¶
-
protected abstract ConfigRequest<TConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶ Creates a new instance of the config type for the specified configuration.
Parameters: - configuration – The configuration.
write¶
-
public void
write
(TSubject subject, TConfig config, IFileAccess access)¶ Writes the configuration for the given subject.
Parameters: - subject – The subject to set the configuration for.
- config – The configuration, or
null
to remove an existing configuration. - access –
write¶
-
public void
write
(FileObject rootDirectory, TConfig config, IFileAccess access)¶ Writes the configuration for the given subject.
Parameters: - rootDirectory – The root directory of the subject to set the configuration for.
- config – The configuration, or
null
to remove an existing configuration. - access –
writeConfig¶
-
protected void
writeConfig
(FileObject configFile, HierarchicalConfiguration<ImmutableNode> config, FileObject rootDirectory)¶ Writes a configuration to a file.
Parameters: - configFile – The configuration file to write to.
- config – The configuration to write, or
null
to delete the configuration file. - rootDirectory – The root folder.
Throws: - ConfigurationException –
- IOException –
AConfigurationReaderWriter¶
-
public abstract class
AConfigurationReaderWriter
¶ Reads, writes, and creates configurations Apache Commons
HierarchicalConfiguration
objects.
Methods¶
create¶
-
public JacksonConfiguration
create
(HierarchicalConfiguration<ImmutableNode> source, FileObject rootFolder)¶ Creates a configuration object.
Parameters: - source – The source configuration; or
null
. - rootFolder – The root folder; or
null
.
Returns: The created configuration object.
- source – The source configuration; or
create¶
-
public JacksonConfiguration
create
()¶ Creates a configuration object.
Returns: The created configuration object.
createNew¶
-
protected abstract JacksonConfiguration
createNew
(HierarchicalConfiguration<ImmutableNode> sourceConfiguration)¶ Creates a configuration object.
Parameters: - sourceConfiguration – The source configuration; or
null
.
Returns: The created configuration object.
- sourceConfiguration – The source configuration; or
read¶
-
public HierarchicalConfiguration<ImmutableNode>
read
(FileObject source, FileObject rootFolder)¶ Reads a configuration from the specified file.
Parameters: - source – The source file.
Returns: The read configuration.
read¶
-
public HierarchicalConfiguration<ImmutableNode>
read
(InputStream input, FileObject rootFolder)¶ Reads a configuration from the specified input stream.
Parameters: - input – The input stream.
- rootFolder – The root folder; or
null
.
Returns: The read configuration.
read¶
-
public HierarchicalConfiguration<ImmutableNode>
read
(Reader reader, FileObject rootFolder)¶ Reads a configuration from the specified reader.
Parameters: - reader – The reader.
- rootFolder – The root folder; or
null
.
Returns: The read configuration.
write¶
-
public void
write
(HierarchicalConfiguration<ImmutableNode> configuration, FileObject destination, FileObject rootFolder)¶ Writes a configuration to the specified writer.
Parameters: - configuration – The configuration to write.
- destination – The destination file.
- rootFolder – The root folder.
write¶
-
public void
write
(HierarchicalConfiguration<ImmutableNode> configuration, OutputStream output, FileObject rootFolder)¶ Writes a configuration to the specified writer.
Parameters: - configuration – The configuration to write.
- output – The output stream.
- rootFolder – The root folder; or
null
.
write¶
-
public void
write
(HierarchicalConfiguration<ImmutableNode> configuration, Writer writer, FileObject rootFolder)¶ Writes a configuration to the specified writer.
Parameters: - configuration – The configuration to write.
- writer – The writer.
- rootFolder – The root folder; or
null
.
AllLangSource¶
-
public class
AllLangSource
implements ISourceConfig, Serializable¶ Source for all languages. This is for internal use only, it should not be created from a project configuration.
ConfigException¶
-
public class
ConfigException
extends MetaborgException¶
ConfigRequest¶
-
public class
ConfigRequest
<T>¶
Constructors¶
ConfigRequest¶
-
public
ConfigRequest
(Collection<IMessage> errors)¶
ConfigRequest¶
-
public
ConfigRequest
(T config, Collection<IMessage> errors)¶
Methods¶
config¶
-
public T
config
()¶ Returns: Configuration if it exists, null if it does not exist or is invalid. May be a partial configuration if it is invalid.
errors¶
reportErrors¶
-
public void
reportErrors
(IMessagePrinter printer)¶ Reports errors to given message printer.
Parameters: - printer – Message printer to print errors with.
GenerateConfig¶
-
public class
GenerateConfig
implements IGenerateConfig¶
IConfig¶
-
public interface
IConfig
¶ Interface for configurations that are backed by an
ImmutableConfiguration
object.
IExportConfig¶
-
public interface
IExportConfig
extends Serializable¶ Configuration for file exports. Use the visitor pattern access implementations.
Methods¶
accept¶
-
void
accept
(IExportVisitor visitor)¶ Accepts an export visitor.
Parameters: - visitor – Visitor to accept.
IExportVisitor¶
-
public interface
IExportVisitor
¶ Visitor for
IExportConfig
s.
Methods¶
visit¶
-
void
visit
(LangDirExport resource)¶ Visit a language-specific resource directory.
Parameters: - resource – Language resource directory.
visit¶
-
void
visit
(LangFileExport resource)¶ Visit a language-specific single-file resource.
Parameters: - resource – Language resource file.
visit¶
-
void
visit
(ResourceExport resource)¶ Visit a generic resource.
Parameters: - resource – Generic resource.
IGenerateConfig¶
-
public interface
IGenerateConfig
¶ Configuration for a language that generates source files in a directory.
ILanguageComponentConfig¶
-
public interface
ILanguageComponentConfig
extends IProjectConfig¶ Configuration of a language component at runtime. To create a new instance of this interface, use an
ILanguageComponentConfigBuilder
interface.
Methods¶
completionsParseTable¶
exports¶
-
Collection<IExportConfig>
exports
()¶ Gets the file exports.
Returns: The file exports.
generates¶
-
Collection<IGenerateConfig>
generates
()¶ Gets the languages for while files are generated.
Returns: The languages for while files are generated.
identifier¶
-
LanguageIdentifier
identifier
()¶ Gets the language identifier.
Returns: The language identifier.
jsglrVersion¶
-
JSGLRVersion
jsglrVersion
()¶ Gets the parser version.
Returns: the parser version.
langContribs¶
-
Collection<LanguageContributionIdentifier>
langContribs
()¶ Gets the language contributions.
Returns: The language contributions.
name¶
parseTable¶
sdf2tableVersion¶
-
Sdf2tableVersion
sdf2tableVersion
()¶ Gets the sdf2table version to use.
Returns: sdf2table version to use.
ILanguageComponentConfigBuilder¶
-
public interface
ILanguageComponentConfigBuilder
¶ Builder for
ILanguageComponentConfig
objects.
Methods¶
addCompileDeps¶
-
ILanguageComponentConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#addCompileDeps(Iterable)}
addExports¶
-
ILanguageComponentConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶ Adds file exports.
Parameters: - exports – The file exports.
Returns: This builder.
addGenerates¶
-
ILanguageComponentConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶ Adds languages for while files are generated.
Parameters: - generates – The languages for while files are generated.
Returns: This builder.
addJavaDeps¶
-
ILanguageComponentConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#addSourceDeps(Iterable)}
addLangContribs¶
-
ILanguageComponentConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶ Adds language contributions.
Parameters: - contribs – The language contributions.
Returns: This builder.
addSourceDeps¶
-
ILanguageComponentConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#addSourceDeps(Iterable)}
build¶
-
ILanguageComponentConfig
build
(FileObject rootFolder)¶ Builds the configuration.
Returns: The built configuration.
copyFrom¶
-
ILanguageComponentConfigBuilder
copyFrom
(ILanguageComponentConfig config)¶ Copies the values from the specified configuration.
Parameters: - config – The configuration to copy values from.
reset¶
-
ILanguageComponentConfigBuilder
reset
()¶ Resets the values of this builder.
Returns: This builder.
withCompileDeps¶
-
ILanguageComponentConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#withCompileDeps(Iterable)}
withExports¶
-
ILanguageComponentConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶ Sets the file exports.
Parameters: - exports – The file exports.
Returns: This builder.
withGenerates¶
-
ILanguageComponentConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶ Sets the languages for while files are generated.
Parameters: - generates – The languages for while files are generated.
Returns: This builder.
withIdentifier¶
-
ILanguageComponentConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶ Sets the language identifier.
Parameters: - identifier – The language identifier.
Returns: This builder.
withJSGLRVersion¶
-
ILanguageComponentConfigBuilder
withJSGLRVersion
(JSGLRVersion jsglrVersion)¶ Sets the JSGLR parser version.
Parameters: - jsglrVersion – The JSGLR parser version.
Returns: This builder.
withJavaDeps¶
-
ILanguageComponentConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#addSourceDeps(Iterable)}
withLangContribs¶
-
ILanguageComponentConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶ Sets the language contributions.
Parameters: - contribs – The language contributions.
Returns: This builder.
withMetaborgVersion¶
-
ILanguageComponentConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶ {@see IProjectConfigBuilder#withMetaborgVersion(String)}
withName¶
-
ILanguageComponentConfigBuilder
withName
(String name)¶ Sets the language name.
Parameters: - name – The language name.
Returns: This builder.
withSdf2tableVersion¶
-
ILanguageComponentConfigBuilder
withSdf2tableVersion
(Sdf2tableVersion sdf2tableVersion)¶ Sets the sdf2table version.
Parameters: - sdf2tableVersion – The sdf2table version.
Returns: This builder.
withSdfCompletionsTable¶
-
ILanguageComponentConfigBuilder
withSdfCompletionsTable
(String completionsParseTable)¶ Sets the completion parse table (relative) path.
Parameters: - completionsParseTable – The completion parse table (relative) path.
Returns: This builder.
withSdfEnabled¶
-
ILanguageComponentConfigBuilder
withSdfEnabled
(Boolean sdfEnabled)¶ Sets the whether SDF is enabled in the project
Parameters: - sdfEnabled – If SDF is enabled or not.
Returns: This builder.
withSdfTable¶
-
ILanguageComponentConfigBuilder
withSdfTable
(String parseTable)¶ Sets the parse table (relative) path.
Parameters: - parseTable – The parse table (relative) path.
Returns: This builder.
withSourceDeps¶
-
ILanguageComponentConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶ {@see IProjectConfigBuilder#withSourceDeps(Iterable)}
ILanguageComponentConfigService¶
-
public interface
ILanguageComponentConfigService
¶ Stores and retrieves language component configurations.
Methods¶
available¶
-
boolean
available
(FileObject rootFolder)¶ Checks if a configuration exists for the language component at given location.
Parameters: - rootFolder – The language component root folder.
Returns: True if a configuration exists, false otherwise.
get¶
-
ConfigRequest<ILanguageComponentConfig>
get
(FileObject rootFolder)¶ Gets the configuration for the language component at given location.
Parameters: - rootFolder – The language component root folder.
Returns: Configuration request, either with a valid configuration, or a collection of error messages.
ILanguageComponentConfigWriter¶
-
public interface
ILanguageComponentConfigWriter
¶ Writes a configuration for the specified
ILanguageComponent
.
Methods¶
write¶
-
void
write
(FileObject root, ILanguageComponentConfig config, IFileAccess access)¶ Writes the specified configuration for the specified language component.
Parameters: - root – The language root folder.
- config – The configuration to write.
- access –
ILanguageImplConfig¶
-
public interface
ILanguageImplConfig
¶ Configuration of a language component at runtime. Composition of multiple
ILanguageComponentConfig
configurations.
Methods¶
compileDeps¶
-
Iterable<LanguageIdentifier>
compileDeps
()¶ Gets the compile dependencies.
Returns: The compile dependency identifiers.
exports¶
-
Iterable<IExportConfig>
exports
()¶ Gets the file exports.
Returns: The file exports.
generates¶
-
Iterable<IGenerateConfig>
generates
()¶ Gets the languages for while files are generated.
Returns: The languages for while files are generated.
javaDeps¶
-
Iterable<LanguageIdentifier>
javaDeps
()¶ Gets the Java dependencies.
Returns: The Java dependency identifiers.
sourceDeps¶
-
Iterable<LanguageIdentifier>
sourceDeps
()¶ Gets the source dependencies.
Returns: The source dependency identifiers.
IProjectConfig¶
-
public interface
IProjectConfig
¶
Methods¶
compileDeps¶
-
Collection<LanguageIdentifier>
compileDeps
()¶ Returns: Compile dependency identifiers.
javaDeps¶
-
Collection<LanguageIdentifier>
javaDeps
()¶ Returns: Java dependency identifiers.
sourceDeps¶
-
Collection<LanguageIdentifier>
sourceDeps
()¶ Returns: Source dependency identifiers.
sources¶
-
Collection<ISourceConfig>
sources
()¶ Gets the file sources.
Returns: The file sources.
IProjectConfigBuilder¶
-
public interface
IProjectConfigBuilder
¶ Builder for
ILanguageComponentConfig
objects.
Methods¶
addCompileDeps¶
-
IProjectConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶ Adds compile dependencies.
Parameters: - deps – The compile dependency identifiers.
Returns: This builder.
addJavaDeps¶
-
IProjectConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶ Adds java dependencies.
Parameters: - deps – The java dependency identifiers.
Returns: This builder.
addSourceDeps¶
-
IProjectConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶ Adds source dependencies.
Parameters: - deps – The source dependency identifiers.
Returns: This builder.
addSources¶
-
IProjectConfigBuilder
addSources
(Iterable<IExportConfig> sources)¶ Adds file sources.
Parameters: - sources – The file sources.
Returns: This builder.
build¶
-
IProjectConfig
build
(FileObject rootFolder)¶ Builds the configuration.
Returns: The built configuration.
copyFrom¶
-
IProjectConfigBuilder
copyFrom
(IProjectConfig config)¶ Copies the values from the specified configuration.
Parameters: - config – The configuration to copy values from.
reset¶
-
IProjectConfigBuilder
reset
()¶ Resets the values of this builder.
Returns: This builder.
withCompileDeps¶
-
IProjectConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶ Sets the compile-time dependencies.
Parameters: - deps – The compile-time dependency identifiers.
Returns: This builder.
withJavaDeps¶
-
IProjectConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶ Sets the java dependencies.
Parameters: - deps – The java dependency identifiers.
Returns: This builder.
withMetaborgVersion¶
-
IProjectConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶ Sets the MetaBorg version.
Parameters: - metaborgVersion – The MetaBorg version.
Returns: This builder.
withSourceDeps¶
-
IProjectConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶ Sets the source dependencies.
Parameters: - deps – The source dependency identifiers.
Returns: This builder.
withSources¶
-
IProjectConfigBuilder
withSources
(Iterable<IExportConfig> sources)¶ Sets the file sources.
Parameters: - sources – The file sources.
Returns: This builder.
IProjectConfigService¶
-
public interface
IProjectConfigService
¶ Stores and retrieves language component configurations.
Methods¶
available¶
-
boolean
available
(FileObject rootFolder)¶ Checks if a configuration exists for the project at the given location.
Parameters: - rootFolder – The project root folder.
Returns: True if a configuration exists, false otherwise.
defaultConfig¶
-
IProjectConfig
defaultConfig
(FileObject rootFolder)¶ Gets the default configuration for the project at the given location.
Parameters: - rootFolder – The project root folder.
Returns: Default project configuration.
get¶
-
ConfigRequest<? extends IProjectConfig>
get
(FileObject rootFolder)¶ Gets the configuration for the project at the given location.
Parameters: - rootFolder – The project root folder.
Returns: Configuration request, either with a valid configuration, or a collection of error messages.
IProjectConfigWriter¶
Methods¶
write¶
-
void
write
(IProject project, IProjectConfig config, IFileAccess access)¶ Writes the specified configuration for the specified project.
Parameters: - project – The project.
- config – The configuration to write.
- access –
ISourceConfig¶
-
public interface
ISourceConfig
¶
Methods¶
accept¶
-
void
accept
(ISourceVisitor visitor)¶
ISourceVisitor¶
-
public interface
ISourceVisitor
¶
Methods¶
of¶
-
static ISourceVisitor
of
(Consumer<LangSource> onLangSource, Consumer<AllLangSource> onAllLangSource)¶
visit¶
-
void
visit
(LangSource langSource)¶
visit¶
-
void
visit
(AllLangSource allLangSource)¶
JSGLRVersion¶
-
public enum
JSGLRVersion
¶
Enum Constants¶
dataDependent¶
-
public static final JSGLRVersion
dataDependent
¶
layoutSensitive¶
-
public static final JSGLRVersion
layoutSensitive
¶
v1¶
-
public static final JSGLRVersion
v1
¶
v2¶
-
public static final JSGLRVersion
v2
¶
LangDirExport¶
-
public class
LangDirExport
implements IExportConfig¶ Language-specific directory export.
Fields¶
directory¶
excludes¶
-
public final Iterable<String>
excludes
¶ Exclude patterns, following the Ant pattern syntax.
See also: Ant patterns
includes¶
-
public final Iterable<String>
includes
¶ Include patterns, following the Ant pattern syntax.
See also: Ant patterns
Constructors¶
LangFileExport¶
-
public class
LangFileExport
implements IExportConfig¶ Language-specific single-file export.
LangSource¶
-
public class
LangSource
implements ISourceConfig, Serializable¶ Language-specific source.
LanguageComponentConfig¶
-
public class
LanguageComponentConfig
extends AConfig implements ILanguageComponentConfig, IConfig¶ An implementation of the
ILanguageComponentConfig
interface that is backed by anImmutableConfiguration
object.
Constructors¶
LanguageComponentConfig¶
-
public
LanguageComponentConfig
(HierarchicalConfiguration<ImmutableNode> config, ProjectConfig projectConfig)¶
LanguageComponentConfig¶
-
protected
LanguageComponentConfig
(HierarchicalConfiguration<ImmutableNode> config, ProjectConfig projectConfig, LanguageIdentifier identifier, String name, Boolean sdfEnabled, String parseTable, String completionParseTable, Sdf2tableVersion sdf2tableVersion, Boolean dataDependent, JSGLRVersion jsglrVersion, Collection<LanguageContributionIdentifier> langContribs, Collection<IGenerateConfig> generates, Collection<IExportConfig> exports)¶
Methods¶
compileDeps¶
-
public Collection<LanguageIdentifier>
compileDeps
()¶
exports¶
-
public Collection<IExportConfig>
exports
()¶
generates¶
-
public Collection<IGenerateConfig>
generates
()¶
identifier¶
-
public LanguageIdentifier
identifier
()¶
javaDeps¶
-
public Collection<LanguageIdentifier>
javaDeps
()¶
jsglrVersion¶
-
public JSGLRVersion
jsglrVersion
()¶
langContribs¶
-
public Collection<LanguageContributionIdentifier>
langContribs
()¶
sdf2tableVersion¶
-
public Sdf2tableVersion
sdf2tableVersion
()¶
sourceDeps¶
-
public Collection<LanguageIdentifier>
sourceDeps
()¶
sources¶
-
public Collection<ISourceConfig>
sources
()¶
validate¶
-
public Collection<IMessage>
validate
(MessageBuilder mb)¶
LanguageComponentConfigBuilder¶
-
public class
LanguageComponentConfigBuilder
extends AConfigBuilder implements ILanguageComponentConfigBuilder¶ Configuration-based builder for
ILanguageComponentConfig
objects.
Fields¶
exports¶
-
protected List<IExportConfig>
exports
¶
generates¶
-
protected List<IGenerateConfig>
generates
¶
identifier¶
-
protected LanguageIdentifier
identifier
¶
jsglrVersion¶
-
protected JSGLRVersion
jsglrVersion
¶
langContribs¶
-
protected Set<LanguageContributionIdentifier>
langContribs
¶
projectConfigBuilder¶
-
protected final ProjectConfigBuilder
projectConfigBuilder
¶
sdf2tableVersion¶
-
protected Sdf2tableVersion
sdf2tableVersion
¶
Constructors¶
LanguageComponentConfigBuilder¶
-
public
LanguageComponentConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
Methods¶
addCompileDeps¶
-
public ILanguageComponentConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addExports¶
-
public ILanguageComponentConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶
addGenerates¶
-
public ILanguageComponentConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶
addJavaDeps¶
-
public ILanguageComponentConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addLangContribs¶
-
public ILanguageComponentConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
addSourceDeps¶
-
public ILanguageComponentConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
build¶
-
public ILanguageComponentConfig
build
(FileObject rootFolder)¶
copyFrom¶
-
public ILanguageComponentConfigBuilder
copyFrom
(ILanguageComponentConfig config)¶
reset¶
-
public ILanguageComponentConfigBuilder
reset
()¶
withCompileDeps¶
-
public ILanguageComponentConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withExports¶
-
public ILanguageComponentConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶
withGenerates¶
-
public ILanguageComponentConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶
withIdentifier¶
-
public ILanguageComponentConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶
withJSGLRVersion¶
-
public ILanguageComponentConfigBuilder
withJSGLRVersion
(JSGLRVersion jsglrVersion)¶
withJavaDeps¶
-
public ILanguageComponentConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withLangContribs¶
-
public ILanguageComponentConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
withMetaborgVersion¶
-
public ILanguageComponentConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withName¶
-
public ILanguageComponentConfigBuilder
withName
(String name)¶
withSdf2tableVersion¶
-
public ILanguageComponentConfigBuilder
withSdf2tableVersion
(Sdf2tableVersion sdf2tableVersion)¶
withSdfCompletionsTable¶
-
public ILanguageComponentConfigBuilder
withSdfCompletionsTable
(String completionsTable)¶
withSdfEnabled¶
-
public ILanguageComponentConfigBuilder
withSdfEnabled
(Boolean sdfEnabled)¶
withSdfTable¶
-
public ILanguageComponentConfigBuilder
withSdfTable
(String table)¶
withSourceDeps¶
-
public ILanguageComponentConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
LanguageComponentConfigService¶
-
public class
LanguageComponentConfigService
extends AConfigService<ILanguageComponent, ILanguageComponentConfig> implements ILanguageComponentConfigService, ILanguageComponentConfigWriter¶
Constructors¶
LanguageComponentConfigService¶
-
public
LanguageComponentConfigService
(AConfigurationReaderWriter configReaderWriter, LanguageComponentConfigBuilder configBuilder)¶
Methods¶
fromConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
fromConfig
(ILanguageComponentConfig config)¶
getConfigFile¶
-
protected FileObject
getConfigFile
(FileObject rootFolder)¶
getRootDirectory¶
-
protected FileObject
getRootDirectory
(ILanguageComponent languageComponent)¶
toConfig¶
-
protected ConfigRequest<ILanguageComponentConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶
LanguageIdentifierDeserializer¶
-
public class
LanguageIdentifierDeserializer
extends StdDeserializer<LanguageIdentifier>¶
Methods¶
deserialize¶
-
public LanguageIdentifier
deserialize
(JsonParser parser, DeserializationContext context)¶
LanguageIdentifierSerializer¶
-
public class
LanguageIdentifierSerializer
extends StdSerializer<LanguageIdentifier>¶
Methods¶
serialize¶
-
public void
serialize
(LanguageIdentifier value, JsonGenerator generator, SerializerProvider provider)¶
LanguageImplConfig¶
-
public class
LanguageImplConfig
implements ILanguageImplConfig¶
Constructors¶
LanguageImplConfig¶
-
public
LanguageImplConfig
(Iterable<ILanguageComponentConfig> configs)¶
Methods¶
compileDeps¶
-
public Iterable<LanguageIdentifier>
compileDeps
()¶
exports¶
-
public Iterable<IExportConfig>
exports
()¶
generates¶
-
public Iterable<IGenerateConfig>
generates
()¶
javaDeps¶
-
public Iterable<LanguageIdentifier>
javaDeps
()¶
sourceDeps¶
-
public Iterable<LanguageIdentifier>
sourceDeps
()¶
MetaborgConversionHandler¶
-
class
MetaborgConversionHandler
extends DefaultConversionHandler¶ Converts Metaborg Core types to and from their
Configuration
representations.
PathLookup¶
-
public final class
PathLookup
implements Lookup¶ Provides path information for configurations.
Constructors¶
PathLookup¶
-
public
PathLookup
(FileObject rootFolder)¶
ProjectConfig¶
-
public class
ProjectConfig
extends AConfig implements IProjectConfig, IConfig¶ An implementation of the
ILanguageComponentConfig
interface that is backed by anImmutableConfiguration
object.
Constructors¶
ProjectConfig¶
-
protected
ProjectConfig
(HierarchicalConfiguration<ImmutableNode> config, String metaborgVersion, Collection<IExportConfig> sources, Collection<LanguageIdentifier> compileDeps, Collection<LanguageIdentifier> sourceDeps, Collection<LanguageIdentifier> javaDeps)¶
Methods¶
compileDeps¶
-
public Collection<LanguageIdentifier>
compileDeps
()¶
javaDeps¶
-
public Collection<LanguageIdentifier>
javaDeps
()¶
sourceDeps¶
-
public Collection<LanguageIdentifier>
sourceDeps
()¶
sources¶
-
public Collection<ISourceConfig>
sources
()¶
validate¶
-
public Collection<IMessage>
validate
(MessageBuilder mb)¶
ProjectConfigBuilder¶
-
public class
ProjectConfigBuilder
extends AConfigBuilder implements IProjectConfigBuilder¶ Configuration-based builder for
ILanguageComponentConfig
objects.
Fields¶
compileDeps¶
-
protected Set<LanguageIdentifier>
compileDeps
¶
javaDeps¶
-
protected Set<LanguageIdentifier>
javaDeps
¶
sourceDeps¶
-
protected Set<LanguageIdentifier>
sourceDeps
¶
sources¶
-
protected List<IExportConfig>
sources
¶
Constructors¶
ProjectConfigBuilder¶
-
public
ProjectConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
Methods¶
addCompileDeps¶
-
public IProjectConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addJavaDeps¶
-
public IProjectConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addSourceDeps¶
-
public IProjectConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
addSources¶
-
public IProjectConfigBuilder
addSources
(Iterable<IExportConfig> sources)¶
build¶
-
public IProjectConfig
build
(FileObject rootFolder)¶
build¶
-
public ProjectConfig
build
(HierarchicalConfiguration<ImmutableNode> configuration)¶
copyFrom¶
-
public IProjectConfigBuilder
copyFrom
(IProjectConfig config)¶
copyValuesFrom¶
-
protected void
copyValuesFrom
(IProjectConfig config)¶
reset¶
-
public IProjectConfigBuilder
reset
()¶
withCompileDeps¶
-
public IProjectConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withJavaDeps¶
-
public IProjectConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withMetaborgVersion¶
-
public IProjectConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withSourceDeps¶
-
public IProjectConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
withSources¶
-
public IProjectConfigBuilder
withSources
(Iterable<IExportConfig> sources)¶
ProjectConfigService¶
-
public class
ProjectConfigService
extends AConfigService<IProject, IProjectConfig> implements IProjectConfigService, IProjectConfigWriter¶
Constructors¶
ProjectConfigService¶
-
public
ProjectConfigService
(AConfigurationReaderWriter configReaderWriter, ProjectConfigBuilder configBuilder)¶
Methods¶
defaultConfig¶
-
public IProjectConfig
defaultConfig
(FileObject rootFolder)¶
fromConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
fromConfig
(IProjectConfig config)¶
getConfigFile¶
-
protected FileObject
getConfigFile
(FileObject rootFolder)¶
getRootDirectory¶
-
protected FileObject
getRootDirectory
(IProject project)¶
toConfig¶
-
protected ConfigRequest<IProjectConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶
ResourceExport¶
-
public class
ResourceExport
implements IExportConfig¶ Generic resource export.
Fields¶
directory¶
excludes¶
-
public final Iterable<String>
excludes
¶ Exclude patterns, following the Ant pattern syntax.
See also: Ant patterns
includes¶
-
public final Iterable<String>
includes
¶ Include patterns, following the Ant pattern syntax.
See also: Ant patterns
Constructors¶
Sdf2tableVersion¶
-
public enum
Sdf2tableVersion
¶
Enum Constants¶
c¶
-
public static final Sdf2tableVersion
c
¶
dynamic¶
-
public static final Sdf2tableVersion
dynamic
¶
incremental¶
-
public static final Sdf2tableVersion
incremental
¶
java¶
-
public static final Sdf2tableVersion
java
¶
YamlConfiguration¶
-
public class
YamlConfiguration
extends JacksonConfiguration¶ Configuration that uses YAML files.
Constructors¶
YamlConfiguration¶
-
public
YamlConfiguration
()¶ Initializes a new instance of the
YamlConfiguration
class.
YamlConfiguration¶
-
public
YamlConfiguration
(HierarchicalConfiguration<ImmutableNode> config)¶ Initializes a new instance of the
YamlConfiguration
class.Parameters: - config – The configuration whose nodes to copy.
org.metaborg.core.context¶
ContextException¶
-
public class
ContextException
extends MetaborgException¶
Constructors¶
ContextException¶
-
public
ContextException
(FileObject resource, ILanguageImpl language)¶
ContextException¶
-
public
ContextException
(FileObject resource, ILanguageImpl language, String message)¶
ContextException¶
-
public
ContextException
(FileObject resource, ILanguageImpl language, String message, Throwable cause)¶
ContextException¶
-
public
ContextException
(FileObject resource, ILanguageImpl language, Throwable cause)¶
ContextFacet¶
Fields¶
factory¶
-
public final IContextFactory
factory
¶
strategy¶
-
public final IContextStrategy
strategy
¶
Constructors¶
ContextFacet¶
-
public
ContextFacet
(IContextFactory factory, IContextStrategy strategy)¶
ContextIdentifier¶
-
public class
ContextIdentifier
¶
Constructors¶
ContextIdentifier¶
-
public
ContextIdentifier
(FileObject resource, IProject project, ILanguageImpl language)¶ Parameters: - resource – The resource.
- project – The project to which the resource belongs.
- language –
ContextService¶
-
public class
ContextService
implements IContextService, IContextProcessor¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl language)¶
get¶
-
public IContext
get
(FileObject resource, IProject project, ILanguageImpl language)¶
getTemporary¶
-
public ITemporaryContext
getTemporary
(FileObject resource, IProject project, ILanguageImpl language)¶
update¶
-
public void
update
(LanguageImplChange change)¶
ContextUtils¶
-
public class
ContextUtils
¶
Methods¶
getAll¶
-
public static Set<IContext>
getAll
(Iterable<FileObject> resources, IProject project, ILanguageIdentifierService languageIdentifier, IContextService contextService)¶ Gets a set of all contexts for given resources.
Parameters: - resources – Resources to get contexts for.
- project – The project the resources belong to.
- languageIdentifier – Language identifier service.
- contextService – Context service.
Returns: Set of all contexts.
IContext¶
-
public interface
IContext
¶ Interface for a context in which analysis or transformations occurs. Implementors must override
hashCode()
andequals(Object)
usinglocation()
andlanguage()
, and also implementIContextInternal
.
Methods¶
language¶
-
ILanguageImpl
language
()¶ Returns: Language of this context.
location¶
-
FileObject
location
()¶ Returns: Location of this context.
persist¶
-
void
persist
()¶ Persist context data from memory to permanent storing. Acquires a read lock. Can be called while holding the write lock.
Throws: - IOException – When persisting fails unexpectedly.
read¶
-
IClosableLock
read
()¶ Request read access to this context.
Returns: Closable lock which must be held during reading. Close the lock when done.
IContextFactory¶
Methods¶
create¶
-
IContextInternal
create
(ContextIdentifier identifier)¶ Creates a new context from given identifier. A fast operation, expensive initialization is performed later.
Parameters: - identifier – Identifier to create the context with.
Returns: Created context.
createTemporary¶
-
ITemporaryContextInternal
createTemporary
(ContextIdentifier identifier)¶ Creates a new temporary context from given identifier. A fast operation, expensive initialization is performed in
IContextInternal.init()
.Parameters: - identifier – Identifier to create the temporary context with.
Returns: Created context.
IContextInternal¶
-
public interface
IContextInternal
extends IContext¶ Extension of
IContext
with methods that should not be exposed to clients.
Methods¶
identifier¶
-
ContextIdentifier
identifier
()¶ Returns: Identifier of this context.
init¶
-
void
init
()¶ Initializes the context if it has not been initialized yet. Will not load anything from disk.Acquires a write lock. Cannot be called while holding the read lock.
IContextProcessor¶
-
public interface
IContextProcessor
¶
Methods¶
update¶
-
void
update
(LanguageImplChange change)¶ Updates contexts using a language implementation change.
Parameters: - change – Language change to process.
IContextService¶
Methods¶
available¶
-
boolean
available
(ILanguageImpl language)¶ Checks if contexts are available for given language implementation.
Parameters: - language – Language implementation to check.
Returns: True if contexts are available, false if not.
get¶
-
IContext
get
(FileObject resource, IProject project, ILanguageImpl language)¶ Retrieves or creates a context for given resource and language.
Parameters: - resource – Resource to get a context for.
- project – The project the resource belongs to.
- language – Language to get a context for.
Throws: - ContextException – When an error occurs while retrieving or creating a context.
- MetaborgRuntimeException – When
language
has multipleContextFacet
.
Returns: Existing or created context.
getTemporary¶
-
ITemporaryContext
getTemporary
(FileObject resource, IProject project, ILanguageImpl language)¶ Creates a temporary context for given resource and language. Temporary contexts are not thread-safe, and must be closed after usage. Supports the try-with-resources statement for closing the temporary context.
Parameters: - resource – Resource to get a context for.
- project – The project the resource belongs to.
- language – Language to get a context for.
Throws: - ContextException – When an error occurs while retrieving or creating a context.
- MetaborgRuntimeException – When
language
has multipleContextFacet
.
Returns: Temporary context.
IContextStrategy¶
Methods¶
get¶
-
ContextIdentifier
get
(FileObject resource, IProject project, ILanguageImpl language)¶ Returns the context identifier for given resource and language.
Parameters: - resource – Resource to get a context identifier for.
- project – Project to which the resource belongs.
- language – Language to get a context identifier for.
Throws: - ContextException – When a context identifier cannot be returned.
Returns: Context identifier.
ITemporaryContext¶
-
public interface
ITemporaryContext
extends IContext, AutoCloseable¶ IContext
for temporary use. Is not thread-safe. Has to be closed after usage.
ITemporaryContextInternal¶
-
public interface
ITemporaryContextInternal
extends IContextInternal, ITemporaryContext¶ Extension of
ITemporaryContext
withIContextInternal
that should not be exposed to clients.
ProjectContextStrategy¶
-
public class
ProjectContextStrategy
implements IContextStrategy¶
Methods¶
get¶
-
public ContextIdentifier
get
(FileObject resource, IProject project, ILanguageImpl language)¶
ResourceContextStrategy¶
-
public class
ResourceContextStrategy
implements IContextStrategy¶
Methods¶
get¶
-
public ContextIdentifier
get
(FileObject resource, IProject project, ILanguageImpl language)¶
org.metaborg.core.editor¶
DummyEditorRegistry¶
-
public class
DummyEditorRegistry
implements IEditorRegistry¶ Dummy editor registry that gets bound by default, to display sane warnings when nothing else is bound to
IEditorRegistry
. Replace with working implementation or bindNullEditorRegistry
to disable the warning.
IEditor¶
-
public interface
IEditor
¶ Interface for an editor in an IDE.
Methods¶
disable¶
-
void
disable
()¶ Disables parsing, analysis, and implementation-specific services. Does nothing if editor has not been initialized, or if it has been disposed, or if the editor is already disabled.
enable¶
-
void
enable
()¶ Enables parsing, analysis, and implementation-specific services. Does nothing if editor has not been initialized, or if it has been disposed, or if the editor is already enabled.
forceUpdate¶
-
void
forceUpdate
()¶ Force a parser, analysis, and implementation-specific update. Does nothing if editor has not been initialized, or if it has been disposed.
language¶
-
ILanguageImpl
language
()¶ Returns: Language of the current input resource. Null if the editor has not been initialized yet, if it has been disposed, or if the editor was opened before languages were loaded.
reconfigure¶
-
void
reconfigure
()¶ Reconfigure the editor, updates its language and performs any implementation-specific reconfiguration. Does nothing if editor has not been initialized, or if it has been disposed.
resource¶
-
FileObject
resource
()¶ Returns: Current resource. Null if the editor has not been initialized yet, or if it has been disposed.
IEditorRegistry¶
-
public interface
IEditorRegistry
¶
Methods¶
open¶
-
void
open
(FileObject resource, IProject project)¶ Open an editor for given resource.
Parameters: - resource – Resource to open editor for.
- project – The project that contains the resource.
open¶
-
void
open
(Iterable<FileObject> resources, IProject project)¶ Open editors for the given resources.
Parameters: - resources – Resources to open editor for.
- project – The project that contains the resource.
NullEditorRegistry¶
-
public class
NullEditorRegistry
implements IEditorRegistry¶ Editor registry that always returns an empty iterable.
org.metaborg.core.language¶
AllLanguagesFileSelector¶
-
public class
AllLanguagesFileSelector
implements FileSelector¶
Constructors¶
AllLanguagesFileSelector¶
-
public
AllLanguagesFileSelector
(ILanguageIdentifierService languageIdentifierService)¶
Methods¶
includeFile¶
-
public boolean
includeFile
(FileSelectInfo fileInfo)¶
traverseDescendents¶
-
public boolean
traverseDescendents
(FileSelectInfo fileInfo)¶
ComponentCreationConfig¶
-
public class
ComponentCreationConfig
¶
Fields¶
config¶
-
public final ILanguageComponentConfig
config
¶
facets¶
-
protected final Collection<IFacet>
facets
¶
identifier¶
-
public final LanguageIdentifier
identifier
¶
implIds¶
-
public final Iterable<LanguageContributionIdentifier>
implIds
¶
location¶
-
public final FileObject
location
¶
Constructors¶
ComponentCreationConfig¶
-
public
ComponentCreationConfig
(LanguageIdentifier identifier, FileObject location, Iterable<LanguageContributionIdentifier> implIds, ILanguageComponentConfig config)¶
DescriptionFacet¶
-
public class
DescriptionFacet
implements IFacet¶ Represents a facet that provides basic information about a language
Fields¶
FacetContribution¶
-
public class
FacetContribution
<T extends IFacet>¶
Constructors¶
FacetContribution¶
-
public
FacetContribution
(T facet, ILanguageComponent contributor)¶
IComponentCreationConfigRequest¶
-
public interface
IComponentCreationConfigRequest
extends ILanguageDiscoveryRequest¶ Request for creating a
ComponentCreationConfig
.
Methods¶
config¶
-
ILanguageComponentConfig
config
()¶ Returns: Language component configuration; or null
when not available.
errors¶
-
Collection<String>
errors
()¶ Gets the errors produced during the creation of this request. The resulting collection is empty when
valid()
istrue
.Returns: Produced error messages.
exceptions¶
-
Collection<Throwable>
exceptions
()¶ Gets the exceptions thrown during the creation of this request. The resulting collection is empty when
valid()
istrue
.Returns: Thrown exceptions.
location¶
-
FileObject
location
()¶ Returns: Location of the request.
IFacetContributions¶
-
public interface
IFacetContributions
¶ Interface representing language facet contributions. Facets are retrieved by type, multiple facets of the same type are allowed. Clients determine how multiple facets of the same type are handled.
Methods¶
facet¶
-
<T extends IFacet> T
facet
(Class<T> type)¶ Returns a facet of given type.
Parameters: - type – Facet type.
Throws: - MetaborgRuntimeException – When there are multiple facets of given type.
Returns: Facet of given type, or null if there is no facet of given type.
facetContribution¶
-
<T extends IFacet> FacetContribution<T>
facetContribution
(Class<T> type)¶ Returns a facet contribution of given type.
Parameters: - type – Facet type.
Throws: - MetaborgRuntimeException – When there are multiple facets of given type.
Returns: Facet contribution of given type.
facetContributions¶
-
<T extends IFacet> Iterable<FacetContribution<T>>
facetContributions
(Class<T> type)¶ Returns facet contributions of given type.
Parameters: - type – Facet type
Returns: Facet contributions of given type.
facetContributions¶
-
Iterable<FacetContribution<IFacet>>
facetContributions
()¶ Returns: All facet contributions.
facets¶
ILanguage¶
-
public interface
ILanguage
¶ Interface that represents a language. A language has multiple implementations.
Methods¶
activeImpl¶
-
ILanguageImpl
activeImpl
()¶ Returns: Active language implementation for this language. A language implementation is active when it has a higher version number than other language implementations. When there are multiple implementations with the highest version number, the one that was added last wins. Returns null when #impls()
returns an empty iterable, which only happens if this language has been removed from the language service.
impls¶
-
Iterable<? extends ILanguageImpl>
impls
()¶ Returns: All language implementations that belong to this language.
ILanguageCache¶
-
public interface
ILanguageCache
¶ Interface for services that cache language resources, to support invalidation of those caches when the language is removed or reloaded. Add Guice bindings to this interface for classes that implement it.
Methods¶
invalidateCache¶
-
void
invalidateCache
(ILanguageComponent component)¶ Invalidate the cache for given language component.
Parameters: - component – Component to invalidate the cache for.
invalidateCache¶
-
void
invalidateCache
(ILanguageImpl impl)¶ Invalidate the cache for given language implementation.
Parameters: - impl – Implementation to invalidate the cache for.
ILanguageComponent¶
-
public interface
ILanguageComponent
extends IFacetContributions¶ Interface that represents a language component. A language component contributes facets to language implementations. Facet operations only return facets of this component.
Methods¶
config¶
-
ILanguageComponentConfig
config
()¶ Returns: Configuration of this component.
contributesTo¶
-
Iterable<? extends ILanguageImpl>
contributesTo
()¶ Returns: All language implementations that this component contributes to.
id¶
-
LanguageIdentifier
id
()¶ Returns: Identifier of this component.
location¶
-
FileObject
location
()¶ Returns: Location of this component.
ILanguageComponentFactory¶
-
public interface
ILanguageComponentFactory
¶ Interface for creating
ComponentCreationConfig
s which are used to load language components into aILanguageService
.
Methods¶
createConfig¶
-
ComponentCreationConfig
createConfig
(IComponentCreationConfigRequest request)¶ Creates a language component configuration from a valid request.
Parameters: - request – Request to create a component configuration for.
Throws: - MetaborgException – When
request
is not valid, or when there are further configuration issues in the request.
Returns: A language component configuration which is passed to
ILanguageService.add(ComponentCreationConfig)
to load the component.
createConfigs¶
-
Collection<ComponentCreationConfig>
createConfigs
(Iterable<IComponentCreationConfigRequest> requests)¶ Creates language component configurations from valid requests.
Parameters: - requests – Requests to create component configurations for.
Throws: - MetaborgException – When a request is not valid, or when there are further configuration issues in a request.
Returns: Language component configurations which are passed to
ILanguageService.add(ComponentCreationConfig)
to load the component.
requestAllInDirectory¶
-
Collection<IComponentCreationConfigRequest>
requestAllInDirectory
(FileObject directory)¶ Creates component creation configuration requests by scanning given directory and all descendants for compiled language components.
Parameters: - directory – Directory to start scanning for compiled language components.
Throws: - MetaborgException – When
directory
is not a directory, does not exist; or when an unexpected I/O error occurs.
Returns: Requests which can be checked for validity. Pass valid requests to
createConfig(IComponentCreationConfigRequest)
to create a language component configuration.
requestFromArchive¶
-
IComponentCreationConfigRequest
requestFromArchive
(FileObject archiveFile)¶ Create a component creation configuration request from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When
archiveFile
is not a file, does not exist, or does not contain a compiled language component; or when an unexpected I/O error occurs.
Returns: Request which can be checked for validity. Pass valid requests to
createConfig(IComponentCreationConfigRequest)
to create a language component configuration.
requestFromDirectory¶
-
IComponentCreationConfigRequest
requestFromDirectory
(FileObject directory)¶ Create a component creation configuration request from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When
directory
is not a directory, does not exist, or does not contain a compiled language component; or when an unexpected I/O error occurs.
Returns: Request which can be checked for validity. Pass valid requests to
createConfig(IComponentCreationConfigRequest)
to create a language component configuration.
ILanguageComponentInternal¶
-
public interface
ILanguageComponentInternal
extends ILanguageComponent¶
ILanguageDiscoveryRequest¶
-
public interface
ILanguageDiscoveryRequest
¶ Request for language discovery.
Methods¶
config¶
-
ILanguageComponentConfig
config
()¶ Gets the configuration of the language.
Returns: The configuration; or null
when not available.
errors¶
-
Collection<String>
errors
()¶ Gets the errors produced during the creation of this request. The resulting collection is empty when
valid()
istrue
.Returns: The produced error messages.
exceptions¶
-
Collection<Throwable>
exceptions
()¶ Gets the exceptions thrown during the creation of this request. The resulting collection is empty when
valid()
istrue
.Returns: The thrown exceptions.
location¶
-
FileObject
location
()¶ Gets the location of the request.
Returns: The location of the request.
ILanguageDiscoveryService¶
-
public interface
ILanguageDiscoveryService
¶ Interface for a language discovery service that finds and loads language components and implementations.
Methods¶
componentFromArchive¶
-
ILanguageComponent
componentFromArchive
(FileObject archiveFile)¶ Load a language component from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language component.
componentFromDirectory¶
-
ILanguageComponent
componentFromDirectory
(FileObject directory)¶ Load a language component from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language component.
discover¶
-
ILanguageComponent
discover
(ILanguageDiscoveryRequest request)¶ Discover language component with given request.
Parameters: - request – Language discovery request created by
request(FileObject)
.
Throws: - MetaborgException – When discovery fails unexpectedly.
Returns: Language components that were created.
- request – Language discovery request created by
discover¶
-
Iterable<ILanguageComponent>
discover
(Iterable<ILanguageDiscoveryRequest> requests)¶ Discover all language components with the given requests.
Parameters: - requests – Language discovery requests created by
request(FileObject)
.
Throws: - MetaborgException – When discovery fails unexpectedly.
Returns: Language components that were created.
- requests – Language discovery requests created by
languageFromArchive¶
-
ILanguageImpl
languageFromArchive
(FileObject archiveFile)¶ Load a language implementation from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails, or when more than one language implementation is loaded.
Returns: Loaded language implementation.
languageFromDirectory¶
-
ILanguageImpl
languageFromDirectory
(FileObject directory)¶ Load a language implementation from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails, or when more than one language implementation is loaded.
Returns: Loaded language implementation.
languagesFromArchive¶
-
Set<ILanguageImpl>
languagesFromArchive
(FileObject archiveFile)¶ Load language implementations from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language implementations.
languagesFromDirectory¶
-
Set<ILanguageImpl>
languagesFromDirectory
(FileObject directory)¶ Load language implementations from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language implementations.
request¶
-
Iterable<ILanguageDiscoveryRequest>
request
(FileObject location)¶ Request language discovery at given location. Returns language discovery requests which can be checked for availability and errors. Pass requests to
discover(ILanguageDiscoveryRequest)
to actually load the components.Parameters: - location – The directory to search in.
Throws: - MetaborgException – When searching for language components fails unexpectedly.
Returns: Language discovery requests. Empty when no components can be discovered.
scanComponentsInDirectory¶
-
Set<ILanguageComponent>
scanComponentsInDirectory
(FileObject directory)¶ Scans given directory and all descendants for language components and loads them all.
Parameters: - directory – Directory to start scanning for language components.
Throws: - MetaborgException – When
directory
is not a directory or does not exist, when loading a language component fails, or when an unexpected I/O error occurs.
Returns: Loaded language components.
scanLanguagesInDirectory¶
-
Set<ILanguageImpl>
scanLanguagesInDirectory
(FileObject directory)¶ Scans given directory and all descendants for language components and loads them all.
Parameters: - directory – Directory to start scanning for language components.
Throws: - MetaborgException – When
directory
is not a directory or does not exist, when loading a language component fails, or when an unexpected I/O error occurs.
Returns: Loaded language implementations.
ILanguageIdentifierService¶
-
public interface
ILanguageIdentifierService
¶ Interface for identifying the language of a resource.
Methods¶
available¶
-
boolean
available
(ILanguageImpl impl)¶ Returns if language identification is available for given implementation.
Parameters: - impl – Language implementation to check.
Returns: True if identification is available, false if not.
identify¶
-
boolean
identify
(FileObject resource, ILanguageImpl language)¶ Checks if given resource is of given language.
Parameters: - resource – Resource to check.
- language – Language to check against.
Returns: True if resource is of given language, false otherwise.
identify¶
-
ILanguageImpl
identify
(FileObject resource)¶ Attempts to identify the active language of given resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified language, or null if language could not be identified.
identify¶
-
ILanguageImpl
identify
(FileObject resource, IProject project)¶ Attempts to identify the active language of given resource.
Parameters: - resource – Resource to identify.
- project – The projectto which the resource belongs; or
null
if not known.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified language, or null if language could not be identified.
identify¶
-
ILanguageImpl
identify
(FileObject resource, Iterable<? extends ILanguageImpl> languages)¶ Attempts to identify the language of given resource, among given list of languages.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to multiple languages.
Returns: Identified language, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource)¶ Attempts to identify the active language of given resource, and return an identified resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified resource, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource, IProject project)¶ Attempts to identify the active language of given resource, and return an identified resource.
Parameters: - resource – Resource to identify.
- project – The project to which the resource belongs; or
null
if not known.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified resource, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource, Iterable<? extends ILanguageImpl> languages)¶ Attempts to identify the language of given resource, among given list of languages, and return an identified resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to multiple languages.
Returns: Identified resource, or null if language could not be identified.
ILanguageImpl¶
-
public interface
ILanguageImpl
extends IFacetContributions¶ Interface that represents a language implementation. A language implementation is a view over all components that contribute to the implementation. An implementation belongs to a language. Facet operations return facets from all components.
Methods¶
components¶
-
Iterable<ILanguageComponent>
components
()¶ Returns: All components that contribute to this implementation.
config¶
-
ILanguageImplConfig
config
()¶ Returns: Configuration of this language implementation.
id¶
-
LanguageIdentifier
id
()¶ Returns: Identifier of this implementation.
locations¶
-
Iterable<FileObject>
locations
()¶ Returns: Locations of this implementation’s components.
ILanguageImplInternal¶
-
public interface
ILanguageImplInternal
extends ILanguageImpl¶
Methods¶
addComponent¶
-
boolean
addComponent
(ILanguageComponent component)¶ Adds a component to the implementation.
Parameters: - component – Component to add.
Returns: True if the component was added, false if it already existed.
belongsToInternal¶
-
ILanguageInternal
belongsToInternal
()¶ Returns: Language this implementation belongs to.
removeComponent¶
-
boolean
removeComponent
(ILanguageComponent component)¶ Removes a component from the implementation.
Parameters: - component – Component to remove.
Returns: True if the component was removed, false if it did not exist.
ILanguageInternal¶
Methods¶
add¶
-
void
add
(ILanguageImplInternal implementation)¶ Adds a language implementation that belongs to this language.
Parameters: - implementation – Language implementation to add.
remove¶
-
void
remove
(ILanguageImplInternal implementation)¶ Removes a language implementation that no longer belongs to this language.
Parameters: - implementation – Language implementation to remove.
ILanguageService¶
-
public interface
ILanguageService
¶ Interface for a language service that creates and destroys languages, maps names to active languages, and provides an observable of language changes. A language is active if it has the highest version, and highest loading date.
Methods¶
add¶
-
ILanguageComponent
add
(ComponentCreationConfig config)¶ Adds language component created from given configuration object, and return the created component.
Parameters: - config – Request object to process.
Throws: - IllegalStateException – When a component with a different id has already been created at given component’s location.
Returns: Created component.
componentChanges¶
-
Observable<LanguageComponentChange>
componentChanges
()¶ Returns: Observable over language component changes.
create¶
-
ComponentCreationConfig
create
(LanguageIdentifier identifier, FileObject location, Iterable<LanguageContributionIdentifier> contribs, ILanguageComponentConfig config)¶ Creates a request object with given identifier and location, contributing to given language implementation identifiers. Returns a request object where facets can be added before passing it to
add(ComponentCreationConfig)
.Parameters: - identifier – Identifier of the component to create.
- location – Location of the component to create.
- contribs – Identifiers of language implementations that the component should contribute to.
- config – Configuration of the component to create.
Returns: Creation request object, when passed to
add(ComponentCreationConfig)
actually adds the language.
getAllComponents¶
-
Iterable<? extends ILanguageComponent>
getAllComponents
()¶ Returns: All language components.
getAllImpls¶
-
Iterable<? extends ILanguageImpl>
getAllImpls
()¶ Returns: All language implementations.
getAllImpls¶
-
Iterable<? extends ILanguageImpl>
getAllImpls
(String groupId, String id)¶ Gets language implementations with group id and id.
Parameters: - groupId – Group ID of the implementations to get.
- id – ID of the implementations to get.
Returns: Implementations with given group id and id.
getComponent¶
-
ILanguageComponent
getComponent
(LanguageIdentifier identifier)¶ Gets a language component by its identifier.
Parameters: - identifier – Identifier of the implementation to get.
Returns: Component with given identifier, or null if it could not be found.
getComponent¶
-
ILanguageComponent
getComponent
(FileName location)¶ Gets a language component by its location.
Parameters: - location – Location of the implementation to get.
Returns: Component at given location, or null if it could not be found.
getImpl¶
-
ILanguageImpl
getImpl
(LanguageIdentifier identifier)¶ Gets a language implementation by its identifier.
Parameters: - identifier – Identifier of the implementation to get.
Returns: Implementation with given identifier, or null if it could not be found.
getLanguage¶
implChanges¶
-
Observable<LanguageImplChange>
implChanges
()¶ Returns: Observable over language implementation changes.
remove¶
-
void
remove
(ILanguageComponent component)¶ Removes given language component.
Parameters: - component – Language component to remove.
Throws: - IllegalStateException – When component does not exist or has already been removed.
IdentificationFacet¶
-
public class
IdentificationFacet
implements IFacet¶ Represents a facet that can identify resources languages.
Constructors¶
IdentificationFacet¶
-
public
IdentificationFacet
(Func1<FileObject, Boolean> identifier)¶ Creates an identification facet using an identification function.
Parameters: - identifier – The identification function.
Methods¶
identify¶
-
public boolean
identify
(FileObject file)¶
IdentifiedResource¶
-
public class
IdentifiedResource
¶ Resource with an identified language and optionally dialect.
Fields¶
dialect¶
-
public final ILanguageImpl
dialect
¶ Identified dialect of the resource, or null if it does not have a dialect.
language¶
-
public final ILanguageImpl
language
¶ Identified language of the resource.
resource¶
-
public final FileObject
resource
¶ Resource.
Constructors¶
IdentifiedResource¶
-
public
IdentifiedResource
(FileObject resource, IdentifiedDialect identifiedDialect)¶
IdentifiedResource¶
-
public
IdentifiedResource
(FileObject resource, ILanguageImpl dialect, ILanguageImpl language)¶
Language¶
-
public class
Language
implements ILanguage, ILanguageInternal¶
Methods¶
activeImpl¶
-
public ILanguageImpl
activeImpl
()¶
add¶
-
public void
add
(ILanguageImplInternal implementation)¶
impls¶
-
public Iterable<? extends ILanguageImpl>
impls
()¶
remove¶
-
public void
remove
(ILanguageImplInternal implementation)¶
LanguageComponent¶
-
public class
LanguageComponent
implements ILanguageComponentInternal¶
Constructors¶
LanguageComponent¶
-
public
LanguageComponent
(LanguageIdentifier identifier, FileObject location, int sequenceId, Iterable<ILanguageImplInternal> contributesTo, ILanguageComponentConfig config, Iterable<? extends IFacet> facets)¶
Methods¶
config¶
-
public ILanguageComponentConfig
config
()¶
contributesTo¶
-
public Iterable<? extends ILanguageImpl>
contributesTo
()¶
contributesToInternal¶
-
public Iterable<? extends ILanguageImplInternal>
contributesToInternal
()¶
facetContribution¶
-
public <T extends IFacet> FacetContribution<T>
facetContribution
(Class<T> type)¶
facetContributions¶
-
public <T extends IFacet> Iterable<FacetContribution<T>>
facetContributions
(Class<T> type)¶
facetContributions¶
-
public Iterable<FacetContribution<IFacet>>
facetContributions
()¶
id¶
-
public LanguageIdentifier
id
()¶
location¶
-
public FileObject
location
()¶
LanguageComponentChange¶
-
public class
LanguageComponentChange
¶ Represents a change of a language component in the
ILanguageService
.
Fields¶
newComponent¶
-
public final ILanguageComponent
newComponent
¶ New language component. Value under different kinds:
Kind.Add
: Component that was added.Kind.Reload
: Component before the reload.Kind.Remove
: null
oldComponent¶
-
public final ILanguageComponent
oldComponent
¶ Existing language component. Value under different kinds:
Kind.Add
: nullKind.Reload
: Component before the reload.Kind.Remove
: Component that was removed.
Constructors¶
LanguageComponentChange¶
-
public
LanguageComponentChange
(Kind kind, ILanguageComponent oldComponent, ILanguageComponent newComponent)¶
LanguageComponentChange.Kind¶
-
public enum
Kind
¶
Enum Constants¶
Add¶
-
public static final LanguageComponentChange.Kind
Add
¶
Reload¶
-
public static final LanguageComponentChange.Kind
Reload
¶
Remove¶
-
public static final LanguageComponentChange.Kind
Remove
¶
LanguageContributionIdentifier¶
-
public class
LanguageContributionIdentifier
implements Serializable¶
Fields¶
id¶
-
public final LanguageIdentifier
id
¶ Identifier of the language implementation to contribute to.
Constructors¶
LanguageContributionIdentifier¶
-
public
LanguageContributionIdentifier
(LanguageIdentifier id, String name)¶
LanguageFileSelector¶
-
public class
LanguageFileSelector
implements FileSelector¶
Constructors¶
LanguageFileSelector¶
-
public
LanguageFileSelector
(ILanguageIdentifierService languageIdentifierService, ILanguageImpl language)¶
Methods¶
includeFile¶
-
public boolean
includeFile
(FileSelectInfo fileInfo)¶
traverseDescendents¶
-
public boolean
traverseDescendents
(FileSelectInfo fileInfo)¶
LanguageIdentifier¶
-
public class
LanguageIdentifier
implements Comparable<LanguageIdentifier>, Serializable¶
Fields¶
version¶
-
public final LanguageVersion
version
¶
Constructors¶
LanguageIdentifier¶
-
public
LanguageIdentifier
(String groupId, String id, LanguageVersion version)¶
LanguageIdentifier¶
-
public
LanguageIdentifier
(LanguageIdentifier identifier, LanguageVersion version)¶
Methods¶
compareTo¶
-
public int
compareTo
(LanguageIdentifier other)¶
parse¶
-
public static LanguageIdentifier
parse
(String identifier)¶
parseFull¶
-
public static LanguageIdentifier
parseFull
(String identifier)¶
LanguageIdentifierService¶
-
public class
LanguageIdentifierService
implements ILanguageIdentifierService¶
Constructors¶
LanguageIdentifierService¶
-
public
LanguageIdentifierService
(ILanguageService languageService, IDialectIdentifier dialectIdentifier, IProjectService projectService, IDependencyService dependencyService)¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl impl)¶
identify¶
-
public boolean
identify
(FileObject resource, ILanguageImpl language)¶
identify¶
-
public ILanguageImpl
identify
(FileObject resource)¶
identify¶
-
public ILanguageImpl
identify
(FileObject resource, IProject project)¶
identify¶
-
public ILanguageImpl
identify
(FileObject resource, Iterable<? extends ILanguageImpl> languages)¶
identifyToResource¶
-
public IdentifiedResource
identifyToResource
(FileObject resource)¶
identifyToResource¶
-
public IdentifiedResource
identifyToResource
(FileObject resource, IProject project)¶
identifyToResource¶
-
public IdentifiedResource
identifyToResource
(FileObject resource, Iterable<? extends ILanguageImpl> impls)¶
LanguageImplChange¶
-
public class
LanguageImplChange
¶ Represents a change of a language implementation in the
ILanguageService
.
Fields¶
impl¶
-
public final ILanguageImpl
impl
¶ Changed language implementation.
Constructors¶
LanguageImplChange¶
-
public
LanguageImplChange
(Kind kind, ILanguageImpl impl)¶
LanguageImplChange.Kind¶
-
public enum
Kind
¶
Enum Constants¶
Add¶
-
public static final LanguageImplChange.Kind
Add
¶
Reload¶
-
public static final LanguageImplChange.Kind
Reload
¶
Remove¶
-
public static final LanguageImplChange.Kind
Remove
¶
LanguageImplementation¶
-
public class
LanguageImplementation
implements ILanguageImpl, ILanguageImplInternal¶
Constructors¶
LanguageImplementation¶
-
public
LanguageImplementation
(LanguageIdentifier id, ILanguageInternal belongsTo)¶
Methods¶
addComponent¶
-
public boolean
addComponent
(ILanguageComponent component)¶
belongsToInternal¶
-
public ILanguageInternal
belongsToInternal
()¶
components¶
-
public Iterable<ILanguageComponent>
components
()¶
config¶
-
public ILanguageImplConfig
config
()¶
facetContribution¶
-
public <T extends IFacet> FacetContribution<T>
facetContribution
(Class<T> type)¶
facetContributions¶
-
public <T extends IFacet> Iterable<FacetContribution<T>>
facetContributions
(Class<T> type)¶
facetContributions¶
-
public Iterable<FacetContribution<IFacet>>
facetContributions
()¶
id¶
-
public LanguageIdentifier
id
()¶
locations¶
-
public Iterable<FileObject>
locations
()¶
removeComponent¶
-
public boolean
removeComponent
(ILanguageComponent component)¶
LanguageService¶
-
public class
LanguageService
implements ILanguageService¶
Methods¶
add¶
-
public ILanguageComponent
add
(ComponentCreationConfig config)¶
componentChanges¶
-
public Observable<LanguageComponentChange>
componentChanges
()¶
getAllComponents¶
-
public Iterable<? extends ILanguageComponent>
getAllComponents
()¶
getAllImpls¶
-
public Iterable<? extends ILanguageImpl>
getAllImpls
()¶
getComponent¶
-
public ILanguageComponent
getComponent
(LanguageIdentifier identifier)¶
getComponent¶
-
public ILanguageComponent
getComponent
(FileName location)¶
getImpl¶
-
public ILanguageImpl
getImpl
(LanguageIdentifier identifier)¶
implChanges¶
-
public Observable<LanguageImplChange>
implChanges
()¶
remove¶
-
public void
remove
(ILanguageComponent component)¶
LanguageUtils¶
-
public class
LanguageUtils
¶
Methods¶
active¶
-
public static ILanguageImpl
active
(Iterable<? extends ILanguageImpl> impls)¶
allActiveComponents¶
-
public static Iterable<ILanguageComponent>
allActiveComponents
(ILanguageService languageService)¶
allActiveImpls¶
-
public static Iterable<ILanguageImpl>
allActiveImpls
(ILanguageService languageService)¶
toComponents¶
-
public static Set<ILanguageComponent>
toComponents
(Iterable<? extends ILanguageImpl> impls)¶
toImpls¶
-
public static Set<ILanguageImpl>
toImpls
(Iterable<? extends ILanguageComponent> components)¶
LanguageVersion¶
-
public class
LanguageVersion
implements Comparable<LanguageVersion>, Serializable¶ Representation for the version of a language. Follows the Maven versioning style.
Fields¶
Constructors¶
LanguagesFileSelector¶
-
public class
LanguagesFileSelector
implements FileSelector¶
Constructors¶
LanguagesFileSelector¶
-
public
LanguagesFileSelector
(ILanguageIdentifierService languageIdentifierService, Iterable<ILanguageImpl> languages)¶
Methods¶
includeFile¶
-
public boolean
includeFile
(FileSelectInfo fileInfo)¶
traverseDescendents¶
-
public boolean
traverseDescendents
(FileSelectInfo fileInfo)¶
ResourceExtensionFacet¶
-
public class
ResourceExtensionFacet
implements IFacet¶ Represents a facet that specifies the file extensions for languages. Complements the
IdentificationFacet
.
ResourceExtensionsIdentifier¶
-
public class
ResourceExtensionsIdentifier
implements Func1<FileObject, Boolean>, Serializable¶
Constructors¶
Methods¶
call¶
-
public Boolean
call
(FileObject resource)¶
org.metaborg.core.language.dialect¶
IDialectIdentifier¶
-
public interface
IDialectIdentifier
¶ Interface for identifying the dialect of a resource.
Methods¶
identify¶
-
IdentifiedDialect
identify
(FileObject resource)¶ Attempts to identify the dialect of given resource.
Parameters: - resource – Resource to identify.
Throws: - MetaborgException – When resource requires a dialect that is not available.
Returns: Identified dialect, or null if dialect could not be identified.
identify¶
-
boolean
identify
(FileObject resource, ILanguageImpl dialect)¶ Checks if given resource is of given dialect.
Parameters: - resource – Resource to check.
- dialect – Dialect to check against.
Throws: - MetaborgException – When resource requires a dialect that is not available.
Returns: True if resource is of given dialect, false otherwise.
IDialectProcessor¶
-
public interface
IDialectProcessor
¶ Interface for processing dialect updates.
Methods¶
update¶
-
void
update
(FileObject location, Iterable<ResourceChange> changes)¶ Updates dialects using given changes.
Parameters: - location – Location to process changes for.
- changes – Resource changes to process.
update¶
-
void
update
(LanguageImplChange change)¶ Updates dialects using a language implementation change.
Parameters: - change – Language change to process.
IDialectService¶
-
public interface
IDialectService
¶
Methods¶
add¶
-
ILanguageImpl
add
(String name, FileObject location, ILanguageImpl base, IFacet syntaxFacet)¶ Creates a new dialect language for given base language and parser facet. The dialect replaces the parser facet, and retains all other facets of the base language.
Parameters: - name – Name of the new dialect language.
- location – Location of the new dialect language.
- base – Base language of the dialect.
- syntaxFacet – Syntax facet to replace the base language’s syntax facet with.
Throws: - MetaborgRuntimeException – When dialect with given name already exists.
Returns: Created dialect language.
dialectName¶
-
String
dialectName
(ILanguageImpl dialect)¶ Returns dialect name for the given dialect.
Parameters: - dialect – The dialect.
Returns: the name of the dialect, null if it isn’t a dialect.
getBase¶
-
ILanguageImpl
getBase
(ILanguageImpl dialect)¶ Gets the base language for given dialect.
Parameters: - dialect – Dialect to get base language for.
Returns: Base language of given dialect, or null if given language is not a dialect or the dialect has been removed.
getDialect¶
-
ILanguageImpl
getDialect
(String name)¶ Gets dialect language with given name.
Parameters: - name – Name of the dialect to get.
Returns: Dialect language with given name, or null if it does not exist.
getDialects¶
-
Iterable<ILanguageImpl>
getDialects
(ILanguageImpl base)¶ Gets all dialects for given base language
Parameters: - base – Base language of the dialects.
Returns: Dialects for given base language.
hasDialect¶
remove¶
-
ILanguageImpl
remove
(String name)¶ Removes dialect with given name.
Parameters: - name – Name of the dialect to remove.
Throws: - MetaborgRuntimeException – When dialect with given name does not exist.
Returns: Removed dialect language.
remove¶
-
Iterable<ILanguageImpl>
remove
(ILanguageImpl base)¶ Removes all dialects based on given language. Does nothing if there are no dialects of that language.
Parameters: - base – Base language to remove all dialects for.
Returns: Removed dialect languages.
update¶
-
ILanguageImpl
update
(String name, IFacet parserFacet)¶ Updates dialect of given name, with a new parser facet.
Parameters: - name – Name of the dialect to update.
- parserFacet – Parser facet to update the dialect with.
Throws: - MetaborgRuntimeException – When dialect with given name does not exist.
Returns: Updated dialect language.
update¶
-
Iterable<ILanguageImpl>
update
(ILanguageImpl base)¶ Updates all dialects based on
base
. Does nothing if there were no dialects based onbase
.Parameters: - base – Base language for which to update dialects.
Returns: Updated dialect languages.
IdentifiedDialect¶
-
public class
IdentifiedDialect
¶ Dialect with its base language.
Fields¶
base¶
-
public final ILanguageImpl
base
¶ Base language of the dialect.
dialect¶
-
public final ILanguageImpl
dialect
¶ The dialect.
Constructors¶
IdentifiedDialect¶
-
public
IdentifiedDialect
(ILanguageImpl dialect, ILanguageImpl base)¶
org.metaborg.core.messages¶
IMessage¶
-
public interface
IMessage
extends Serializable¶ Interface representing a message on a region in a source file.
Methods¶
exception¶
region¶
-
ISourceRegion
region
()¶ Returns: Affected region inside the source, or null if the entire source is affected.
severity¶
-
MessageSeverity
severity
()¶ Returns: Message severity
source¶
-
FileObject
source
()¶ Returns: Source of the message, or null if the source is unknown.
type¶
-
MessageType
type
()¶ Returns: Message type.
IMessagePrinter¶
-
public interface
IMessagePrinter
¶ Interface for printing messages.
Methods¶
print¶
print¶
-
void
print
(FileObject resource, String message, Throwable e, boolean pardoned)¶ Prints given message and exception, located at a resource. Used if the source location is not available.
Parameters: - resource – Resource the message occurred in, or null if the message was detached.
- message – Message to print.
- e – Exception to print, or null if there is no exception.
- pardoned – If the (error or warning) message is pardoned, i.e. the message is acceptable even if it indicates a problem.
print¶
-
void
print
(IProject project, String message, Throwable e, boolean pardoned)¶ Prints given message and exception, located at a project. Used if the source location or resource is not available.
Parameters: - project – Project the message occurred in.
- message – Message to print.
- e – Exception to print, or null if there is no exception.
- pardoned – If the (error or warning) message is pardoned, i.e. the message is acceptable even if it indicates a problem.
Message¶
Constructors¶
Message¶
-
public
Message
(String message, MessageSeverity severity, MessageType type, FileObject source, ISourceRegion region, Throwable exception)¶
MessageBuilder¶
-
public class
MessageBuilder
¶
Methods¶
asAnalysis¶
-
public MessageBuilder
asAnalysis
()¶
asError¶
-
public MessageBuilder
asError
()¶
asInternal¶
-
public MessageBuilder
asInternal
()¶
asNote¶
-
public MessageBuilder
asNote
()¶
asParser¶
-
public MessageBuilder
asParser
()¶
asTransform¶
-
public MessageBuilder
asTransform
()¶
asWarning¶
-
public MessageBuilder
asWarning
()¶
create¶
-
public static MessageBuilder
create
()¶
withException¶
-
public MessageBuilder
withException
(Throwable exception)¶
withMessage¶
-
public MessageBuilder
withMessage
(String message)¶
withRegion¶
-
public MessageBuilder
withRegion
(ISourceRegion region)¶
withSeverity¶
-
public MessageBuilder
withSeverity
(MessageSeverity severity)¶
withSource¶
-
public MessageBuilder
withSource
(FileObject source)¶
withType¶
-
public MessageBuilder
withType
(MessageType type)¶
MessageFactory¶
-
public class
MessageFactory
¶
Methods¶
newAnalysisError¶
-
public static Message
newAnalysisError
(FileObject resource, ISourceRegion region, String msg, Throwable cause)¶
newAnalysisErrorAtTop¶
-
public static Message
newAnalysisErrorAtTop
(FileObject resource, String msg, Throwable cause)¶
newAnalysisMessage¶
-
public static Message
newAnalysisMessage
(FileObject resource, ISourceRegion region, String msg, MessageSeverity severity, Throwable cause)¶
newAnalysisMessageAtTop¶
-
public static Message
newAnalysisMessageAtTop
(FileObject resource, String msg, MessageSeverity severity, Throwable cause)¶
newAnalysisNote¶
-
public static Message
newAnalysisNote
(FileObject resource, ISourceRegion region, String msg, Throwable cause)¶
newAnalysisNoteAtTop¶
-
public static Message
newAnalysisNoteAtTop
(FileObject resource, String msg, Throwable cause)¶
newAnalysisWarning¶
-
public static Message
newAnalysisWarning
(FileObject resource, ISourceRegion region, String msg, Throwable cause)¶
newAnalysisWarningAtTop¶
-
public static Message
newAnalysisWarningAtTop
(FileObject resource, String msg, Throwable cause)¶
newAtTop¶
-
public static Message
newAtTop
(FileObject resource, String msg, MessageType type, MessageSeverity severity, Throwable cause)¶
newBuilderErrorAtTop¶
-
public static Message
newBuilderErrorAtTop
(FileObject resource, String msg, Throwable cause)¶
newBuilderWarningAtTop¶
-
public static Message
newBuilderWarningAtTop
(FileObject resource, String msg, Throwable cause)¶
newErrorAtTop¶
-
public static Message
newErrorAtTop
(FileObject resource, String msg, MessageType type, Throwable cause)¶
newMessage¶
-
public static Message
newMessage
(FileObject resource, ISourceRegion region, String msg, MessageSeverity severity, MessageType type, Throwable cause)¶
newNoteAtTop¶
-
public static Message
newNoteAtTop
(FileObject resource, String msg, MessageType type, Throwable cause)¶
newParseError¶
-
public static Message
newParseError
(FileObject resource, ISourceRegion region, String msg, Throwable cause)¶
newParseErrorAtTop¶
-
public static Message
newParseErrorAtTop
(FileObject resource, String msg, Throwable cause)¶
newParseMessage¶
-
public static Message
newParseMessage
(FileObject resource, ISourceRegion region, String msg, MessageSeverity severity, Throwable cause)¶
newParseWarning¶
-
public static Message
newParseWarning
(FileObject resource, ISourceRegion region, String msg, Throwable cause)¶
newParseWarningAtTop¶
-
public static Message
newParseWarningAtTop
(FileObject resource, String msg, Throwable cause)¶
newWarningAtTop¶
-
public static Message
newWarningAtTop
(FileObject resource, String msg, MessageType type, Throwable cause)¶
MessageSeverity¶
-
public enum
MessageSeverity
implements Serializable¶
Enum Constants¶
ERROR¶
-
public static final MessageSeverity
ERROR
¶
NOTE¶
-
public static final MessageSeverity
NOTE
¶
WARNING¶
-
public static final MessageSeverity
WARNING
¶
MessageType¶
-
public enum
MessageType
implements Serializable¶
Enum Constants¶
ANALYSIS¶
-
public static final MessageType
ANALYSIS
¶
INTERNAL¶
-
public static final MessageType
INTERNAL
¶
PARSER¶
-
public static final MessageType
PARSER
¶
TRANSFORMATION¶
-
public static final MessageType
TRANSFORMATION
¶
StreamMessagePrinter¶
-
public class
StreamMessagePrinter
implements IMessagePrinter¶ Message printer implementation that prints detailed messages to a stream.
Constructors¶
StreamMessagePrinter¶
-
public
StreamMessagePrinter
(ISourceTextService sourceTextService, boolean printHighlight, boolean printExceptions, OutputStream infoStream, OutputStream warnStream, OutputStream errorStream)¶
StreamMessagePrinter¶
-
public
StreamMessagePrinter
(ISourceTextService sourceTextService, boolean printHighlight, boolean printExceptions, ILogger logger)¶
WithLocationStreamMessagePrinter¶
-
public class
WithLocationStreamMessagePrinter
implements IMessagePrinter¶ Prints note, warning, and error messages similar to large compilers such as GCC or Clang. That is, the message comes with filename, line, column, and severity. Also the affected code is underlined with carets (^).
Constructors¶
WithLocationStreamMessagePrinter¶
-
public
WithLocationStreamMessagePrinter
(ISourceTextService sourceTextService, IProjectService projectService, OutputStream outputStream)¶
org.metaborg.core.outline¶
IOutlineNode¶
-
public interface
IOutlineNode
¶ Interface representing a node in an outline tree view.
Methods¶
icon¶
-
FileObject
icon
()¶ Returns: File object containing an icon, or null if there is no icon.
nodes¶
-
Iterable<IOutlineNode>
nodes
()¶ Returns: Sub nodes
origin¶
-
ISourceRegion
origin
()¶ Returns: Region in the source text this node originates from, or null if no region is available.
parent¶
-
IOutlineNode
parent
()¶ Returns: Parent node, or null if this is a root.
IOutlineService¶
-
public interface
IOutlineService
<P extends IParseUnit, A extends IAnalyzeUnit>¶ Interface for creating outlines.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
Methods¶
available¶
-
boolean
available
(ILanguageImpl langImpl)¶ Checks if outlining is available for given language implementation.
Parameters: - langImpl – Language implementation to check.
Returns: True if outlining is available, false if not.
outline¶
-
IOutline
outline
(P result)¶ Creates an outline from given parse unit.
Parameters: - result – Parsed result.
Throws: - MetaborgException – When creating an outline fails unexpectedly.
Returns: Created outline, or null if the outline is empty.
outline¶
-
IOutline
outline
(A result)¶ Creates an outline from given analyze unit.
Parameters: - result – Analyzed result.
Throws: - MetaborgException – When creating an outline fails unexpectedly.
Returns: Created outline, or null if the outline is empty.
OutlineNode¶
-
public class
OutlineNode
implements IOutlineNode¶
Constructors¶
OutlineNode¶
-
public
OutlineNode
(String label, FileObject icon, ISourceRegion origin, IOutlineNode parent)¶
Methods¶
addChild¶
-
public void
addChild
(IOutlineNode child)¶
icon¶
-
public FileObject
icon
()¶
nodes¶
-
public Iterable<IOutlineNode>
nodes
()¶
origin¶
-
public ISourceRegion
origin
()¶
parent¶
-
public IOutlineNode
parent
()¶
org.metaborg.core.plugin¶
IModulePluginLoader¶
IServiceModulePlugin¶
ServiceModulePluginLoader¶
-
public class
ServiceModulePluginLoader
<T extends IServiceModulePlugin> implements IModulePluginLoader¶ Module plugin loader using Java’s
ServiceLoader
.
org.metaborg.core.processing¶
BlockingProcessor¶
-
public class
BlockingProcessor
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>> implements IProcessor<P, A, AU, T>¶ Processor implementation that uses
BlockingTask
as task implementation. Tasks execute and block when scheduled.
Constructors¶
BlockingProcessor¶
-
public
BlockingProcessor
(IDialectProcessor dialectProcessor, IBuilder<P, A, AU, T> builder, ILanguageChangeProcessor languageChangeProcessor)¶
Methods¶
build¶
-
public ITask<? extends IBuildOutput<P, A, AU, T>>
build
(BuildInput input, IProgress progressReporter, ICancel cancellationToken)¶
clean¶
-
public ITask<?>
clean
(CleanInput input, IProgress progressReporter, ICancel cancellationToken)¶
languageChange¶
-
public ITask<?>
languageChange
(LanguageComponentChange change)¶
languageChange¶
-
public ITask<?>
languageChange
(LanguageImplChange change)¶
updateDialects¶
-
public ITask<?>
updateDialects
(FileObject location, Iterable<ResourceChange> changes)¶
BlockingTask¶
CancellationToken¶
-
public class
CancellationToken
implements ICancel¶ Simple cancellation token implementation.
ICancellationToken¶
-
public interface
ICancellationToken
extends ICancel¶ Interface for figuring out if something has been cancelled.
ILanguageChangeProcessor¶
-
public interface
ILanguageChangeProcessor
¶ Interface for processing language change events. Used internally only, clients should use a
IProcessorRunner
which handles language change events automatically.
Methods¶
processComponentChange¶
-
void
processComponentChange
(LanguageComponentChange change)¶ Process given language component change event.
Parameters: - change – Language implementation component event to process.
processImplChange¶
-
void
processImplChange
(LanguageImplChange change)¶ Process given language implementation change event.
Parameters: - change – Language implementation change event to process.
IProcessor¶
-
public interface
IProcessor
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>>¶ Interface for creating processing tasks. Used internally, clients should use a
IProcessorRunner
.Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units.
Methods¶
build¶
-
ITask<? extends IBuildOutput<P, A, AU, T>>
build
(BuildInput input, IProgress progressReporter, ICancel cancellationToken)¶ See also:
IProcessorRunner.build(BuildInput,IProgress,ICancel)
clean¶
-
ITask<?>
clean
(CleanInput input, IProgress progressReporter, ICancel cancellationToken)¶ See also:
IProcessorRunner.clean(CleanInput,IProgress,ICancel)
languageChange¶
-
ITask<?>
languageChange
(LanguageComponentChange change)¶ Creates a task that processes given language component change.
Parameters: - change – Language implementation change to process.
Returns: Task that processes given language change.
languageChange¶
-
ITask<?>
languageChange
(LanguageImplChange change)¶ Creates a task that processes given language implementation change.
Parameters: - change – Language implementation change to process.
Returns: Task that processes given language change.
updateDialects¶
-
ITask<?>
updateDialects
(FileObject location, Iterable<ResourceChange> changes)¶ See also:
IProcessorRunner.updateDialects(FileObject,Iterable)
IProcessorRunner¶
-
public interface
IProcessorRunner
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>>¶ Interface for language processing. Handles building and cleaning on-demand, and language change events automatically.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <AU> – Type of analyze unit updates.
- <T> – Type of transform units.
Methods¶
build¶
-
ITask<? extends IBuildOutput<P, A, AU, T>>
build
(BuildInput input, IProgress progress, ICancel cancel)¶ Creates a task that builds with given build input.
Parameters: - input – Build input to use.
- progress – Progress reporter, or null to use a processor-specific implementation for progress reporting.
- cancel – Cancellation token, or null to a use a processor-specific implementation for cancellation.
Returns: Task that builds with given input, and has the build output as result. Schedule the task and wait for it to complete to get the build output.
clean¶
-
ITask<?>
clean
(CleanInput input, IProgress progress, ICancel cancel)¶ Creates a task that cleans with given clean input.
Parameters: - input – Clean input to use.
- progress – Progress reporter, or null to use a processor-specific implementation for progress reporting.
- cancel – Cancellation token, or null to a use a processor-specific implementation for cancellation.
Returns: Task that cleans with given input.
updateDialects¶
-
ITask<?>
updateDialects
(FileObject location, Iterable<ResourceChange> changes)¶ Creates a task that updates dialects using given changes.
Parameters: - location – Location to process changes at.
- changes – Resource changes to process.
Returns: Task that processes dialect updates.
IProgressReporter¶
-
public interface
IProgressReporter
extends IProgress¶ Interface for progress reporting.
ITask¶
-
public interface
ITask
<T>¶ Interface for asynchronous task with cancellation.
Parameters: - <T> – Type of the result.
Methods¶
block¶
-
ITask<T>
block
()¶ Blocks until the task has been completed or cancelled, and return itself.
Throws: - InterruptedException – When the task has been cancelled while blocking.
cancel¶
-
void
cancel
(int forceTimeout)¶ Request cancellation, force cancel after after
stopTimeout
milliseconds.Parameters: - forceTimeout – Timeout in milliseconds after which the cancellation is forced.
LanguageChangeProcessor¶
-
public class
LanguageChangeProcessor
implements ILanguageChangeProcessor¶ Default implementation for the language change processor.
Constructors¶
LanguageChangeProcessor¶
-
public
LanguageChangeProcessor
(IDialectProcessor dialectProcessor, IContextProcessor contextProcessor, IParseResultProcessor<?, ?> parseResultProcessor, IAnalysisResultProcessor<?, ?, ?> analysisResultProcessor, IEditorRegistry editorRegistry, Set<ILanguageCache> languageCaches)¶
Methods¶
addedComponent¶
-
protected void
addedComponent
(ILanguageComponent component)¶ Component was added
Parameters: - component – Added component
addedImpl¶
-
protected void
addedImpl
(ILanguageImpl impl)¶ Implementation was added
Parameters: - impl – Added implementation
processComponentChange¶
-
public void
processComponentChange
(LanguageComponentChange change)¶
processImplChange¶
-
public void
processImplChange
(LanguageImplChange change)¶
reloadedComponent¶
-
protected void
reloadedComponent
(ILanguageComponent oldComponent, ILanguageComponent newComponent)¶ Component was reloaded
Parameters: - oldComponent – Component before the reload
- newComponent – Component after the reload
reloadedImpl¶
-
protected void
reloadedImpl
(ILanguageImpl impl)¶ Implementation was reloaded
Parameters: - impl – Reloaded implementation
removedComponent¶
-
protected void
removedComponent
(ILanguageComponent component)¶ Component was removed
Parameters: - component – Removed component
removedImpl¶
-
protected void
removedImpl
(ILanguageImpl impl)¶ Implementation was removed
Parameters: - impl – Removed implementation
NullCancellationToken¶
-
public class
NullCancellationToken
extends NullCancel implements ICancel¶ Cancellation token implementation that never cancels.
NullProgressReporter¶
-
public class
NullProgressReporter
extends NullProgress implements IProgress¶ Progress reporter implementation that ignores all progress reporting.
ProcessorRunner¶
-
public class
ProcessorRunner
<P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, T extends ITransformUnit<?>> implements IProcessorRunner<P, A, AU, T>¶ Default implementation for the processor runner.
Constructors¶
ProcessorRunner¶
-
public
ProcessorRunner
(IProcessor<P, A, AU, T> processor, ILanguageService languageService)¶
Methods¶
build¶
-
public ITask<? extends IBuildOutput<P, A, AU, T>>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
clean¶
-
public ITask<?>
clean
(CleanInput input, IProgress progress, ICancel cancel)¶
updateDialects¶
-
public ITask<?>
updateDialects
(FileObject location, Iterable<ResourceChange> changes)¶
org.metaborg.core.processing.analyze¶
AnalysisChange¶
-
public class
AnalysisChange
<A extends IAnalyzeUnit>¶
Fields¶
exception¶
-
public final AnalysisException
exception
¶
kind¶
-
public final UpdateKind
kind
¶
resource¶
-
public final FileObject
resource
¶
Constructors¶
AnalysisChange¶
-
protected
AnalysisChange
(UpdateKind kind, FileObject resource, A result, AnalysisException exception)¶
Methods¶
error¶
-
public static <A extends IAnalyzeUnit> AnalysisChange<A>
error
(FileObject resource, AnalysisException exception)¶ Creates an analysis change that represents an error that occurred while updating an analysis result.
Parameters: - resource – Changed resource.
- exception – Error that occurred.
Returns: Analysis change.
invalidate¶
-
public static <A extends IAnalyzeUnit> AnalysisChange<A>
invalidate
(FileObject resource)¶ Creates an analysis change that represents an invalidation of given resource.
Parameters: - resource – Resource to invalidate.
Returns: Analysis change.
remove¶
-
public static <A extends IAnalyzeUnit> AnalysisChange<A>
remove
(FileObject resource)¶ Creates an analysis change that represents removal of an analysis result.
Parameters: - resource – Resource that was removed.
Returns: Analysis change.
update¶
-
public static <A extends IAnalyzeUnit> AnalysisChange<A>
update
(FileObject resource, A result)¶ Creates an analysis change that represents an update to the analysis result.
Parameters: - resource – Changed resource.
- result – Updated analysis result.
- parentResult – Parent of the updated analysis result.
Returns: Analysis change.
AnalysisResultProcessor¶
-
public class
AnalysisResultProcessor
<I extends IInputUnit, P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate> implements IAnalysisResultProcessor<I, P, A>¶
Constructors¶
AnalysisResultProcessor¶
-
public
AnalysisResultProcessor
(IAnalysisService<P, A, AU> analysisService, IParseResultRequester<I, P> parseResultRequester)¶
Methods¶
error¶
-
public void
error
(FileObject resource, AnalysisException exception)¶
error¶
-
public void
error
(Iterable<P> results, AnalysisException exception)¶
get¶
-
public A
get
(FileObject resource)¶
invalidate¶
-
public void
invalidate
(FileObject resource)¶
invalidate¶
-
public void
invalidate
(ILanguageImpl impl)¶
remove¶
-
public void
remove
(FileObject resource)¶
updates¶
-
public Observable<AnalysisChange<A>>
updates
(FileObject resource)¶
IAnalysisResultProcessor¶
-
public interface
IAnalysisResultProcessor
<I extends IInputUnit, P extends IParseUnit, A extends IAnalyzeUnit> extends IAnalysisResultRequester<I, A>, IAnalysisResultUpdater<P, A>¶ Typedef interface for combining
IAnalysisResultRequester
andIAnalysisResultUpdater
.
IAnalysisResultRequester¶
-
public interface
IAnalysisResultRequester
<I extends IInputUnit, A extends IAnalyzeUnit>¶ Interface for requesting single analysis results or updates for analysis results.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
Methods¶
get¶
-
A
get
(FileObject resource)¶ Returns: Latest analysis result for given resource, or null if there is none.
request¶
-
Observable<A>
request
(I input, IContext context)¶ Requests the analysis result for given resource. When subscribing to the returned observer, it always returns a single element; the latest analysis result, or pushes an error if an error occurred while getting it. If the analysis result is cached, the observable will immediately push it. If the analysis result has been invalidated (when it is in the process of being updated), it will be pushed when it has been updated. If there is no analysis result yet, it will request a parse result, analyze the resource in given context, and push the analysis result. The simplest way to get the analysis result is to wait for it:
result = requester.request(resource, context, text).toBlocking().single();
Parameters: - resource – Resource to get the analysis result for.
- context – Context in which the analysis should be performed, in case there is no analysis result for given resource.
- text – Text which should be parsed, in case there is no parse result for given resource.
Returns: Cold observable which pushes a single element when subscribed; the latest analysis result, or pushes an error if an error occurred while getting it.
updates¶
-
Observable<AnalysisChange<A>>
updates
(FileObject resource)¶ Returns an observable that pushes analysis result updates to subscribers for given resource.
Parameters: - resource – Resource to push updates for.
Returns: Hot observable that pushes updates to subscribers for given resource.
IAnalysisResultUpdater¶
-
public interface
IAnalysisResultUpdater
<P extends IParseUnit, A extends IAnalyzeUnit>¶ Interface for updating analysis results which are requested by an
IAnalysisResultRequester
.Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
Methods¶
error¶
-
void
error
(FileObject resource, AnalysisException exception)¶ Sets an analysis error for given resource. Pushes the analysis error to subscribed requests.
Parameters: - resource – Resource to set an analysis error for.
- exception – Analysis error to set.
error¶
-
void
error
(Iterable<P> results, AnalysisException exception)¶ Sets an analysis error for sources in given parse result. Pushes analysis errors to subscribed requests.
Parameters: - results – Parse results with sources to set an analysis error for.
- exception – Analysis error to set.
invalidate¶
-
void
invalidate
(FileObject resource)¶ Invalidates the analysis result for given resource. Must be followed by a call to
update
orerror
for that resource eventually. Failing to do so will block any request made while resource was in an invalid state.Parameters: - resource – Resource to invalidate.
invalidate¶
-
void
invalidate
(Iterable<P> results)¶ Invalidates the analysis results for sources in given parse results. Must be followed by a call to
update
orerror
for those resources eventually. Failing to do so will block any requests made while resources were in invalid states.Parameters: - results – Parse results with sources to invalidate.
invalidate¶
-
void
invalidate
(ILanguageImpl lang)¶ Invalidates the analysis results for all sources for the given language. Must be followed by a call to
update
orerror
for those resources eventually. Failing to do so will block any requests made while resources were in invalid states.Parameters: - lang – Language to invalidate for.
remove¶
-
void
remove
(FileObject resource)¶ Removes cached analysis results for given resource.
Parameters: - resource – Resource to remove cached analysis results for.
update¶
-
void
update
(A result, Set<FileName> removedResources)¶ Updates the analysis result for a single resource. Pushes the analysis result to subscribed requests. Removes cached analysis results for given removed resource.
Parameters: - result – Result to update.
- parentResult – Parent of the result to update.
- removedResources – Set of resources that have actually been removed instead of updated. Used for legacy analysis where removal is indicated by an empty tuple as parse result.
org.metaborg.core.processing.parse¶
IParseResultProcessor¶
-
public interface
IParseResultProcessor
<I extends IInputUnit, P extends IParseUnit> extends IParseResultRequester<I, P>, IParseResultUpdater<P>¶ Typedef interface for combining
IParseResultRequester
andIParseResultUpdater
.
IParseResultRequester¶
-
public interface
IParseResultRequester
<I extends IInputUnit, P extends IParseUnit>¶ Interface for requesting single parse results or updates for parse results.
Methods¶
get¶
-
P
get
(FileObject resource)¶ Returns: Latest parse result for given resource, or null if there is none.
request¶
-
Observable<P>
request
(I unit)¶ Requests the parse result for given resource. When subscribing to the returned observer, it always returns a single element; the latest parse result, or pushes an error if an error occurred while getting it. If the parse result is cached, the observable will immediately push it. If the parse result has been invalidated (when it is in the process of being updated), it will be pushed when it has been updated. If there is no parse result yet, it will parse with given text and push the parse result. The simplest way to get the parse result is to wait for it:
result = requester.request(resource, language, text).toBlocking().single();
Parameters: - resource – Resource to get the parse result for.
- language – Language given text should be parsed with, in case there is no parse result for given resource.
- text – Text which should be parsed, in case there is no parse result for given resource.
Returns: Cold observable which pushes a single element when subscribed; the latest parse result, or pushes an error if an error occurred while getting it.
updates¶
-
Observable<ParseChange<P>>
updates
(FileObject resource)¶ Returns an observable that pushes parse result updates to subscribers for given resource.
Parameters: - resource – Resource to push updates for.
Returns: Hot observable that pushes updates to subscribers for given resource.
IParseResultUpdater¶
-
public interface
IParseResultUpdater
<P extends IParseUnit>¶ Interface for updating parse results which are requested by an
IParseResultRequester
.
Methods¶
error¶
-
void
error
(FileObject resource, ParseException exception)¶ Sets a parse error for given resource. Pushes the parse error to subscribed requests.
Parameters: - resource – Resource to set a parse error for.
- exception – Parse error to set.
invalidate¶
-
void
invalidate
(FileObject resource)¶ Invalidates the parse result for given resource. Must be followed by a call to
update
orerror
for that resource eventually. Failing to do so will block any request made while resource was in an invalid state.Parameters: - resource – Resource to invalidate.
invalidate¶
-
void
invalidate
(ILanguageImpl lang)¶ Invalidates the parse result for all sources of the given language. Must be followed by a call to
update
orerror
for that resource eventually. Failing to do so will block any request made while resource was in an invalid state.Parameters: - lang – Language to invalidate for.
remove¶
-
void
remove
(FileObject resource)¶ Removes cached parse results for given resource.
Parameters: - resource – Resource to remove cached parse results for.
update¶
-
void
update
(FileObject resource, P unit)¶ Updates the parse result for a single resource. Pushes the parse result to subscribed requests.
Parameters: - result – Result to update.
- result – Parent of the result to update.
ParseChange¶
-
public class
ParseChange
<P extends IParseUnit>¶
Fields¶
exception¶
-
public final ParseException
exception
¶
kind¶
-
public final UpdateKind
kind
¶
resource¶
-
public final FileObject
resource
¶
Constructors¶
ParseChange¶
-
protected
ParseChange
(UpdateKind kind, FileObject resource, P unit, ParseException exception)¶
Methods¶
error¶
-
public static <P extends IParseUnit> ParseChange<P>
error
(ParseException exception)¶ Creates a parse change that represents an error that occurred while updating a parse result.
Parameters: - exception – Error that occurred.
Returns: Parse change.
invalidate¶
-
public static <P extends IParseUnit> ParseChange<P>
invalidate
(FileObject resource)¶ Creates a parse change that represents an invalidation of given resource.
Parameters: - resource – Resource to invalidate.
Returns: Parse change.
remove¶
-
public static <P extends IParseUnit> ParseChange<P>
remove
(FileObject resource)¶ Creates a parse change that represents removal of a parse result.
Parameters: - resource – Resource that was removed.
Returns: Parse change.
update¶
-
public static <P extends IParseUnit> ParseChange<P>
update
(P unit)¶ Creates a parse change that represents an update to the parse result.
Parameters: - result – Updated parse result.
Returns: Parse change.
ParseResultProcessor¶
-
public class
ParseResultProcessor
<I extends IInputUnit, P extends IParseUnit> implements IParseResultProcessor<I, P>¶
Constructors¶
ParseResultProcessor¶
-
public
ParseResultProcessor
(ISyntaxService<I, P> syntaxService)¶
Methods¶
error¶
-
public void
error
(FileObject resource, ParseException exception)¶
get¶
-
public P
get
(FileObject resource)¶
invalidate¶
-
public void
invalidate
(FileObject resource)¶
invalidate¶
-
public void
invalidate
(ILanguageImpl impl)¶
remove¶
-
public void
remove
(FileObject resource)¶
update¶
-
public void
update
(FileObject resource, P unit)¶
updates¶
-
public Observable<ParseChange<P>>
updates
(FileObject resource)¶
org.metaborg.core.project¶
ConfigBasedProjectService¶
-
public class
ConfigBasedProjectService
implements IProjectService¶
Constructors¶
ConfigBasedProjectService¶
-
public
ConfigBasedProjectService
(ISourceTextService sourceTextService, IProjectConfigService projectConfigService)¶
Methods¶
get¶
-
public IProject
get
(FileObject resource)¶
DummyProjectService¶
-
public class
DummyProjectService
implements IProjectService¶
Methods¶
get¶
-
public IProject
get
(FileObject resource)¶
IProject¶
-
public interface
IProject
¶
Methods¶
config¶
-
IProjectConfig
config
()¶ Gets the configuration of the project. The configuration is read only once when this class is instantiated. To get a new configuration, get a new instance of this class.
Returns: Configuration of the project.
location¶
-
FileObject
location
()¶ Gets the location of the root folder of the project.
Returns: Location of the root folder.
IProjectService¶
-
public interface
IProjectService
¶ Interface for retrieving projects of resources.
Methods¶
get¶
-
IProject
get
(FileObject resource)¶ Retrieves the project of given resource.
Parameters: - resource – Resource to retrieve project for.
Returns: Retrieved project, or null if no project could be retrieved.
ISimpleProjectService¶
-
public interface
ISimpleProjectService
extends IProjectService¶ Specialization of the
IProjectService
that supports creating and removing projects. Project instances are returned based on the file names of projects and resources. Nested projects are not supported.
Methods¶
create¶
-
IProject
create
(FileObject location)¶ Creates a project at given location.
Throws: - MetaborgException – When a project already exists at given location, or when given location is nested in another project.
Returns: Created project.
remove¶
-
void
remove
(IProject project)¶ Removes given project.
Parameters: - project – Project to remove.
Throws: - MetaborgException – When given project does not exist in this project service.
Project¶
Constructors¶
Project¶
-
public
Project
(FileObject location, IProjectConfig config)¶
ProjectException¶
-
public class
ProjectException
extends MetaborgException¶
SimpleProjectService¶
-
public class
SimpleProjectService
implements ISimpleProjectService¶
Constructors¶
SimpleProjectService¶
-
public
SimpleProjectService
(ISourceTextService sourceTextService, IProjectConfigService projectConfigService)¶
SingleFileProjectService¶
-
public class
SingleFileProjectService
implements IProjectService¶ Creates a project from a single file with the parent directory as project location (if possible, otherwise just the file) and no config (== null). Never returns null for the project. Doesn’t cache projects.
Constructors¶
SingleFileProjectService¶
-
public
SingleFileProjectService
(IProjectConfigService projectConfigService)¶
Methods¶
get¶
-
public IProject
get
(FileObject resource)¶
org.metaborg.core.resource¶
DefaultFileSystemManagerProvider¶
-
public class
DefaultFileSystemManagerProvider
implements Provider<FileSystemManager>¶ Guice provider for the VFS file system manager. Subclass and override the protected methods, and bind the provider in your Guice module, to customize the file providers.
Methods¶
addDefaultProvider¶
-
protected void
addDefaultProvider
(DefaultFileSystemManager manager)¶
addProviders¶
-
protected void
addProviders
(DefaultFileSystemManager manager)¶
get¶
-
public FileSystemManager
get
()¶
setBaseFile¶
-
protected void
setBaseFile
(DefaultFileSystemManager manager)¶
IResourceChangeService¶
-
public interface
IResourceChangeService
¶ Interface for subscribing to resource changes.
Methods¶
changes¶
-
Observable<ResourceChange>
changes
()¶ Returns an observable over resource changes. This returns a ‘hot’ observable, meaning that any changes that occurred before subscribing are NOT observed.
IResourceService¶
-
public interface
IResourceService
extends AutoCloseable¶ Interface for access to the virtual file system.
Methods¶
localFile¶
-
File
localFile
(FileObject resource)¶ Attempts to get a local file for given resource, or copies the resource to the local file system if it does not reside on the local file system.
Parameters: - resource – Resource to get a local file for.
Throws: - MetaborgRuntimeException – When given resource does not exist.
Returns: Local file.
localFile¶
-
File
localFile
(FileObject resource, FileObject dir)¶ Attempts to get a local file for given resource, or copies the resource to the local file system at given directory if it does not reside on the local file system.
Parameters: - resource – Resource to get a local file for.
- dir – Directory to copy the resources to if they are not on a local filesystem. Must be on the local filesystem.
Throws: - MetaborgRuntimeException – When given resource does not exist.
Returns: Local file.
localPath¶
-
File
localPath
(FileObject resource)¶ Attempts to get a local file handle for given resource.
Parameters: - resource – Resource to get a local file handle for.
Returns: Local file handle, or null if given resource does not reside on the local file system.
resolve¶
-
FileObject
resolve
(String uri)¶ Returns a file system object for given (absolute or relative to the root) URI. The given URI will be encoded (, /, and : symbols will not be encoded) in its entirely. If your URI is already encoded, convert it to an
URI
and callresolve(URI)
instead. See FVS file systems for examples of URIs.Parameters: - uri – Absolute or relative to the root URI to resolve.
Throws: - MetaborgRuntimeException – When
uri
is invalid.
Returns: File system object for given URI.
resolve¶
-
FileObject
resolve
(File file)¶ Returns a local file system object for given Java file system object.
Parameters: - file – Java file system object to resolve.
Throws: - MetaborgRuntimeException – When file is invalid.
Returns: File system object for given Java file system object.
resolve¶
-
FileObject
resolve
(URI uri)¶ Returns a file system object for given Java URI object. See FVS file systems for examples of URIs.
Parameters: - uri – Java URI object to resolve.
Throws: - MetaborgRuntimeException – When
uri
is invalid.
Returns: File system object for given Java URI object.
resolve¶
-
FileObject
resolve
(FileObject parent, String path)¶ Tries to resolve
path
as an absolute path first, if that fails, resolvespath
relative toparent
. Ifpath
is absolute but does not have a scheme, it is assumed to be on the local file system.Parameters: - parent – Parent file object to resolve relatively to, if
path
is a relative path. - path – Path to resolve
Throws: - MetaborgRuntimeException – When absolute or relative resolution fails.
Returns: File system object for given path.
- parent – Parent file object to resolve relatively to, if
resolveToName¶
-
FileName
resolveToName
(String uri)¶ Returns a file name for given URI. The given URI will be encoded (, /, and : symbols will not be encoded) in its entirely. If your URI is already encoded, convert it to an
URI
and callresolveToName(URI)
instead. See FVS file systems for examples of URIs.Parameters: - uri – URI to resolve to a name.
Throws: - MetaborgRuntimeException – When
uri
is invalid.
Returns: File name for given URI.
resolveToName¶
-
FileName
resolveToName
(URI uri)¶ Returns a file name for given Java URI object. See FVS file systems for examples of URIs.
Parameters: - uri – Java URI object to resolve to a name.
Throws: - MetaborgRuntimeException – When
uri
is invalid.
Returns: File name for given Java URI object.
root¶
-
FileObject
root
()¶ Returns the root file system object.
Throws: - MetaborgRuntimeException – if an error occurs.
Returns: The root file system object.
IResourceTreeChange¶
-
public interface
IResourceTreeChange
¶ Interface for changes on resource trees between two discrete points in time. A tree represents a change in a resource, and changes in child resources.
Methods¶
children¶
-
Iterable<IResourceTreeChange>
children
()¶ Returns changes in children of the changed resource. Only child resources with changes will be returned. The returned changes are also trees, which can be traversed further.
kind¶
-
ResourceChangeKind
kind
()¶ Returns the kind of change.
resource¶
-
FileObject
resource
()¶ Returns the resource that has changed.
IdentifiedResourceChange¶
-
public class
IdentifiedResourceChange
¶ Resource change with an identified language and dialect.
Fields¶
change¶
-
public final ResourceChange
change
¶ Resource change.
dialect¶
-
public final ILanguageImpl
dialect
¶ Identified dialect of the resource change, or null if it does not have a dialect.
language¶
-
public final ILanguageImpl
language
¶ Identified language of the resource change.
Constructors¶
IdentifiedResourceChange¶
-
public
IdentifiedResourceChange
(ResourceChange change, IdentifiedDialect identifiedDialect)¶
IdentifiedResourceChange¶
-
public
IdentifiedResourceChange
(ResourceChange change, IdentifiedResource identifiedResource)¶
IdentifiedResourceChange¶
-
public
IdentifiedResourceChange
(ResourceChange change, ILanguageImpl dialect, ILanguageImpl language)¶
ResourceChange¶
-
public final class
ResourceChange
implements Serializable¶
Fields¶
from¶
-
public final FileObject
from
¶ Resource based on the value of
ResourceChange.kind
.ResourceChangeKind.Rename
: resource it was renamed from.ResourceChangeKind.Copy
: resource it was copied from.- otherwise: null
kind¶
-
public final ResourceChangeKind
kind
¶ Kind of change.
resource¶
-
public final FileObject
resource
¶ Resource that has changed.
to¶
-
public final FileObject
to
¶ Resource based on the value of
ResourceChange.kind
.ResourceChangeKind.Rename
: resource it was renamed to.ResourceChangeKind.Copy
: resource it was copied to.- otherwise: null
Constructors¶
ResourceChange¶
-
public
ResourceChange
(FileObject resource, ResourceChangeKind kind, FileObject renamedFrom, FileObject renamedTo)¶
ResourceChange¶
-
public
ResourceChange
(FileObject resource, ResourceChangeKind kind)¶
ResourceChange¶
-
public
ResourceChange
(FileObject resource)¶
ResourceChangeKind¶
-
public enum
ResourceChangeKind
¶
Enum Constants¶
Copy¶
-
public static final ResourceChangeKind
Copy
¶
Create¶
-
public static final ResourceChangeKind
Create
¶
Delete¶
-
public static final ResourceChangeKind
Delete
¶
Modify¶
-
public static final ResourceChangeKind
Modify
¶
Rename¶
-
public static final ResourceChangeKind
Rename
¶
ResourceService¶
-
public class
ResourceService
implements IResourceService¶
Constructors¶
ResourceService¶
-
public
ResourceService
(FileSystemManager fileSystemManager, ClassLoader classLoader)¶
Methods¶
localFile¶
-
public File
localFile
(FileObject resource)¶
localFile¶
-
public File
localFile
(FileObject resource, FileObject dir)¶
localPath¶
-
public File
localPath
(FileObject resource)¶
resolve¶
-
public FileObject
resolve
(String uri)¶
resolve¶
-
public FileObject
resolve
(File file)¶
resolve¶
-
public FileObject
resolve
(URI uri)¶
resolve¶
-
public FileObject
resolve
(FileObject parent, String path)¶
root¶
-
public FileObject
root
()¶
ResourceUtils¶
-
public class
ResourceUtils
¶
Methods¶
find¶
-
public static Iterable<FileObject>
find
(FileObject base, FileSelector selector)¶
find¶
-
public static Iterable<FileObject>
find
(FileObject base)¶
toChanges¶
-
public static Iterable<ResourceChange>
toChanges
(Iterable<FileObject> resources, ResourceChangeKind kind)¶
org.metaborg.core.source¶
AffectedSourceHelper¶
-
public class
AffectedSourceHelper
¶ Helper class for highlighting code in consoles.
Methods¶
affectedSourceText¶
-
public static String
affectedSourceText
(ISourceRegion region, String sourceText, String indentation)¶ Returns a multi-line string that highlights the affected source code region, given the full source text and indentation to use.
Parameters: - region – Region in the source text that should be highlighted.
- sourceText – Full source text.
- indentation – Indentation to add to each line in the resulting string.
Returns: Multi-line string that highlights the affected source code region.
ISourceLocation¶
-
public interface
ISourceLocation
¶ Represents a region in a resource.
Methods¶
region¶
-
ISourceRegion
region
()¶ Returns: Region in the source file.
resource¶
-
FileObject
resource
()¶ Returns: Resource of the source file, or null if the source file could not be determined.
ISourceRegion¶
-
public interface
ISourceRegion
extends Serializable¶ Interface for representing a finite region in source code text. A region has:
- Offset - number of characters from the beginning of the source text, with interval [0,#chars).
- Row - row or line in the source text, with interval [0,#rows), or -1 if the row is not supported.
- Column - column in the source text, with interval [0,#columns@row), or -1 if the column is not supported.
Both the starting and ending numbers are inclusive.
Methods¶
contains¶
-
boolean
contains
(ISourceRegion region)¶ Checks if this region contains given region.
Parameters: - region – Other region to check.
Returns: True if this region contains given region, false otherwise.
endColumn¶
-
int
endColumn
()¶ Returns: Inclusive ending column in the source text with interval [0,#columns@row), or -1 if not supported by this source region.
endOffset¶
-
int
endOffset
()¶ Returns: Inclusive ending offset, the number of characters from the beginning of the source text with interval [0,#chars).
endRow¶
-
int
endRow
()¶ Returns: Inclusive ending row or line in the source text with interval [0,#rows), or -1 if not supported by this source region.
startColumn¶
-
int
startColumn
()¶ Returns: Inclusive starting column in the source text with interval [0,#columns@row), or -1 if not supported by this source region.
ISourceTextService¶
-
public interface
ISourceTextService
¶ Interface for retrieving text of resources.
Methods¶
text¶
-
String
text
(FileObject resource)¶ Retrieves the text for given resource.
Parameters: - resource – Resource to retrieve text for.
Returns: Text for given resource.
SourceLocation¶
-
public class
SourceLocation
implements ISourceLocation¶
Constructors¶
SourceLocation¶
-
public
SourceLocation
(ISourceRegion region, FileObject resource)¶
SourceRegion¶
-
public class
SourceRegion
implements ISourceRegion¶
Constructors¶
SourceRegion¶
-
public
SourceRegion
(int offset)¶ Creates a zero-length source region from a single offset. Row and column fields are set to -1 to indicate that they are not supported.
Parameters: - offset – Offset in the source file.
SourceRegion¶
-
public
SourceRegion
(int startOffset, int endOffset)¶ Creates a source region from a starting and ending offset. Row and column fields are set to -1 to indicate that they are not supported.
Parameters: - startOffset – Starting offset in the source file.
- endOffset – Ending offset in the source file.
Methods¶
contains¶
-
public boolean
contains
(ISourceRegion region)¶
SourceTextService¶
-
public class
SourceTextService
implements ISourceTextService¶
Methods¶
text¶
-
public String
text
(FileObject resource)¶
org.metaborg.core.style¶
ICategorizerService¶
-
public interface
ICategorizerService
<P extends IParseUnit, A extends IAnalyzeUnit, F>¶ Interface for categorization of parse and analysis results.
Parameters: - <P> – Type of parse units
- <A> – Type of analyze units.
- <F> – Type of fragments.
Methods¶
categorize¶
-
Iterable<IRegionCategory<F>>
categorize
(ILanguageImpl langImpl, P result)¶ Returns a categorization of given parse result.
Parameters: - langImpl – Language implementation that contains the categorization logic.
- parseResult – Parse result to categorize.
Returns: Iterable over categories assigned to regions of the source text. Regions do not overlap and are iterated over in ascending order.
categorize¶
-
Iterable<IRegionCategory<F>>
categorize
(ILanguageImpl langImpl, A result)¶ Returns a categorization of given analysis result.
Parameters: - langImpl – Language implementation that contains the categorization logic.
- analysisResult – Analysis result to categorize.
Returns: Iterable over categories assigned to regions of the source text. Regions do not overlap and are iterated over in ascending order.
IRegionCategory¶
-
public interface
IRegionCategory
<F>¶ Interface for categories that range over a region in source text. Created by the
ICategorizerService
from a parse or analysis result.Parameters: - <F> – Type of fragments.
IRegionStyle¶
-
public interface
IRegionStyle
<F>¶ Interface for styles that range over a region in source text. Created by the
IStylerService
from a categorization of a parse or analysis result.Parameters: - <F> – Type of fragments.
IStylerService¶
-
public interface
IStylerService
<F>¶ Interface for styling of categorized parse and analysis results.
Parameters: - <F> – Type of fragments.
Methods¶
styleAnalyzed¶
-
Iterable<IRegionStyle<F>>
styleAnalyzed
(ILanguageImpl langImpl, Iterable<IRegionCategory<F>> categorization)¶ Returns a styling of given categorized analysis result.
Parameters: - langImpl – Language implementation that contains the styling logic.
- categorization – Analysis result categorization to style.
Returns: Iterable over styles assigned to regions of the source text. Regions do not overlap and are iterated over in ascending order.
styleParsed¶
-
Iterable<IRegionStyle<F>>
styleParsed
(ILanguageImpl langImpl, Iterable<IRegionCategory<F>> categorization)¶ Returns a styling of given categorized parse result.
Parameters: - langImpl – Language implementation that contains the styling logic.
- categorization – Parse result categorization to style.
Returns: Iterable over styles assigned to regions of the source text. Regions do not overlap and are iterated over in ascending order.
RegionCategory¶
-
public class
RegionCategory
<F> implements IRegionCategory<F>¶
Constructors¶
RegionCategory¶
-
public
RegionCategory
(ISourceRegion region, ICategory category, F fragment)¶
RegionStyle¶
-
public class
RegionStyle
<F> implements IRegionStyle<F>¶
Constructors¶
RegionStyle¶
-
public
RegionStyle
(ISourceRegion region, IStyle style, F fragment)¶
org.metaborg.core.syntax¶
IInputUnit¶
-
public interface
IInputUnit
extends IUnit¶ Unit representing a textual source file of a certain language implementation. An input unit can be passed to the
ISyntaxService
to parse the source file into aIParseUnit
.
Methods¶
dialect¶
-
ILanguageImpl
dialect
()¶ Returns: Dialect of the source file, or null if it has no dialect.
langImpl¶
-
ILanguageImpl
langImpl
()¶ Returns: Language implementation of the source file.
IParseUnit¶
-
public interface
IParseUnit
extends IUnit¶ Unit representing a parsed source file. A parse unit can be passed to the
IAnalysisService
to analyze the parse unit into aIAnalyzeUnit
, or passed to theITransformService
to transform the parse unit into aITransformUnit
.
IParser¶
-
public interface
IParser
<I extends IInputUnit, P extends IParseUnit>¶ Interface for a context-free parser implementation.
Parameters: - <I> – Type of input units.
- <P> – Type of parse units.
Methods¶
parse¶
-
P
parse
(I input, IProgress progress, ICancel cancel)¶ Parses given input unit into a parse unit.
Parameters: - input – Input unit to parse.
Throws: - ParseException – When parsing fails unexpectedly.
- InterruptedException – When parsing is cancelled.
Returns: Parse unit.
parseAll¶
-
Collection<P>
parseAll
(Iterable<I> inputs, IProgress progress, ICancel cancel)¶ Parses all given input units into a parse units.
Parameters: - inputs – Input units to parse.
Throws: - ParseException – When parsing fails unexpectedly.
- InterruptedException – When parsing is cancelled.
Returns: Parse units.
ISyntaxService¶
-
public interface
ISyntaxService
<I extends IInputUnit, P extends IParseUnit>¶ Interface for context-free syntactical services, including parsing and information about lexical characters.
Parameters: - <I> – Type of input units.
- <P> – Type of parse units.
Methods¶
available¶
-
boolean
available
(ILanguageImpl langImpl)¶ Checks if syntactical services are available for given language implementation.
Parameters: - langImpl – Language implementation to check.
Returns: True if syntactical services are available, false if not.
fenceCharacters¶
-
Iterable<FenceCharacters>
fenceCharacters
(ILanguageImpl langImpl)¶ Returns: Fence (brackets, parentheses, etc.) open and close characters for given language.
multiLineCommentCharacters¶
-
Iterable<MultiLineCommentCharacters>
multiLineCommentCharacters
(ILanguageImpl langImpl)¶ Returns: Multi line comment prefix and postfix characters for given language.
parse¶
-
P
parse
(I input, IProgress progress, ICancel cancel)¶ Parses given input unit into a parse unit.
Parameters: - input – Input unit to parse.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - ParseException – When parsing fails unexpectedly.
- InterruptedException – When parsing is cancelled.
Returns: Parse unit.
parse¶
-
P
parse
(I input)¶ Parses given input unit into a parse unit.
Parameters: - input – Input unit to parse.
Throws: - ParseException – When parsing fails unexpectedly.
Returns: Parse unit.
parseAll¶
-
Collection<P>
parseAll
(Iterable<I> inputs, IProgress progress, ICancel cancel)¶ Parses all given input units into a parse units.
Parameters: - inputs – Input units to parse.
- progress – Progress reporter.
- cancel – Cancellation token.
Throws: - ParseException – When parsing fails unexpectedly.
- InterruptedException – When parsing is cancelled.
Returns: Parse units.
parseAll¶
-
Collection<P>
parseAll
(Iterable<I> inputs)¶ Parses all given input units into a parse units.
Parameters: - inputs – Input units to parse.
Throws: - ParseException – When parsing fails unexpectedly.
Returns: Parse units.
singleLineCommentPrefixes¶
-
Iterable<String>
singleLineCommentPrefixes
(ILanguageImpl langImpl)¶ Returns: Single line comment prefix characters for given language.
ParseException¶
-
public class
ParseException
extends MetaborgException¶ Exception indicating that parsing failed unexpectedly.
Fields¶
unit¶
-
public final IInputUnit
unit
¶
Constructors¶
ParseException¶
-
public
ParseException
(IInputUnit unit)¶
ParseException¶
-
public
ParseException
(IInputUnit unit, String message)¶
ParseException¶
-
public
ParseException
(IInputUnit unit, Throwable cause)¶
ParseException¶
-
public
ParseException
(IInputUnit unit, String message, Throwable cause)¶
ParseFacet¶
SyntaxService¶
-
public abstract class
SyntaxService
<I extends IInputUnit, P extends IParseUnit> implements ISyntaxService<I, P>¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl langImpl)¶
parseAll¶
-
public Collection<P>
parseAll
(Iterable<I> inputs, IProgress progress, ICancel cancel)¶
org.metaborg.core.testing¶
ITestReporterService¶
-
public interface
ITestReporterService
¶ Used to report the status of tests. Derive from
TestReporterServiceBase
instead of this interface. The base class performs some additional checks to ensure it is used correctly. Test frameworks, such as SPT, can report the status of the testing through a test reporter. Different test reporters handle these status messages differently. For example, a test reporter might simply write the test status to the standard output, whereas another test reporter would report the test results in the IDE UI.
Methods¶
getErr¶
-
PrintStream
getErr
()¶ Gets a stream to which test errors may be written.
Returns: A stream.
getLogger¶
-
ILogger
getLogger
()¶ Gets a logger to which the test output may be logged.
Returns: A logger.
getOut¶
-
PrintStream
getOut
()¶ Gets a stream to which test output may be written.
Returns: A stream.
sessionFinished¶
-
void
sessionFinished
()¶ The test session has finished. After this method no calls to the reporter are allowed.
sessionStarted¶
-
void
sessionStarted
()¶ A test session has started. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.
testFailed¶
-
void
testFailed
(String name, String reason, String details)¶ The test has finished and failed. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
- reason – The reason the test failed; or null.
- details – The details about the failed test, such as additional messages and the stack trace; or null.
testIgnored¶
-
void
testIgnored
(String name, String reason)¶ The test has finished and was ignored. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
- reason – The reason the test was ignored; or null.
testPassed¶
-
void
testPassed
(String name)¶ The test has finished and passed. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
testStarted¶
-
void
testStarted
(String name)¶ A test has started. After this method only calls to
testPassed(String)
,testFailed(String,String,String)
andtestIgnored(String,String)
are allowed.Parameters: - name – The name of the test.
testSuiteFinished¶
-
void
testSuiteFinished
(String name)¶ The test suite has finished. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test suite.
testSuiteStarted¶
-
void
testSuiteStarted
(String name)¶ A test suite has started. After this method only calls to
testSuiteStarted(String)
,testSuiteFinished(String)
andtestStarted(String)
are allowed. In other words, test suites can be nested.Parameters: - name – The name of the test suite.
LoggingTestReporterService¶
-
public final class
LoggingTestReporterService
extends TestReporterServiceBase¶ Test reporter that logs to the logger, standard out and standard error. If you want to change the default output of a test runner (e.g. SPT), this is the place to be.
TeamCityLogger¶
-
public class
TeamCityLogger
extends AbstractLogger¶ Logger producing TeamCity messages.
Constructors¶
TeamCityLogger¶
-
public
TeamCityLogger
(TeamCityWriter writer)¶
Methods¶
TeamCityTestReporterService¶
-
public class
TeamCityTestReporterService
extends TestReporterServiceBase¶ Test reporter that produces TeamCity test service messages.
See also: ` Build Script Interaction with TeamCity <https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity>`_
Constructors¶
TeamCityTestReporterService¶
-
public
TeamCityTestReporterService
(TeamCityWriter writer, TeamCityLogger logger)¶
TeamCityWriter¶
-
public class
TeamCityWriter
¶ Writes Teamcity messages.
Constructors¶
TeamCityWriter¶
-
public
TeamCityWriter
()¶ Creates a new instance of
TeamCityWriter
that writes to standard out and has no flow ID.
TeamCityWriter¶
-
public
TeamCityWriter
(PrintStream output, String flowID)¶ Creates a new instance of
TeamCityWriter
.Parameters: - output – The stream to write to.
- flowID – he flow ID that indicates which messages belong together; or null.
TestReporterServiceBase¶
-
public abstract class
TestReporterServiceBase
implements ITestReporterService¶ Used to report the status of tests. This base class performs some additional checks to ensure it is used correctly.
Methods¶
onTestFailed¶
-
protected abstract void
onTestFailed
(String name, String reason, String details)¶ The test has finished and failed.
Parameters: - name – The name of the test.
- reason – The reason the test failed; or null.
- details – The details about the failed test, such as additional messages and the stack trace; or null.
onTestIgnored¶
onTestPassed¶
onTestStarted¶
onTestSuiteFinished¶
onTestSuiteStarted¶
org.metaborg.core.tracing¶
Hover¶
-
public class
Hover
¶ Represents hover information produced by the hover service.
Fields¶
region¶
-
public final ISourceRegion
region
¶ Region in the source file where the hover information is for.
Constructors¶
Hover¶
-
public
Hover
(ISourceRegion region, String text)¶
IHoverService¶
-
public interface
IHoverService
<P extends IParseUnit, A extends IAnalyzeUnit>¶ Interface for getting hover tooltip information.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
Methods¶
available¶
-
boolean
available
(ILanguageImpl language)¶ Checks if hover tooltip information is available for given language implementation.
Parameters: - language – Language implementation to check.
Returns: True if hover tooltip information is available, false if not.
hover¶
-
Hover
hover
(int offset, P input)¶ Attempts to get hover tooltip information at
offset
in the source text, using given parsed input for resolving and tracing.Parameters: - offset – Offset in the source text.
- input – Parsed input to use for tracing.
Throws: - MetaborgException – When retrieving information fails unexpectedly.
Returns: Hover tooltip information if successful, or null if no information can be retrieved.
hover¶
-
Hover
hover
(int offset, A input)¶ Attempts to get hover tooltip information at
offset
in the source text, using given analyzed input for resolving and tracing.Parameters: - offset – Offset in the source text.
- input – Analyzed input to use for tracing.
Throws: - MetaborgException – When retrieving information fails unexpectedly.
Returns: Hover tooltip information if successful, or null if no information can be retrieved.
IResolverService¶
-
public interface
IResolverService
<P extends IParseUnit, A extends IAnalyzeUnit>¶ Interface for reference resolution, resolving use sites to their definition sites.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
Methods¶
available¶
-
boolean
available
(ILanguageImpl language)¶ Checks if reference resolution is available for given language implementation.
Parameters: - language – Language implementation to check.
Returns: True if reference resolution is available, false if not.
resolve¶
-
Resolution
resolve
(int offset, P input)¶ Attempt to resolve use site at
offset
in the source text, using given parse result for resolving and tracing.Parameters: - offset – Offset in the source text to perform reference resolution for.
- input – Parsed input to use for resolving and tracing.
Throws: - MetaborgException – When reference resolution fails unexpectedly.
Returns: Resolution if reference resolution was successful, or null if no resolution could be made.
resolve¶
-
Resolution
resolve
(int offset, A input)¶ Attempt to resolve use site at
offset
in the source text, using given analysis result for resolving and tracing.Parameters: - offset – Offset in the source text to perform reference resolution for.
- input – Analyzed input to use for resolving and tracing.
Throws: - MetaborgException – When reference resolution fails unexpectedly.
Returns: Resolution if reference resolution was successful, or null if no resolution could be made.
ITracingService¶
-
public interface
ITracingService
<P extends IParseUnit, A extends IAnalyzeUnit, T extends ITransformUnit<?>, F>¶ Interface for tracing between parsed, analyzed, and transformed fragments and results, and their region in source files.
Parameters: - <P> – Type of parse units
- <A> – Type of analyze units.
- <T> – Type of transform units.
- <F> – Type of fragments.
Methods¶
fragments¶
-
Iterable<F>
fragments
(P result, ISourceRegion region)¶ Finds a fragment and its ancestors that contain given region, in given parse result.
Parameters: - result – Parsed result to get fragments from.
- region – Region inside the result to get fragments for.
Returns: Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.
fragments¶
-
Iterable<F>
fragments
(A result, ISourceRegion region)¶ Finds a fragment and its ancestors that contain given region, in given analysis file result.
Parameters: - result – Analyzed result to get fragments from.
- region – Region inside the result to get fragments for.
Returns: Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.
fragments¶
-
Iterable<F>
fragments
(T result, ISourceRegion region)¶ Finds a fragment and its ancestors that contain given region, in given transform result.
Parameters: - result – Transformed result to get fragments from.
- region – Region inside the to get fragments for.
Returns: Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.
fragmentsWithin¶
-
Iterable<F>
fragmentsWithin
(P result, ISourceRegion region)¶ Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.
Parameters: - result – Parsed result to get fragments from.
- region – Region inside the result to get fragments for.
Returns: Fragments contained within the given region. An empty iterable is returned when no fragments could be found.
fragmentsWithin¶
-
Iterable<F>
fragmentsWithin
(A result, ISourceRegion region)¶ Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.
Parameters: - result – Analyzed result to get fragments from.
- region – Region inside the result to get fragments for.
Returns: Fragments contained within the given region. An empty iterable is returned when no fragments could be found.
fragmentsWithin¶
-
Iterable<F>
fragmentsWithin
(T result, ISourceRegion region)¶ Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.
Parameters: - result – Transformed result to get fragments from.
- region – Region inside the result to get fragments for.
Returns: Fragments contained within the given region. An empty iterable is returned when no fragments could be found.
location¶
-
ISourceLocation
location
(F fragment)¶ Retrieves the source location of given fragment.
Parameters: - fragment – Fragment to get source location for.
Returns: Source location, or null if it could not be determined.
Resolution¶
-
public class
Resolution
¶ Represents a resolution produced by reference resolution.
Fields¶
highlight¶
-
public final ISourceRegion
highlight
¶ Area in the source file to highlight as a hyperlink.
targets¶
-
public final Iterable<ResolutionTarget>
targets
¶ Resolution targets. Multiple targets indicate resolution to multiple valid locations.
Constructors¶
Resolution¶
-
public
Resolution
(ISourceRegion highlight, Iterable<ResolutionTarget> targets)¶
ResolutionTarget¶
-
public class
ResolutionTarget
¶
Fields¶
location¶
-
public final ISourceLocation
location
¶
Constructors¶
ResolutionTarget¶
-
public
ResolutionTarget
(ISourceLocation location)¶
ResolutionTarget¶
-
public
ResolutionTarget
(String hyperlinkName, ISourceLocation location)¶
org.metaborg.core.transform¶
ITransformConfig¶
-
public interface
ITransformConfig
¶ Optional configuration for the transform service.
ITransformService¶
-
public interface
ITransformService
<P extends IParseUnit, A extends IAnalyzeUnit, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>>¶ Interface for transformations on parsed or analyzed files.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <TP> – Type of transform units with parse units as input.
- <TA> – Type of transform units with analyze units as input.
Methods¶
available¶
-
boolean
available
(IContext context, ITransformGoal goal)¶ Checks if transform actions are available for given context and goal.
Parameters: - context – Context to check transform actions from.
- goal – Goal to check transform actions for.
Returns: True if transform actions are available, false if not.
requiresAnalysis¶
-
boolean
requiresAnalysis
(IContext context, ITransformGoal goal)¶ Checks if analysis is required before transformation, for given context and goal.
Parameters: - context – Context to check from.
- goal – Goal to check for.
Returns: True if analysis is required, false if not.
transform¶
-
Collection<TP>
transform
(P input, IContext context, ITransformGoal goal)¶ Transforms parse input in a context with given goal.
Parameters: - input – Parsed input to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transform¶
-
Collection<TP>
transform
(P input, IContext context, ITransformGoal goal, ITransformConfig config)¶ Transforms parse input in a context with given goal.
Parameters: - input – Parsed input to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transform¶
-
TP
transform
(P input, IContext context, TransformActionContrib action)¶ Transforms parse input in a context with given action.
Parameters: - input – Parsed input to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
Throws: - TransformException – When transformation action requires analysis.
Returns: Transformation result.
transform¶
-
TP
transform
(P input, IContext context, TransformActionContrib action, ITransformConfig config)¶ Transforms parse input in a context with given action.
Parameters: - input – Parsed input to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When transformation action requires analysis.
Returns: Transformation result.
transform¶
-
Collection<TA>
transform
(A input, IContext context, ITransformGoal goal)¶ Transforms analyzed input in a context with given goal.
Parameters: - input – Analyzed input to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transform¶
-
Collection<TA>
transform
(A input, IContext context, ITransformGoal goal, ITransformConfig config)¶ Transforms analyzed input in a context with given goal.
Parameters: - input – Analyzed input to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transform¶
-
TA
transform
(A input, IContext context, TransformActionContrib action)¶ Transforms analyzed input in a context with given action.
Parameters: - input – Analyzed input to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transform¶
-
TA
transform
(A input, IContext context, TransformActionContrib action, ITransformConfig config)¶ Transforms analyzed input in a context with given action.
Parameters: - input – Analyzed input to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation result.
transformAllAnalyzed¶
-
Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, ITransformGoal goal)¶ Transforms analyzed inputs in a context with given goal.
Parameters: - inputs – Analyzed inputs to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllAnalyzed¶
-
Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, ITransformGoal goal, ITransformConfig config)¶ Transforms analyzed inputs in a context with given goal.
Parameters: - inputs – Analyzed inputs to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllAnalyzed¶
-
Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, TransformActionContrib action)¶ Transforms analyzed inputs in a context with given action.
Parameters: - input – Analyzed inputs to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllAnalyzed¶
-
Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶ Transforms analyzed inputs in a context with given action.
Parameters: - input – Analyzed inputs to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllParsed¶
-
Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, ITransformGoal goal)¶ Transforms parse inputs in a context with given goal.
Parameters: - inputs – Parsed inputs to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllParsed¶
-
Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, ITransformGoal goal, ITransformConfig config)¶ Transforms parse inputs in a context with given goal.
Parameters: - inputs – Parsed inputs to transform.
- context – Context in which to apply transformation.
- goal – Transform goal to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When the transformation fails unexpectedly.
Returns: Transformation results.
transformAllParsed¶
-
Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, TransformActionContrib action)¶ Transforms parse input in a context with given action.
Parameters: - inputs – Parsed inputs to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
Throws: - TransformException – When transformation action requires analysis.
Returns: Transformation results.
transformAllParsed¶
-
Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶ Transforms parse input in a context with given action.
Parameters: - inputs – Parsed inputs to transform.
- context – Context in which to apply transformation.
- action – Transform action to execute.
- config – Configuration settings for the execution of the transformation.
Throws: - TransformException – When transformation action requires analysis.
Returns: Transformation results.
ITransformUnit¶
-
public interface
ITransformUnit
<I extends IUnit> extends IUnit¶ Unit representing a transformed source file.
Parameters: - <I> – Type of input unit.
Methods¶
action¶
-
TransformActionContrib
action
()¶ Returns: The action that was used to execute the transformation.
duration¶
-
long
duration
()¶ Returns: Transformation duration in nanoseconds, or -1 if the duration is unknown.
outputs¶
-
Iterable<? extends ITransformOutput>
outputs
()¶ Returns: Outputs of the transformation. Empty if valid()
returns false.
ITransformer¶
-
public interface
ITransformer
<P extends IParseUnit, A extends IAnalyzeUnit, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>>¶ Interface for transformation implementations.
Parameters: - <P> – Type of parse units.
- <A> – Type of analyze units.
- <TP> – Type of transform units with parse units as input.
- <TA> – Type of transform units with analyze units as input.
Methods¶
transform¶
-
TP
transform
(P input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transform¶
-
TA
transform
(A input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllAnalyzed¶
-
Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllParsed¶
-
Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
TransformException¶
-
public class
TransformException
extends MetaborgException¶ Exception indicating that transformation failed unexpectedly.
TransformService¶
-
public class
TransformService
<P extends IParseUnit, A extends IAnalyzeUnit, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>> implements ITransformService<P, A, TP, TA>¶
Constructors¶
TransformService¶
-
public
TransformService
(IActionService actionService, IAnalysisService<P, A, ?> analysisService, ITransformer<P, A, TP, TA> transformer)¶
Methods¶
available¶
-
public boolean
available
(IContext context, ITransformGoal goal)¶
requiresAnalysis¶
-
public boolean
requiresAnalysis
(IContext context, ITransformGoal goal)¶
transform¶
-
public Collection<TP>
transform
(P input, IContext context, ITransformGoal goal, ITransformConfig config)¶
transform¶
-
public TP
transform
(P input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transform¶
-
public Collection<TA>
transform
(A input, IContext context, ITransformGoal goal, ITransformConfig config)¶
transform¶
-
public TA
transform
(A input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllAnalyzed¶
-
public Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, ITransformGoal goal, ITransformConfig config)¶
transformAllAnalyzed¶
-
public Collection<TA>
transformAllAnalyzed
(Iterable<A> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllParsed¶
-
public Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, ITransformGoal goal, ITransformConfig config)¶
transformAllParsed¶
-
public Collection<TP>
transformAllParsed
(Iterable<P> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
org.metaborg.core.unit¶
IInputUnitService¶
-
public interface
IInputUnitService
<I extends IInputUnit>¶
Methods¶
emptyInputUnit¶
-
I
emptyInputUnit
(FileObject source, ILanguageImpl langImpl, ILanguageImpl dialect)¶
emptyInputUnit¶
-
I
emptyInputUnit
(ILanguageImpl langImpl, ILanguageImpl dialect)¶
inputUnit¶
-
I
inputUnit
(FileObject source, String text, ILanguageImpl langImpl, ILanguageImpl dialect)¶
inputUnit¶
-
I
inputUnit
(String text, ILanguageImpl langImpl, ILanguageImpl dialect)¶
IUnit¶
-
public interface
IUnit
¶ Results of operations on a single source file. Extensible through unit contributions.
Methods¶
detached¶
-
boolean
detached
()¶ Returns: True if the unit is detached, i.e. the source is unknown. False otherwise.
source¶
-
FileObject
source
()¶ Returns: Source file that operations were executed on, or null
if the source file is unknown. The source file can be unknown when executing operations on a string of text in memory for example. When the source is unknown, this unit is detached.
unitContrib¶
-
IUnitContrib
unitContrib
(String id)¶ Returns a unit contribution with given identifier.
Parameters: - id – Unit contribution identifier.
Returns: Unit contribution with given identifier, or null if it does not exist.
unitContribs¶
-
Iterable<IUnitContrib>
unitContribs
()¶ Returns: All unit contributions.
IUnitService¶
-
public interface
IUnitService
<I extends IInputUnit, P extends IParseUnit, A extends IAnalyzeUnit, AU extends IAnalyzeUnitUpdate, TP extends ITransformUnit<P>, TA extends ITransformUnit<A>> extends IInputUnitService<I>¶
Methods¶
emptyAnalyzeUnitUpdate¶
-
AU
emptyAnalyzeUnitUpdate
(FileObject source, IContext context)¶
emptyTransformUnit¶
-
TP
emptyTransformUnit
(P input, IContext context, TransformActionContrib action)¶
emptyTransformUnit¶
-
TA
emptyTransformUnit
(A input, IContext context, TransformActionContrib action)¶
Javadoc¶
org.metaborg.spoofax.core¶
Spoofax¶
-
public class
Spoofax
extends MetaBorgGeneric<ISpoofaxInputUnit, ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>, IStrategoTerm>¶ Facade for instantiating and accessing the Metaborg API, instantiated with the Spoofax implementation.
Fields¶
analysisResultProcessor¶
-
public final ISpoofaxAnalysisResultProcessor
analysisResultProcessor
¶
analysisService¶
-
public final ISpoofaxAnalysisService
analysisService
¶
builder¶
-
public final ISpoofaxBuilder
builder
¶
categorizerService¶
-
public final ISpoofaxCategorizerService
categorizerService
¶
completionService¶
-
public final ISpoofaxCompletionService
completionService
¶
hoverService¶
-
public final ISpoofaxHoverService
hoverService
¶
outlineService¶
-
public final ISpoofaxOutlineService
outlineService
¶
parseResultProcessor¶
-
public final ISpoofaxParseResultProcessor
parseResultProcessor
¶
processorRunner¶
-
public final ISpoofaxProcessorRunner
processorRunner
¶
resolverService¶
-
public final ISpoofaxResolverService
resolverService
¶
strategoCommon¶
-
public final IStrategoCommon
strategoCommon
¶
strategoRuntimeService¶
-
public final IStrategoRuntimeService
strategoRuntimeService
¶
stylerService¶
-
public final ISpoofaxStylerService
stylerService
¶
syntaxService¶
-
public final ISpoofaxSyntaxService
syntaxService
¶
termFactoryService¶
-
public final ITermFactoryService
termFactoryService
¶
tracingService¶
-
public final ISpoofaxTracingService
tracingService
¶
transformService¶
-
public final ISpoofaxTransformService
transformService
¶
unitService¶
-
public final ISpoofaxUnitService
unitService
¶
Constructors¶
Spoofax¶
-
public
Spoofax
(IModulePluginLoader loader, SpoofaxModule module, Module... additionalModules)¶ Instantiate the MetaBorg API with a Spoofax implementation.
Parameters: - loader – Module plugin loader to use.
- module – Spoofax module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Spoofax¶
-
public
Spoofax
(SpoofaxModule module, Module... additionalModules)¶ Instantiate the MetaBorg API with a Spoofax implementation.
Parameters: - module – Spoofax module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Spoofax¶
-
public
Spoofax
(IModulePluginLoader loader, Module... additionalModules)¶ Instantiate the MetaBorg API with a Spoofax implementation.
Parameters: - loader – Module plugin loader to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Methods¶
defaultModule¶
-
protected static SpoofaxModule
defaultModule
()¶
SpoofaxConstants¶
-
public class
SpoofaxConstants
¶
Fields¶
Methods¶
isMetaLanguage¶
-
public static boolean
isMetaLanguage
(ILanguageImpl language)¶
isMetaLanguage¶
-
public static boolean
isMetaLanguage
(LanguageIdentifier identifier)¶
SpoofaxModule¶
-
public class
SpoofaxModule
extends MetaborgModule¶ Guice module that specifies which implementations to use for services and factories.
Constructors¶
SpoofaxModule¶
-
public
SpoofaxModule
(ClassLoader resourceClassLoader)¶
Methods¶
bindAnalysis¶
-
protected void
bindAnalysis
()¶ Overrides
MetaborgModule.bindAnalysis()
to provide Spoofax-specific bindings with Spoofax interfaces, and to provide analyzers.
bindBuilder¶
-
protected void
bindBuilder
()¶ Overrides
MetaborgModule.bindBuilder()
to provide Spoofax-specific bindings with generics filled in asIStrategoTerm
.
bindContextFactories¶
-
protected void
bindContextFactories
(MapBinder<String, IContextFactory> binder)¶
bindParsers¶
-
protected void
bindParsers
(MapBinder<String, IParser<ISpoofaxInputUnit, ISpoofaxParseUnit>> parserBinder, MapBinder<String, ISpoofaxParser> spoofaxParserBinder)¶
bindPrimitive¶
-
protected static void
bindPrimitive
(Multibinder<AbstractPrimitive> binder, AbstractPrimitive primitive)¶
bindPrimitive¶
-
protected static void
bindPrimitive
(Multibinder<AbstractPrimitive> binder, Class<? extends AbstractPrimitive> primitive)¶
bindPrimitiveLibrary¶
-
protected static void
bindPrimitiveLibrary
(Multibinder<IOperatorRegistry> binder, Class<? extends IOperatorRegistry> primitiveLibrary)¶
bindProcessor¶
-
protected void
bindProcessor
()¶ Overrides
MetaborgModule.bindProcessor()
to provide Spoofax-specific bindings with generics filled in asIStrategoTerm
.
bindProcessorRunner¶
-
protected void
bindProcessorRunner
()¶ Overrides
MetaborgModule.bindProcessorRunner()
to provide Spoofax-specific bindings with generics filled in asIStrategoTerm
.
org.metaborg.spoofax.core.action¶
ActionFacet¶
Fields¶
actions¶
-
public final Multimap<ITransformGoal, ITransformAction>
actions
¶
Constructors¶
ActionFacet¶
-
public
ActionFacet
(Multimap<ITransformGoal, ITransformAction> actions, Iterable<? extends IMenuItem> menuItems)¶
Methods¶
actions¶
-
public Iterable<ITransformAction>
actions
(ITransformGoal goal)¶
ActionFacetFromESV¶
-
public class
ActionFacetFromESV
¶
Methods¶
create¶
-
public static ActionFacet
create
(IStrategoAppl esv)¶
ActionService¶
-
public class
ActionService
implements IActionService¶
Methods¶
actionContributions¶
-
public Collection<TransformActionContrib>
actionContributions
(ILanguageImpl language, ITransformGoal goal)¶
actions¶
-
public Collection<ITransformAction>
actions
(ILanguageImpl language, ITransformGoal goal)¶
available¶
-
public boolean
available
(ILanguageImpl language, ITransformGoal goal)¶
requiresAnalysis¶
-
public boolean
requiresAnalysis
(ILanguageImpl language, ITransformGoal goal)¶
TransformAction¶
-
public class
TransformAction
implements ITransformAction¶
Constructors¶
TransformAction¶
-
public
TransformAction
(String name, ITransformGoal goal, TransformActionFlags flags, String strategy)¶
org.metaborg.spoofax.core.analysis¶
AnalysisCommon¶
-
public class
AnalysisCommon
¶
Constructors¶
AnalysisCommon¶
-
public
AnalysisCommon
(ISpoofaxTracingService tracingService)¶
Methods¶
ambiguityMessages¶
-
public Collection<IMessage>
ambiguityMessages
(FileObject resource, IStrategoTerm ast)¶
messages¶
-
public Collection<IMessage>
messages
(FileObject resource, MessageSeverity severity, IStrategoTerm messagesTerm)¶
messages¶
-
public Multimap<FileObject, IMessage>
messages
(MessageSeverity severity, IStrategoTerm messagesTerm)¶
AnalysisFacet¶
ISpoofaxAnalysisService¶
-
public interface
ISpoofaxAnalysisService
extends IAnalysisService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate>¶ Typedef interface for
IAnalysisService
with Spoofax interfaces.
Methods¶
analyze¶
-
ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context, IProgress progress, ICancel cancel)¶
analyze¶
-
ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context)¶
analyzeAll¶
-
ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context)¶
ISpoofaxAnalyzeResult¶
-
public interface
ISpoofaxAnalyzeResult
extends IAnalyzeResult<ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate>¶ Typedef interface for
IAnalyzeResult
with Spoofax interfaces.
ISpoofaxAnalyzeResults¶
-
public interface
ISpoofaxAnalyzeResults
extends IAnalyzeResults<ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate>¶ Typedef interface for
IAnalyzeResults
with Spoofax interfaces.
ISpoofaxAnalyzer¶
-
public interface
ISpoofaxAnalyzer
extends IAnalyzer<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate>¶ Typedef interface for
IAnalyzer
with Spoofax interfaces.
Methods¶
analyze¶
-
ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel)¶
SpoofaxAnalysisService¶
-
public class
SpoofaxAnalysisService
extends AnalysisService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate> implements ISpoofaxAnalysisService¶ Typedef class for
AnalysisService
with Spoofax interfaces.
Methods¶
analyze¶
-
public ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
public ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel)¶
SpoofaxAnalyzeResult¶
-
public class
SpoofaxAnalyzeResult
extends AnalyzeResult<ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate> implements ISpoofaxAnalyzeResult¶ Typedef class for
AnalyzeResult
with Spoofax interfaces.
Constructors¶
SpoofaxAnalyzeResult¶
-
public
SpoofaxAnalyzeResult
(ISpoofaxAnalyzeUnit result, Collection<ISpoofaxAnalyzeUnitUpdate> updates, IContext context, Object debugData)¶
SpoofaxAnalyzeResult¶
-
public
SpoofaxAnalyzeResult
(ISpoofaxAnalyzeUnit result, Collection<ISpoofaxAnalyzeUnitUpdate> updates, IContext context)¶
SpoofaxAnalyzeResult¶
-
public
SpoofaxAnalyzeResult
(ISpoofaxAnalyzeUnit result, IContext context, Object debugData)¶
SpoofaxAnalyzeResult¶
-
public
SpoofaxAnalyzeResult
(ISpoofaxAnalyzeUnit result, IContext context)¶
SpoofaxAnalyzeResults¶
-
public class
SpoofaxAnalyzeResults
extends AnalyzeResults<ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate> implements ISpoofaxAnalyzeResults¶ Typedef class for
AnalyzeResults
with Spoofax interfaces.
Constructors¶
SpoofaxAnalyzeResults¶
-
public
SpoofaxAnalyzeResults
(Collection<ISpoofaxAnalyzeUnit> results, Collection<ISpoofaxAnalyzeUnitUpdate> updates, IContext context, Object debugData)¶
SpoofaxAnalyzeResults¶
-
public
SpoofaxAnalyzeResults
(Collection<ISpoofaxAnalyzeUnit> results, Collection<ISpoofaxAnalyzeUnitUpdate> updates, IContext context)¶
SpoofaxAnalyzeResults¶
-
public
SpoofaxAnalyzeResults
(Collection<ISpoofaxAnalyzeUnit> results, IContext context, Object debugData)¶
SpoofaxAnalyzeResults¶
-
public
SpoofaxAnalyzeResults
(Collection<ISpoofaxAnalyzeUnit> results, IContext context)¶
org.metaborg.spoofax.core.analysis.constraint¶
AbstractConstraintAnalyzer¶
-
public abstract class
AbstractConstraintAnalyzer
implements ISpoofaxAnalyzer¶
Fields¶
analysisCommon¶
-
protected final AnalysisCommon
analysisCommon
¶
resourceService¶
-
protected final IResourceService
resourceService
¶
runtimeService¶
-
protected final IStrategoRuntimeService
runtimeService
¶
strategoCommon¶
-
protected final IStrategoCommon
strategoCommon
¶
tracingService¶
-
protected final ISpoofaxTracingService
tracingService
¶
unitService¶
-
protected final ISpoofaxUnitService
unitService
¶
Constructors¶
AbstractConstraintAnalyzer¶
-
public
AbstractConstraintAnalyzer
(AnalysisCommon analysisCommon, IResourceService resourceService, IStrategoRuntimeService runtimeService, IStrategoCommon strategoCommon, ITermFactoryService termFactoryService, ISpoofaxTracingService tracingService, ISpoofaxUnitService unitService)¶
Methods¶
analyze¶
-
public ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext genericContext, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
public ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext genericContext, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
protected abstract ISpoofaxAnalyzeResults
analyzeAll
(Map<String, ISpoofaxParseUnit> changed, Map<String, ISpoofaxParseUnit> removed, IConstraintContext context, HybridInterpreter runtime, String strategy, IProgress progress, ICancel cancel)¶
success¶
-
protected boolean
success
(Collection<IMessage> messages)¶
MultiFileConstraintAnalyzer¶
-
public class
MultiFileConstraintAnalyzer
extends AbstractConstraintAnalyzer implements ISpoofaxAnalyzer¶
Constructors¶
MultiFileConstraintAnalyzer¶
-
public
MultiFileConstraintAnalyzer
(AnalysisCommon analysisCommon, IResourceService resourceService, IStrategoRuntimeService runtimeService, IStrategoCommon strategoCommon, ITermFactoryService termFactoryService, ISpoofaxTracingService tracingService, ISpoofaxUnitService unitService)¶
Methods¶
analyzeAll¶
-
protected ISpoofaxAnalyzeResults
analyzeAll
(Map<String, ISpoofaxParseUnit> changed, Map<String, ISpoofaxParseUnit> removed, IConstraintContext context, HybridInterpreter runtime, String strategy, IProgress progress, ICancel cancel)¶
SingleFileConstraintAnalyzer¶
-
public class
SingleFileConstraintAnalyzer
extends AbstractConstraintAnalyzer implements ISpoofaxAnalyzer¶
Constructors¶
SingleFileConstraintAnalyzer¶
-
public
SingleFileConstraintAnalyzer
(AnalysisCommon analysisCommon, IResourceService resourceService, IStrategoRuntimeService runtimeService, IStrategoCommon strategoCommon, ITermFactoryService termFactoryService, ISpoofaxTracingService tracingService, ISpoofaxUnitService unitService)¶
Methods¶
analyzeAll¶
-
protected ISpoofaxAnalyzeResults
analyzeAll
(Map<String, ISpoofaxParseUnit> changed, Map<String, ISpoofaxParseUnit> removed, IConstraintContext context, HybridInterpreter runtime, String strategy, IProgress progress, ICancel cancel)¶
org.metaborg.spoofax.core.analysis.legacy¶
StrategoAnalyzer¶
-
public class
StrategoAnalyzer
implements ISpoofaxAnalyzer¶ Analyzer for legacy Stratego projects. Calls the analysis strategy for each input.
Constructors¶
StrategoAnalyzer¶
-
public
StrategoAnalyzer
(ISpoofaxUnitService unitService, ITermFactoryService termFactoryService, IStrategoRuntimeService runtimeService, IStrategoCommon strategoCommon, AnalysisCommon analysisCommon)¶
Methods¶
analyze¶
-
public ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
public ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel)¶
org.metaborg.spoofax.core.analysis.taskengine¶
AnalysisDebugResult¶
-
public class
AnalysisDebugResult
implements Serializable¶
Fields¶
TaskEngineAnalyzer¶
-
public class
TaskEngineAnalyzer
implements ISpoofaxAnalyzer¶ Analyzer for NaBL + TS + index + task engine projects. Calls the analysis strategy with a list of all inputs.
Constructors¶
TaskEngineAnalyzer¶
-
public
TaskEngineAnalyzer
(IResourceService resourceService, ISpoofaxUnitService unitService, ITermFactoryService termFactoryService, IStrategoRuntimeService runtimeService, IStrategoCommon strategoCommon, AnalysisCommon analysisCommon)¶
Methods¶
analyze¶
-
public ISpoofaxAnalyzeResult
analyze
(ISpoofaxParseUnit input, IContext context, IProgress progress, ICancel cancel)¶
analyzeAll¶
-
public ISpoofaxAnalyzeResults
analyzeAll
(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel)¶
TaskEngineAnalyzerData¶
-
public class
TaskEngineAnalyzerData
¶
Fields¶
debugResult¶
-
public final AnalysisDebugResult
debugResult
¶
timeResult¶
-
public final AnalysisTimeResult
timeResult
¶
Constructors¶
TaskEngineAnalyzerData¶
-
public
TaskEngineAnalyzerData
(Iterable<String> affectedPartitions, AnalysisDebugResult debugResult, AnalysisTimeResult timeResult)¶
org.metaborg.spoofax.core.build¶
ISpoofaxBuildOutput¶
-
public interface
ISpoofaxBuildOutput
extends IBuildOutput<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>¶ Typedef interface for
IBuildOutput
with Spoofax interfaces.
ISpoofaxBuildOutputInternal¶
-
public interface
ISpoofaxBuildOutputInternal
extends IBuildOutputInternal<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>, ISpoofaxBuildOutput¶ Typedef interface for
IBuildOutputInternal
with Spoofax interfaces.
ISpoofaxBuilder¶
-
public interface
ISpoofaxBuilder
extends IBuilder<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>¶ Typedef interface for
IBuilder
with Spoofax interfaces.
Methods¶
build¶
-
ISpoofaxBuildOutput
build
(BuildInput input, IProgress progress, ICancel cancel)¶
build¶
-
ISpoofaxBuildOutput
build
(BuildInput input)¶
SpoofaxBuildOutput¶
-
public class
SpoofaxBuildOutput
extends BuildOutput<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>> implements ISpoofaxBuildOutputInternal¶ Typedef class for
BuildOutput
with Spoofax interfaces.
SpoofaxBuilder¶
-
public class
SpoofaxBuilder
extends Builder<ISpoofaxInputUnit, ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>> implements ISpoofaxBuilder¶ Typedef class for
Builder
with Spoofax interfaces.
Constructors¶
SpoofaxBuilder¶
-
public
SpoofaxBuilder
(IResourceService resourceService, ILanguageIdentifierService languageIdentifier, ILanguagePathService languagePathService, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, ISpoofaxSyntaxService syntaxService, IContextService contextService, ISpoofaxAnalysisService analysisService, ISpoofaxTransformService transformService, ISpoofaxParseResultUpdater parseResultUpdater, ISpoofaxAnalysisResultUpdater analysisResultUpdater, Provider<IBuildOutputInternal<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>> buildOutputProvider)¶
Methods¶
build¶
-
public ISpoofaxBuildOutput
build
(BuildInput input, IProgress progress, ICancel cancel)¶
build¶
-
public ISpoofaxBuildOutput
build
(BuildInput input)¶
SpoofaxCommonPaths¶
-
public class
SpoofaxCommonPaths
extends CommonPaths¶
Constructors¶
SpoofaxCommonPaths¶
-
public
SpoofaxCommonPaths
(FileObject root)¶
Methods¶
dsManualJavaDir¶
-
public FileObject
dsManualJavaDir
()¶ Returns: DynSem manual Java interpreter directory.
dsSrcGenJavaDir¶
-
public FileObject
dsSrcGenJavaDir
()¶ Returns: DynSem generated Java interpreter directory.
findDsMainFile¶
-
public FileObject
findDsMainFile
(Iterable<FileObject> sources, String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main DynSem file.
findEsvMainFile¶
-
public FileObject
findEsvMainFile
(Iterable<FileObject> sources)¶ Returns: Main ESV file.
findStrMainFile¶
-
public FileObject
findStrMainFile
(Iterable<FileObject> sources, String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main Stratego file.
findSyntaxMainFile¶
-
public FileObject
findSyntaxMainFile
(Iterable<FileObject> sources, String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main SDF2 file.
iconsDir¶
-
public FileObject
iconsDir
()¶ Returns: Icons directory.
javaSrcDirs¶
-
public Collection<FileObject>
javaSrcDirs
(String languageId)¶ Gets all the Java source root folders.
Parameters: - languageId – Identifier of the language.
Returns: A list of Java source root folders.
spxArchiveFile¶
-
public FileObject
spxArchiveFile
(String languageId)¶ Parameters: - languageId – Identifier of the language.
Returns: Archived Spoofax language file.
srcMainDir¶
-
public FileObject
srcMainDir
()¶ Returns: Java sources directory.
strCacheDir¶
-
public FileObject
strCacheDir
()¶ Returns: Stratego parse cache directory.
strJavaStratDir¶
-
public FileObject
strJavaStratDir
()¶ Returns: Stratego Java strategies directory.
strJavaStratPkg¶
strJavaStratPkgPath¶
strJavaTransPkg¶
strMainJavaStratFile¶
-
public FileObject
strMainJavaStratFile
(String languageId)¶ Parameters: - languageId – Identifier of the language.
Returns: Main Stratego Java strategies file.
strSepCompBoilerplateFile¶
-
public FileObject
strSepCompBoilerplateFile
(String projectName, String moduleName)¶
strSepCompPackedBoilerplateFile¶
-
public FileObject
strSepCompPackedBoilerplateFile
()¶
strSepCompPackedStrategyFile¶
-
public FileObject
strSepCompPackedStrategyFile
(String strategy)¶
strSepCompSrcGenDir¶
-
public FileObject
strSepCompSrcGenDir
()¶
strSepCompStrategyDir¶
-
public FileObject
strSepCompStrategyDir
(String strategy)¶
strSepCompStrategyFile¶
-
public FileObject
strSepCompStrategyFile
(String projectName, String moduleName, String strategy)¶
strTypesmartExportedFile¶
-
public FileObject
strTypesmartExportedFile
()¶
syntaxCompletionMainFile¶
-
public FileObject
syntaxCompletionMainFile
(String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main SDF2 completion file.
syntaxCompletionMainFileNormalized¶
-
public FileObject
syntaxCompletionMainFileNormalized
(String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main normalized aterm completion file.
syntaxCompletionSrcGenDir¶
-
public FileObject
syntaxCompletionSrcGenDir
()¶ Returns: Generated SDF2 completion syntax directory, generated from SDF3 definition.
syntaxNormDir¶
-
public FileObject
syntaxNormDir
()¶ Returns: Normalized syntax directory. Contains the SDF3 normalized files.
syntaxSrcGenDir¶
-
public FileObject
syntaxSrcGenDir
()¶ Returns: Generated SDF2 syntax directory, generated from SDF3 definition.
syntaxSrcGenMainFile¶
-
public FileObject
syntaxSrcGenMainFile
(String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main generated SDF2 file, generated from main SDF3 file.
syntaxSrcGenMainNormFile¶
-
public FileObject
syntaxSrcGenMainNormFile
(String languageName)¶ Parameters: - languageName – Name of the language.
Returns: Main generated SDF2 file, generated from main SDF3 file.
syntaxSrcGenPpDir¶
-
public FileObject
syntaxSrcGenPpDir
()¶ Returns: Generated Stratego/Box pretty printer directory, generated from SDF3 definition.
syntaxSrcGenSignatureDir¶
-
public FileObject
syntaxSrcGenSignatureDir
()¶ Returns: Generated Stratego signatures directory, generated from SDF3 definition.
SpoofaxDefaultSources¶
-
public class
SpoofaxDefaultSources
¶
Fields¶
DEFAULT_SPOOFAX_SOURCES¶
-
public static final Collection<ISourceConfig>
DEFAULT_SPOOFAX_SOURCES
¶
org.metaborg.spoofax.core.completion¶
CompletionDefinition¶
-
public class
CompletionDefinition
¶
Fields¶
items¶
-
public final Iterable<ICompletionItem>
items
¶
ISpoofaxCompletionService¶
-
public interface
ISpoofaxCompletionService
extends ICompletionService<ISpoofaxParseUnit>¶ Typedef interface for
ICompletionService
with Spoofax interfaces.
JSGLRCompletionService¶
-
public class
JSGLRCompletionService
implements ISpoofaxCompletionService¶
Constructors¶
JSGLRCompletionService¶
-
public
JSGLRCompletionService
(ITermFactoryService termFactoryService, IStrategoRuntimeService strategoRuntimeService, IStrategoCommon strategoCommon, IResourceService resourceService, ISpoofaxUnitService unitService, ISpoofaxSyntaxService syntaxService)¶
Methods¶
completionCorrectPrograms¶
-
public Collection<ICompletion>
completionCorrectPrograms
(int position, boolean blankLineCompletion, ISpoofaxParseUnit parseResult)¶
completionEmptyProgram¶
-
public Collection<? extends ICompletion>
completionEmptyProgram
(Iterable<String> startSymbols, int endOffset, ILanguageImpl language, FileObject location)¶
completionErroneousPrograms¶
-
public Collection<ICompletion>
completionErroneousPrograms
(int cursorPosition, Iterable<IStrategoTerm> completionTerms, ISpoofaxParseUnit completionParseResult)¶
completionErroneousProgramsNested¶
-
public Collection<? extends ICompletion>
completionErroneousProgramsNested
(int cursorPosition, Collection<IStrategoTerm> nestedCompletionTerms, ISpoofaxParseUnit completionParseResult)¶
fromTokens¶
get¶
-
public Iterable<ICompletion>
get
(int position, ISpoofaxParseUnit parseInput, boolean nested)¶
listsCompletions¶
-
public Collection<ICompletion>
listsCompletions
(int position, boolean blankLineCompletion, Iterable<IStrategoList> lists, String languageName, ILanguageComponent component, FileObject location)¶
optionalCompletions¶
-
public Collection<ICompletion>
optionalCompletions
(Iterable<IStrategoTerm> optionals, boolean blankLineCompletion, String languageName, ILanguageComponent component, FileObject location)¶
placeholderCompletions¶
-
public Collection<ICompletion>
placeholderCompletions
(IStrategoAppl placeholder, String languageName, ILanguageComponent component, FileObject location)¶
PlaceholderCompletionItem¶
-
public class
PlaceholderCompletionItem
implements IPlaceholderCompletionItem¶
Fields¶
Constructors¶
org.metaborg.spoofax.core.config¶
ISpoofaxProjectConfig¶
-
public interface
ISpoofaxProjectConfig
extends IProjectConfig¶
Methods¶
sources¶
-
Collection<ISourceConfig>
sources
()¶
ISpoofaxProjectConfigBuilder¶
-
public interface
ISpoofaxProjectConfigBuilder
extends IProjectConfigBuilder¶
Methods¶
addCompileDeps¶
-
ISpoofaxProjectConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addJavaDeps¶
-
ISpoofaxProjectConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addSourceDeps¶
-
ISpoofaxProjectConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
addSources¶
-
ISpoofaxProjectConfigBuilder
addSources
(Iterable<IExportConfig> sources)¶
build¶
-
ISpoofaxProjectConfig
build
(FileObject rootFolder)¶
copyFrom¶
-
ISpoofaxProjectConfigBuilder
copyFrom
(ISpoofaxProjectConfig config)¶ Copies the values from the specified configuration.
Parameters: - config – The configuration to copy values from.
reset¶
withCompileDeps¶
-
ISpoofaxProjectConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withJavaDeps¶
-
ISpoofaxProjectConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withMetaborgVersion¶
-
ISpoofaxProjectConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withNaBL2Config¶
-
ISpoofaxProjectConfigBuilder
withNaBL2Config
(NaBL2Config config)¶ Sets whether debug output is enabled for the constraint solver.
Parameters: - incremental – True to enable, false to disable.
Returns: This builder.
withSourceDeps¶
-
ISpoofaxProjectConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
withSources¶
-
ISpoofaxProjectConfigBuilder
withSources
(Iterable<IExportConfig> sources)¶
withTypesmart¶
-
ISpoofaxProjectConfigBuilder
withTypesmart
(boolean typesmart)¶ Sets the typesmart property.
Parameters: - typesmart – The typesmart property.
Returns: This builder.
ISpoofaxProjectConfigService¶
-
public interface
ISpoofaxProjectConfigService
extends IProjectConfigService¶ Stores and retrieves language component configurations.
Methods¶
available¶
-
boolean
available
(FileObject rootFolder)¶ Checks if a configuration exists for the project at the given location.
Parameters: - rootFolder – The project root folder.
Returns: True if a configuration exists, false otherwise.
get¶
-
ConfigRequest<ISpoofaxProjectConfig>
get
(FileObject rootFolder)¶ Gets the configuration for the project at the given location.
Parameters: - rootFolder – The project root folder.
Returns: Configuration request, either with a valid configuration, or a collection of error messages.
get¶
-
ISpoofaxProjectConfig
get
(IProject project)¶ Gets the configuration for the given project.
Parameters: - project – The project.
Returns: The configuration, or null.
ISpoofaxProjectConfigWriter¶
Methods¶
write¶
-
void
write
(IProject project, ISpoofaxProjectConfig config, IFileAccess access)¶ Writes the specified configuration for the specified project.
Parameters: - project – The project.
- config – The configuration to write.
- access –
SpoofaxProjectConfig¶
-
public class
SpoofaxProjectConfig
extends ProjectConfig implements ISpoofaxProjectConfig¶
Constructors¶
SpoofaxProjectConfig¶
-
protected
SpoofaxProjectConfig
(HierarchicalConfiguration<ImmutableNode> config, String metaborgVersion, Collection<IExportConfig> sources, Collection<LanguageIdentifier> compileDeps, Collection<LanguageIdentifier> sourceDeps, Collection<LanguageIdentifier> javaDeps, Boolean typesmart, NaBL2Config nabl2Config)¶
Methods¶
sources¶
-
public Collection<ISourceConfig>
sources
()¶
validate¶
-
public Collection<IMessage>
validate
(MessageBuilder mb)¶
SpoofaxProjectConfigBuilder¶
-
public class
SpoofaxProjectConfigBuilder
extends ProjectConfigBuilder implements ISpoofaxProjectConfigBuilder¶
Constructors¶
SpoofaxProjectConfigBuilder¶
-
public
SpoofaxProjectConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
Methods¶
addCompileDeps¶
-
public ISpoofaxProjectConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addJavaDeps¶
-
public ISpoofaxProjectConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addSourceDeps¶
-
public ISpoofaxProjectConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
addSources¶
-
public ISpoofaxProjectConfigBuilder
addSources
(Iterable<IExportConfig> sources)¶
build¶
-
public ISpoofaxProjectConfig
build
(FileObject rootFolder)¶
build¶
-
public SpoofaxProjectConfig
build
(HierarchicalConfiguration<ImmutableNode> configuration)¶
copyFrom¶
-
public ISpoofaxProjectConfigBuilder
copyFrom
(ISpoofaxProjectConfig config)¶
copyValuesFrom¶
-
public void
copyValuesFrom
(ISpoofaxProjectConfig config)¶
reset¶
-
public ISpoofaxProjectConfigBuilder
reset
()¶
withCompileDeps¶
-
public ISpoofaxProjectConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withJavaDeps¶
-
public ISpoofaxProjectConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withMetaborgVersion¶
-
public ISpoofaxProjectConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withNaBL2Config¶
-
public ISpoofaxProjectConfigBuilder
withNaBL2Config
(NaBL2Config config)¶
withSourceDeps¶
-
public ISpoofaxProjectConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
withSources¶
-
public ISpoofaxProjectConfigBuilder
withSources
(Iterable<IExportConfig> sources)¶
withTypesmart¶
-
public ISpoofaxProjectConfigBuilder
withTypesmart
(boolean typesmart)¶
SpoofaxProjectConfigService¶
-
public class
SpoofaxProjectConfigService
extends AConfigService<IProject, ISpoofaxProjectConfig> implements ISpoofaxProjectConfigService, ISpoofaxProjectConfigWriter¶
Constructors¶
SpoofaxProjectConfigService¶
-
public
SpoofaxProjectConfigService
(AConfigurationReaderWriter configReaderWriter, SpoofaxProjectConfigBuilder configBuilder)¶
Methods¶
defaultConfig¶
-
public IProjectConfig
defaultConfig
(FileObject rootFolder)¶
fromConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
fromConfig
(ISpoofaxProjectConfig config)¶
get¶
-
public ISpoofaxProjectConfig
get
(IProject project)¶
getConfigFile¶
-
protected FileObject
getConfigFile
(FileObject rootFolder)¶
getRootDirectory¶
-
protected FileObject
getRootDirectory
(IProject project)¶
toConfig¶
-
protected ConfigRequest<ISpoofaxProjectConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶
org.metaborg.spoofax.core.config.language¶
NaBL2ConfigReaderWriter¶
-
public final class
NaBL2ConfigReaderWriter
¶
Methods¶
validate¶
-
public static Collection<IMessage>
validate
(ImmutableConfiguration config, MessageBuilder mb)¶
org.metaborg.spoofax.core.context¶
IIndexTaskContext¶
IndexTaskContext¶
-
public class
IndexTaskContext
implements IContext, IContextInternal, IIndexTaskContext¶
Constructors¶
IndexTaskContext¶
-
public
IndexTaskContext
(Injector injector, ITermFactoryService termFactoryService, ContextIdentifier identifier)¶
Methods¶
identifier¶
-
public ContextIdentifier
identifier
()¶
language¶
-
public ILanguageImpl
language
()¶
location¶
-
public FileObject
location
()¶
IndexTaskContextFactory¶
-
public class
IndexTaskContextFactory
implements IContextFactory¶
Constructors¶
IndexTaskContextFactory¶
-
public
IndexTaskContextFactory
(Injector injector, ITermFactoryService termFactoryService)¶
Methods¶
create¶
-
public IndexTaskContext
create
(ContextIdentifier identifier)¶
createTemporary¶
-
public IndexTaskTemporaryContext
createTemporary
(ContextIdentifier identifier)¶
IndexTaskTemporaryContext¶
-
public class
IndexTaskTemporaryContext
implements ITemporaryContextInternal, IIndexTaskContext¶
Constructors¶
IndexTaskTemporaryContext¶
-
public
IndexTaskTemporaryContext
(IndexTaskContext context)¶
Methods¶
identifier¶
-
public ContextIdentifier
identifier
()¶
language¶
-
public ILanguageImpl
language
()¶
location¶
-
public FileObject
location
()¶
LegacyContext¶
-
public class
LegacyContext
implements IContext, IContextInternal, ITemporaryContextInternal¶
Constructors¶
LegacyContext¶
-
public
LegacyContext
(Injector injector, ContextIdentifier identifier)¶
Methods¶
identifier¶
-
public ContextIdentifier
identifier
()¶
language¶
-
public ILanguageImpl
language
()¶
location¶
-
public FileObject
location
()¶
LegacyContextFactory¶
-
public class
LegacyContextFactory
implements IContextFactory¶
Methods¶
create¶
-
public LegacyContext
create
(ContextIdentifier identifier)¶
createTemporary¶
-
public LegacyContext
createTemporary
(ContextIdentifier identifier)¶
org.metaborg.spoofax.core.context.constraint¶
ConstraintContext¶
-
public class
ConstraintContext
implements IConstraintContext¶
Constructors¶
ConstraintContext¶
-
public
ConstraintContext
(Mode mode, Injector injector, ContextIdentifier identifier)¶
Methods¶
entrySet¶
-
public Set<Entry<String, FileResult>>
entrySet
()¶
getAnalysis¶
-
public IStrategoTerm
getAnalysis
(FileObject resource)¶
getFinal¶
-
public FinalResult
getFinal
()¶
getInitial¶
-
public InitialResult
getInitial
()¶
getUnit¶
-
public FileResult
getUnit
(FileObject resource)¶
hasAnalysis¶
-
public boolean
hasAnalysis
(FileObject resource)¶
hasUnit¶
-
public boolean
hasUnit
(FileObject resource)¶
identifier¶
-
public ContextIdentifier
identifier
()¶
isRoot¶
-
public boolean
isRoot
(FileObject resource)¶
keyResource¶
-
public FileObject
keyResource
(String resource)¶
language¶
-
public ILanguageImpl
language
()¶
location¶
-
public FileObject
location
()¶
remove¶
-
public boolean
remove
(FileObject resource)¶
resourceKey¶
-
public String
resourceKey
(FileObject resource)¶
setFinal¶
-
public void
setFinal
(FinalResult value)¶
setInitial¶
-
public void
setInitial
(InitialResult value)¶
setUnit¶
-
public boolean
setUnit
(FileObject resource, FileResult value)¶
IConstraintContext¶
-
public interface
IConstraintContext
extends IContextInternal¶
Methods¶
entrySet¶
-
Set<Entry<String, FileResult>>
entrySet
()¶
getAnalysis¶
-
IStrategoTerm
getAnalysis
(FileObject resource)¶
getFinal¶
-
FinalResult
getFinal
()¶
getInitial¶
-
InitialResult
getInitial
()¶
getUnit¶
-
FileResult
getUnit
(String resource)¶
getUnit¶
-
FileResult
getUnit
(FileObject resource)¶
hasAnalysis¶
-
boolean
hasAnalysis
(FileObject resource)¶
hasUnit¶
-
boolean
hasUnit
(FileObject resource)¶
isRoot¶
-
boolean
isRoot
(FileObject resource)¶
keyResource¶
-
FileObject
keyResource
(String resource)¶
remove¶
-
boolean
remove
(FileObject resource)¶
resourceKey¶
-
String
resourceKey
(FileObject resource)¶
setFinal¶
-
void
setFinal
(FinalResult value)¶
setInitial¶
-
void
setInitial
(InitialResult value)¶
setUnit¶
-
boolean
setUnit
(String resource, FileResult value)¶
setUnit¶
-
boolean
setUnit
(FileObject resource, FileResult value)¶
IConstraintContext.FileResult¶
-
class
FileResult
implements Serializable¶
Fields¶
messages¶
-
public final Collection<IMessage>
messages
¶
Constructors¶
FileResult¶
-
public
FileResult
(IStrategoTerm ast, IStrategoTerm analysis, Collection<IMessage> messages)¶
IConstraintContext.FinalResult¶
-
class
FinalResult
implements Serializable¶
Fields¶
messages¶
-
public final Collection<IMessage>
messages
¶
Constructors¶
FinalResult¶
-
public
FinalResult
(IStrategoTerm analysis, Collection<IMessage> messages)¶
IConstraintContext.InitialResult¶
-
class
InitialResult
implements Serializable¶
IConstraintContext.Mode¶
-
enum
Mode
¶
Enum Constants¶
MULTI_FILE¶
-
public static final IConstraintContext.Mode
MULTI_FILE
¶
SINGLE_FILE¶
-
public static final IConstraintContext.Mode
SINGLE_FILE
¶
MultiFileConstraintContextFactory¶
-
public class
MultiFileConstraintContextFactory
implements IContextFactory¶
Constructors¶
Methods¶
create¶
-
public IConstraintContext
create
(ContextIdentifier identifier)¶
createTemporary¶
-
public TemporaryConstraintContext
createTemporary
(ContextIdentifier identifier)¶
SingleFileConstraintContextFactory¶
-
public class
SingleFileConstraintContextFactory
implements IContextFactory¶
Constructors¶
Methods¶
create¶
-
public IConstraintContext
create
(ContextIdentifier identifier)¶
createTemporary¶
-
public TemporaryConstraintContext
createTemporary
(ContextIdentifier identifier)¶
TemporaryConstraintContext¶
-
public class
TemporaryConstraintContext
implements IConstraintContext, ITemporaryContextInternal¶
Constructors¶
TemporaryConstraintContext¶
-
public
TemporaryConstraintContext
(IConstraintContext context)¶
Methods¶
entrySet¶
-
public Set<Entry<String, FileResult>>
entrySet
()¶
getAnalysis¶
-
public IStrategoTerm
getAnalysis
(FileObject resource)¶
getFinal¶
-
public FinalResult
getFinal
()¶
getInitial¶
-
public InitialResult
getInitial
()¶
getUnit¶
-
public FileResult
getUnit
(FileObject resource)¶
hasAnalysis¶
-
public boolean
hasAnalysis
(FileObject resource)¶
hasUnit¶
-
public boolean
hasUnit
(FileObject resource)¶
identifier¶
-
public ContextIdentifier
identifier
()¶
isRoot¶
-
public boolean
isRoot
(FileObject resource)¶
keyResource¶
-
public FileObject
keyResource
(String resource)¶
language¶
-
public ILanguageImpl
language
()¶
location¶
-
public FileObject
location
()¶
remove¶
-
public boolean
remove
(FileObject resource)¶
resourceKey¶
-
public String
resourceKey
(FileObject resource)¶
setFinal¶
-
public void
setFinal
(FinalResult value)¶
setInitial¶
-
public void
setInitial
(InitialResult value)¶
setUnit¶
-
public boolean
setUnit
(FileObject resource, FileResult value)¶
org.metaborg.spoofax.core.esv¶
org.metaborg.spoofax.core.language¶
ComponentFactoryRequest¶
-
public class
ComponentFactoryRequest
implements IComponentCreationConfigRequest¶
Constructors¶
ComponentFactoryRequest¶
-
public
ComponentFactoryRequest
(FileObject location, ILanguageComponentConfig config, IStrategoAppl esvTerm, SyntaxFacet syntaxFacet, StrategoRuntimeFacet strategoRuntimeFacet)¶ Initializes a new instance for a successful request.
Parameters: - location – The location of the language component.
- config – The configuration of the language component.
- esvTerm – The ESV term.
- syntaxFacet – The syntax facet.
- strategoRuntimeFacet – The Stratego runtime facet.
ComponentFactoryRequest¶
-
public
ComponentFactoryRequest
(FileObject location, Collection<String> errors, Collection<Throwable> exceptions)¶ Initializes a new instance for a failed request.
Parameters: - location – The location of the language component.
- errors – The error messages that were raised during the request.
- exceptions – The exceptions that were raised during the request.
ComponentFactoryRequest¶
-
public
ComponentFactoryRequest
(FileObject location, Collection<String> errors)¶ Initializes a new instance for a failed request.
Parameters: - location – The location of the language component.
- errors – The error messages that were raised during the request.
ComponentFactoryRequest¶
-
public
ComponentFactoryRequest
(FileObject location, String error)¶ Initializes a new instance for a failed request.
Parameters: - location – The location of the language component.
- error – The error message that was raised during the request.
ComponentFactoryRequest¶
-
public
ComponentFactoryRequest
(FileObject location, Throwable exception)¶ Initializes a new instance for a failed request.
Parameters: - location – The location of the language component.
- exception – The exception that was raised during the request.
Methods¶
config¶
-
public ILanguageComponentConfig
config
()¶
errors¶
-
public Collection<String>
errors
()¶
esvTerm¶
-
public IStrategoAppl
esvTerm
()¶ Gets the ESV term.
Returns: The ESV term; or null
when there is no ESV term.
exceptions¶
-
public Collection<Throwable>
exceptions
()¶
location¶
-
public FileObject
location
()¶
strategoRuntimeFacet¶
-
public StrategoRuntimeFacet
strategoRuntimeFacet
()¶ Gets the Stratego runtime facet.
Returns: The Stratego runtime facet; or null
when there is no Stratego runtime facet.
syntaxFacet¶
-
public SyntaxFacet
syntaxFacet
()¶ Gets the syntax facet.
Returns: The syntax facet; or null
when there is no Syntax facet.
LanguageComponentFactory¶
-
public class
LanguageComponentFactory
implements ILanguageComponentFactory¶
Constructors¶
LanguageComponentFactory¶
-
public
LanguageComponentFactory
(IResourceService resourceService, ILanguageComponentConfigService componentConfigService, ITermFactoryService termFactoryService, Map<String, IContextFactory> contextFactories, Map<String, IContextStrategy> contextStrategies, Map<String, ISpoofaxAnalyzer> analyzers)¶
Methods¶
createConfig¶
-
public ComponentCreationConfig
createConfig
(IComponentCreationConfigRequest configRequest)¶
createConfigs¶
-
public Collection<ComponentCreationConfig>
createConfigs
(Iterable<IComponentCreationConfigRequest> requests)¶
requestAllInDirectory¶
-
public Collection<IComponentCreationConfigRequest>
requestAllInDirectory
(FileObject directory)¶
requestFromArchive¶
-
public IComponentCreationConfigRequest
requestFromArchive
(FileObject archiveFile)¶
requestFromDirectory¶
-
public IComponentCreationConfigRequest
requestFromDirectory
(FileObject directory)¶
LanguageDiscoveryService¶
-
public class
LanguageDiscoveryService
implements ILanguageDiscoveryService¶
Constructors¶
LanguageDiscoveryService¶
-
public
LanguageDiscoveryService
(ILanguageService languageService, ILanguageComponentFactory componentFactory)¶
Methods¶
componentFromArchive¶
-
public ILanguageComponent
componentFromArchive
(FileObject archiveFile)¶
componentFromDirectory¶
-
public ILanguageComponent
componentFromDirectory
(FileObject directory)¶
discover¶
-
public ILanguageComponent
discover
(ILanguageDiscoveryRequest request)¶
discover¶
-
public Iterable<ILanguageComponent>
discover
(Iterable<ILanguageDiscoveryRequest> requests)¶
languageFromArchive¶
-
public ILanguageImpl
languageFromArchive
(FileObject archiveFile)¶
languageFromDirectory¶
-
public ILanguageImpl
languageFromDirectory
(FileObject directory)¶
languagesFromArchive¶
-
public Set<ILanguageImpl>
languagesFromArchive
(FileObject archiveFile)¶
languagesFromDirectory¶
-
public Set<ILanguageImpl>
languagesFromDirectory
(FileObject directory)¶
request¶
-
public Iterable<ILanguageDiscoveryRequest>
request
(FileObject location)¶
scanComponentsInDirectory¶
-
public Set<ILanguageComponent>
scanComponentsInDirectory
(FileObject directory)¶
scanLanguagesInDirectory¶
-
public Set<ILanguageImpl>
scanLanguagesInDirectory
(FileObject directory)¶
LanguageFileScanSelector¶
-
public class
LanguageFileScanSelector
implements FileSelector¶
Methods¶
includeFile¶
-
public boolean
includeFile
(FileSelectInfo fileInfo)¶
traverseDescendents¶
-
public boolean
traverseDescendents
(FileSelectInfo fileInfo)¶
org.metaborg.spoofax.core.language.dialect¶
DialectIdentifier¶
-
public class
DialectIdentifier
implements IDialectIdentifier¶
Constructors¶
DialectIdentifier¶
-
public
DialectIdentifier
(ILanguageService languageService, IDialectService dialectService, ITermFactoryService termFactoryService)¶
Methods¶
identify¶
-
public IdentifiedDialect
identify
(FileObject resource)¶
identify¶
-
public boolean
identify
(FileObject resource, ILanguageImpl dialect)¶
metaResource¶
-
public static FileObject
metaResource
(FileObject resource)¶
DialectProcessor¶
-
public class
DialectProcessor
implements IDialectProcessor¶
Constructors¶
DialectProcessor¶
-
public
DialectProcessor
(ILanguageService languageService, IDialectService dialectService)¶
Methods¶
update¶
-
public void
update
(FileObject location, Iterable<ResourceChange> changes)¶
update¶
-
public void
update
(LanguageImplChange change)¶
DialectService¶
-
public class
DialectService
implements IDialectService¶ Default implementation for the dialect service. It is mostly generic, but contains some logic for .meta files, which are Spoofax-specific. A dialect is simply a language implementation, with a single component, that mimics its base language, but has a different name and a few different facets. Dialects are created by copying over all facets from a language implementation into a new language implementation, except that:
ResourceExtensionFacet
: removed to prevent dialects from overriding an extension of the base language.IdentificationFacet
: wrapped byMetaFileIdentifier
such that files without a corresponding .meta file do not identify to the dialect.SyntaxFacet
: replaced by the dialect’s syntax facet that uses a different parse table.
Constructors¶
DialectService¶
-
public
DialectService
(ILanguageService languageService)¶
Methods¶
add¶
-
public ILanguageImpl
add
(String name, FileObject location, ILanguageImpl base, IFacet syntaxFacet)¶
dialectName¶
-
public String
dialectName
(ILanguageImpl dialect)¶
getBase¶
-
public ILanguageImpl
getBase
(ILanguageImpl dialect)¶
getDialect¶
-
public ILanguageImpl
getDialect
(String name)¶
getDialects¶
-
public Iterable<ILanguageImpl>
getDialects
(ILanguageImpl base)¶
remove¶
-
public ILanguageImpl
remove
(String name)¶
remove¶
-
public Iterable<ILanguageImpl>
remove
(ILanguageImpl base)¶
update¶
-
public ILanguageImpl
update
(String name, IFacet syntaxFacet)¶
update¶
-
public Iterable<ILanguageImpl>
update
(ILanguageImpl base)¶
MetaFileIdentifier¶
-
public class
MetaFileIdentifier
implements Func1<FileObject, Boolean>¶
Constructors¶
MetaFileIdentifier¶
-
public
MetaFileIdentifier
(IdentificationFacet identification)¶
Methods¶
call¶
-
public Boolean
call
(FileObject resource)¶
org.metaborg.spoofax.core.outline¶
ISpoofaxOutlineService¶
-
public interface
ISpoofaxOutlineService
extends IOutlineService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit>¶ Typedef interface for
IResolverService
with Spoofax interfaces.
OutlineFacet¶
OutlineFacetFromESV¶
-
public class
OutlineFacetFromESV
¶
Methods¶
create¶
-
public static OutlineFacet
create
(IStrategoAppl esv)¶
OutlineService¶
-
public class
OutlineService
implements ISpoofaxOutlineService¶
Constructors¶
OutlineService¶
-
public
OutlineService
(IProjectService projectService, IContextService contextService, IStrategoRuntimeService strategoRuntimeService, ISpoofaxTracingService tracingService, IStrategoCommon common)¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl language)¶
outline¶
-
public IOutline
outline
(ISpoofaxParseUnit result)¶
outline¶
-
public IOutline
outline
(ISpoofaxAnalyzeUnit result)¶
org.metaborg.spoofax.core.processing¶
ISpoofaxProcessor¶
-
public interface
ISpoofaxProcessor
extends IProcessor<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>¶ Typedef interface for
IProcessor
with Spoofax interfaces.
Methods¶
build¶
-
ITask<ISpoofaxBuildOutput>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
ISpoofaxProcessorRunner¶
-
public interface
ISpoofaxProcessorRunner
extends IProcessorRunner<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>>¶ Typedef interface for
IProcessorRunner
with Spoofax interfaces.
Methods¶
build¶
-
ITask<ISpoofaxBuildOutput>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
SpoofaxBlockingProcessor¶
-
public class
SpoofaxBlockingProcessor
extends BlockingProcessor<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>> implements ISpoofaxProcessor¶ Typedef class for
BlockingProcessor
with Spoofax interfaces.
Constructors¶
SpoofaxBlockingProcessor¶
-
public
SpoofaxBlockingProcessor
(IDialectProcessor dialectProcessor, ISpoofaxBuilder builder, ILanguageChangeProcessor languageChangeProcessor)¶
Methods¶
build¶
-
public ITask<ISpoofaxBuildOutput>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
SpoofaxProcessorRunner¶
-
public class
SpoofaxProcessorRunner
extends ProcessorRunner<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<?>> implements ISpoofaxProcessorRunner¶ Typedef class for
ProcessorRunner
with Spoofax interfaces.
Constructors¶
SpoofaxProcessorRunner¶
-
public
SpoofaxProcessorRunner
(ISpoofaxProcessor processor, ILanguageService languageService)¶
Methods¶
build¶
-
public ITask<ISpoofaxBuildOutput>
build
(BuildInput input, IProgress progress, ICancel cancel)¶
org.metaborg.spoofax.core.processing.analyze¶
ISpoofaxAnalysisResultProcessor¶
-
public interface
ISpoofaxAnalysisResultProcessor
extends IAnalysisResultProcessor<ISpoofaxInputUnit, ISpoofaxParseUnit, ISpoofaxAnalyzeUnit>, ISpoofaxAnalysisResultRequester, ISpoofaxAnalysisResultUpdater¶ Typedef interface for
IAnalysisResultProcessor
with Spoofax interfaces.
ISpoofaxAnalysisResultRequester¶
-
public interface
ISpoofaxAnalysisResultRequester
extends IAnalysisResultRequester<ISpoofaxInputUnit, ISpoofaxAnalyzeUnit>¶ Typedef interface for
IAnalysisResultRequester
with Spoofax interfaces.
ISpoofaxAnalysisResultUpdater¶
-
public interface
ISpoofaxAnalysisResultUpdater
extends IAnalysisResultUpdater<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit>¶ Typedef interface for
IAnalysisResultUpdater
with Spoofax interfaces.
SpoofaxAnalysisResultProcessor¶
-
public class
SpoofaxAnalysisResultProcessor
extends AnalysisResultProcessor<ISpoofaxInputUnit, ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate> implements ISpoofaxAnalysisResultProcessor¶ Typedef class for
AnalysisResultProcessor
with Spoofax interfaces.
Constructors¶
SpoofaxAnalysisResultProcessor¶
-
public
SpoofaxAnalysisResultProcessor
(ISpoofaxAnalysisService analysisService, ISpoofaxParseResultRequester parseResultRequester)¶
org.metaborg.spoofax.core.processing.parse¶
ISpoofaxParseResultProcessor¶
-
public interface
ISpoofaxParseResultProcessor
extends IParseResultProcessor<ISpoofaxInputUnit, ISpoofaxParseUnit>, ISpoofaxParseResultRequester, ISpoofaxParseResultUpdater¶ Typedef interface for
IParseResultProcessor
with Spoofax interfaces.
ISpoofaxParseResultRequester¶
-
public interface
ISpoofaxParseResultRequester
extends IParseResultRequester<ISpoofaxInputUnit, ISpoofaxParseUnit>¶ Typedef interface for
IParseResultRequester
with Spoofax interfaces.
ISpoofaxParseResultUpdater¶
-
public interface
ISpoofaxParseResultUpdater
extends IParseResultUpdater<ISpoofaxParseUnit>¶ Typedef interface for
IParseResultUpdater
with Spoofax interfaces.
SpoofaxParseResultProcessor¶
-
public class
SpoofaxParseResultProcessor
extends ParseResultProcessor<ISpoofaxInputUnit, ISpoofaxParseUnit> implements ISpoofaxParseResultProcessor¶ Typedef class for
ParseResultProcessor
with Spoofax interfaces.
Constructors¶
SpoofaxParseResultProcessor¶
-
public
SpoofaxParseResultProcessor
(ISpoofaxSyntaxService syntaxService)¶
org.metaborg.spoofax.core.resource¶
SpoofaxIgnoresSelector¶
-
public class
SpoofaxIgnoresSelector
implements FileSelector¶
Methods¶
includeFile¶
-
public boolean
includeFile
(FileSelectInfo fileInfo)¶
traverseDescendents¶
-
public boolean
traverseDescendents
(FileSelectInfo fileInfo)¶
org.metaborg.spoofax.core.shell¶
CLIUtils¶
-
public class
CLIUtils
¶
Methods¶
getCWD¶
-
public FileObject
getCWD
()¶ Get the current working directory
getLanguage¶
-
public ILanguageImpl
getLanguage
(String languageName)¶ Get a already loaded language by language name
getOrCreateCWDProject¶
getOrCreateProject¶
-
public IProject
getOrCreateProject
(FileObject resource)¶ Get or create project for the given resource
getProject¶
-
public IProject
getProject
(FileObject location)¶ Get project for the given resource
loadLanguage¶
-
public ILanguageImpl
loadLanguage
(FileObject location)¶ Load a language from the directory or archive indicated by location
loadLanguagesFromPath¶
-
public void
loadLanguagesFromPath
()¶ Load languages from the SPOOFAXPATH environment variable
printMessages¶
-
public void
printMessages
(OutputStream os, Iterable<IMessage> messages)¶ Print formatted messages to the given output stream
org.metaborg.spoofax.core.stratego¶
IStrategoCommon¶
-
public interface
IStrategoCommon
¶
Methods¶
builderInputTerm¶
-
IStrategoTerm
builderInputTerm
(IStrategoTerm ast, FileObject resource, FileObject location)¶ Creates an input term for a builder.
Parameters: - ast – Term to use as the AST.
- resource – Location of the input resource.
- location – Location of the input context.
Returns: A 5-tuple input term (selected, position, ast, path, project-path).
invoke¶
-
IStrategoTerm
invoke
(ILanguageComponent component, IContext context, IStrategoTerm input, String strategy)¶ Invokes a Stratego strategy in given component.
Parameters: - component – Component to invoke the strategy in.
- context – Context to initialize the runtime with.
- input – Input term
- strategy – Name of the strategy to call.
Throws: - MetaborgException – When invoking the strategy fails unexpectedly.
Returns: Resulting term, or null if the strategy failed.
invoke¶
-
IStrategoTerm
invoke
(ILanguageImpl impl, IContext context, IStrategoTerm input, String strategy)¶ Invokes a Stratego strategy in components of given language implementation. Returns the first result that succeeds.
Parameters: - impl – Language implementation to invoke the strategy in.
- context – Context to initialize the runtime with.
- input – Input term
- strategy – Name of the strategy to call.
Throws: - MetaborgException – When invoking the strategy fails unexpectedly.
Returns: Resulting term, or null if the strategy failed.
invoke¶
-
IStrategoTerm
invoke
(ILanguageImpl impl, FileObject location, IStrategoTerm input, String strategy)¶ Invokes a Stratego strategy in components of given language implementation. Returns the first result that succeeds.
Parameters: - impl – Language implementation to invoke the strategy in.
- location – Location to initialize the Stratego runtime with.
- input – Input term
- strategy – Name of the strategy to call.
Throws: - MetaborgException – When invoking the strategy fails unexpectedly.
Returns: Resulting term, or null if the strategy failed.
invoke¶
-
IStrategoTerm
invoke
(HybridInterpreter runtime, IStrategoTerm input, String strategy)¶ Invokes a Strategy strategy in given runtime.
Parameters: - runtime – Stratego runtime to invoke the strategy in.
- input – Input term
- strategy – Name of the strategy to call.
Throws: - MetaborgException – When invoking the strategy fails unexpectedly.
Returns: Resulting term, or null if the strategy failed.
locationTerm¶
-
IStrategoString
locationTerm
(FileObject location)¶ Converts a location into a Stratego string.
Parameters: - localLocation – Location to convert.
Returns: Stratego string with location.
prettyPrint¶
-
IStrategoString
prettyPrint
(IStrategoTerm term)¶ Pretty prints an ATerm.
Parameters: - term – ATerm to pretty print.
Returns: Pretty printed ATerm as a Stratego string.
resourceTerm¶
-
IStrategoString
resourceTerm
(FileObject resource, FileObject location)¶ Converts a resource relative to a location into a Stratego string.
Parameters: - localResource – Resource to convert.
- localLocation – Location to convert relative to.
Returns: Stratego string with resource.
IStrategoRuntimeService¶
-
public interface
IStrategoRuntimeService
extends ILanguageCache¶ Interface for a service that returns Stratego runtimes. Runtimes are created once and then cached, subsequent calls are faster.
Methods¶
genericRuntime¶
-
HybridInterpreter
genericRuntime
()¶ Returns: Generic Stratego runtime, with just the standard libraries loaded.
runtime¶
-
HybridInterpreter
runtime
(ILanguageComponent component, IContext context, boolean typesmart)¶ Returns a new Stratego runtime for given component, initialized with given context.
Parameters: - component – Language component to load the Stratego CTree and JAR files from.
- context – Context to initialize the runtime with.
- typesmart – Whether the runtime should do typesmart analysis.
Throws: - MetaborgException – When loading a Stratego CTree or JAR fails.
Returns: New Stratego runtime.
runtime¶
-
HybridInterpreter
runtime
(ILanguageComponent component, FileObject location, boolean typesmart)¶ Returns a new Stratego runtime for given component, initialized without a context.
Parameters: - component – Language component to load the Stratego CTree and JAR files from.
- location – Location to initialize the runtime with.
- typesmart – Whether the runtime should do typesmart analysis.
Throws: - MetaborgException – When loading a Stratego CTree or JAR fails.
Returns: New Stratego runtime.
ResourceAgent¶
-
public class
ResourceAgent
extends IOAgent¶
Constructors¶
ResourceAgent¶
-
public
ResourceAgent
(IResourceService resourceService)¶
ResourceAgent¶
-
public
ResourceAgent
(IResourceService resourceService, FileObject initialDir)¶
ResourceAgent¶
-
public
ResourceAgent
(IResourceService resourceService, FileObject initialDir, OutputStream stdout)¶
ResourceAgent¶
-
public
ResourceAgent
(IResourceService resourceService, FileObject initialDir, OutputStream stdout, OutputStream stderr)¶
Methods¶
defaultStderr¶
-
public static OutputStream
defaultStderr
(String... excludePatterns)¶
defaultStdout¶
-
public static OutputStream
defaultStdout
(String... excludePatterns)¶
getDefinitionDirResource¶
-
public FileObject
getDefinitionDirResource
()¶
getTempDirResource¶
-
public FileObject
getTempDirResource
()¶
getWorkingDirResource¶
-
public FileObject
getWorkingDirResource
()¶
internalGetInputStream¶
-
public InputStream
internalGetInputStream
(int fd)¶
internalGetOutputStream¶
-
public OutputStream
internalGetOutputStream
(int fd)¶
openFileOutputStream¶
-
public OutputStream
openFileOutputStream
(String fn)¶
openInputStream¶
-
public InputStream
openInputStream
(String fn, boolean isDefinitionFile)¶
setAbsoluteDefinitionDir¶
-
public void
setAbsoluteDefinitionDir
(FileObject dir)¶
setAbsoluteWorkingDir¶
-
public void
setAbsoluteWorkingDir
(FileObject dir)¶
StrategoCommon¶
-
public class
StrategoCommon
implements IStrategoCommon¶ Common code for using Stratego transformations in Spoofax.
Constructors¶
StrategoCommon¶
-
public
StrategoCommon
(IStrategoRuntimeService strategoRuntimeService, ITermFactoryService termFactoryService)¶
Methods¶
builderInputTerm¶
-
public IStrategoTerm
builderInputTerm
(IStrategoTerm ast, FileObject resource, FileObject location)¶
invoke¶
-
public IStrategoTerm
invoke
(ILanguageComponent component, IContext context, IStrategoTerm input, String strategy)¶
invoke¶
-
public IStrategoTerm
invoke
(ILanguageImpl impl, IContext context, IStrategoTerm input, String strategy)¶
invoke¶
-
public IStrategoTerm
invoke
(ILanguageImpl impl, FileObject location, IStrategoTerm input, String strategy)¶
invoke¶
locationTerm¶
-
public IStrategoString
locationTerm
(FileObject location)¶
resourceTerm¶
-
public IStrategoString
resourceTerm
(FileObject resource, FileObject location)¶
StrategoRuntimeClassLoader¶
-
public class
StrategoRuntimeClassLoader
extends ClassLoader¶
Constructors¶
StrategoRuntimeClassLoader¶
-
public
StrategoRuntimeClassLoader
(Iterable<ClassLoader> additionalClassLoaders)¶
StrategoRuntimeFacet¶
-
public class
StrategoRuntimeFacet
implements IFacet¶ Represents the Stratego runtime facet of a language.
Fields¶
ctreeFiles¶
-
public final Iterable<FileObject>
ctreeFiles
¶
jarFiles¶
-
public final Iterable<FileObject>
jarFiles
¶
Constructors¶
StrategoRuntimeFacet¶
-
public
StrategoRuntimeFacet
(Iterable<FileObject> ctreeFiles, Iterable<FileObject> jarFiles)¶
StrategoRuntimeFacetFromESV¶
-
public class
StrategoRuntimeFacetFromESV
¶
Methods¶
create¶
-
public static StrategoRuntimeFacet
create
(IStrategoAppl esv, FileObject location)¶
StrategoRuntimeService¶
-
public class
StrategoRuntimeService
implements IStrategoRuntimeService¶
Constructors¶
StrategoRuntimeService¶
-
public
StrategoRuntimeService
(IResourceService resourceService, ITermFactoryService termFactoryService, Set<IOperatorRegistry> strategoLibraries, ParseStrategoFileStrategy parseStrategoFileStrategy, IProjectService projectService, Set<ClassLoader> additionalClassLoaders)¶
Methods¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageComponent component)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageImpl impl)¶
runtime¶
-
public HybridInterpreter
runtime
(ILanguageComponent component, IContext context, boolean typesmart)¶
runtime¶
-
public HybridInterpreter
runtime
(ILanguageComponent component, FileObject location, boolean typesmart)¶
org.metaborg.spoofax.core.stratego.primitive¶
AbsolutePathPrimitive¶
-
public class
AbsolutePathPrimitive
extends ASpoofaxPrimitive¶
Constructors¶
AbsolutePathPrimitive¶
-
public
AbsolutePathPrimitive
(IResourceService resourceService)¶
CallStrategyPrimitive¶
-
public class
CallStrategyPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
CallStrategyPrimitive¶
-
public
CallStrategyPrimitive
(IDependencyService dependencyService, IContextService contextService, IStrategoCommon common)¶
DigestPrimitive¶
-
public class
DigestPrimitive
extends ASpoofaxPrimitive¶
IsLanguageActivePrimitive¶
-
public class
IsLanguageActivePrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
IsLanguageActivePrimitive¶
-
public
IsLanguageActivePrimitive
(IDependencyService dependencyService)¶
LanguageComponentsPrimitive¶
-
public class
LanguageComponentsPrimitive
extends ASpoofaxContextPrimitive¶
LanguageImplementationPrimitive¶
-
public class
LanguageImplementationPrimitive
extends ASpoofaxContextPrimitive¶
LanguageIncludeDirectoriesPrimitive¶
-
public class
LanguageIncludeDirectoriesPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LanguageIncludeDirectoriesPrimitive¶
-
public
LanguageIncludeDirectoriesPrimitive
(ILanguagePathService languagePathService, IProjectService projectService)¶
LanguageIncludeFilesPrimitive¶
-
public class
LanguageIncludeFilesPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LanguageIncludeFilesPrimitive¶
-
public
LanguageIncludeFilesPrimitive
(ILanguageService languageService, ILanguagePathService languagePathService, IProjectService projectService)¶
LanguagePrimitive¶
-
public class
LanguagePrimitive
extends ASpoofaxContextPrimitive¶
LanguageSourceDirectoriesPrimitive¶
-
public class
LanguageSourceDirectoriesPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LanguageSourceDirectoriesPrimitive¶
-
public
LanguageSourceDirectoriesPrimitive
(ILanguagePathService languagePathService, IProjectService projectService)¶
LanguageSourceFilesPrimitive¶
-
public class
LanguageSourceFilesPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LanguageSourceFilesPrimitive¶
-
public
LanguageSourceFilesPrimitive
(ILanguageService languageService, ILanguagePathService languagePathService, IProjectService projectService)¶
LocalPathPrimitive¶
-
public class
LocalPathPrimitive
extends ASpoofaxPrimitive¶
Constructors¶
LocalPathPrimitive¶
-
public
LocalPathPrimitive
(IResourceService resourceService)¶
LocalReplicatePrimitive¶
-
public class
LocalReplicatePrimitive
extends ASpoofaxPrimitive¶
Constructors¶
LocalReplicatePrimitive¶
-
public
LocalReplicatePrimitive
(IResourceService resourceService)¶
ParsePrimitive¶
-
public class
ParsePrimitive
extends ASpoofaxPrimitive¶
Constructors¶
ParsePrimitive¶
-
public
ParsePrimitive
(IResourceService resourceService, ILanguageService languageService, ILanguageIdentifierService languageIdentifierService, IDialectIdentifier dialectIdentifier, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, ISpoofaxSyntaxService syntaxService)¶
ProjectPathPrimitive¶
-
public class
ProjectPathPrimitive
extends ASpoofaxContextPrimitive¶
RelativeSourceOrIncludePath¶
-
public class
RelativeSourceOrIncludePath
extends ASpoofaxContextPrimitive¶
Constructors¶
RelativeSourceOrIncludePath¶
-
public
RelativeSourceOrIncludePath
(ILanguagePathService languagePathService, IResourceService resourceService, IProjectService projectService)¶
RelativeSourcePath¶
-
public class
RelativeSourcePath
extends ASpoofaxContextPrimitive¶
Constructors¶
RelativeSourcePath¶
-
public
RelativeSourcePath
(ILanguagePathService languagePathService, IResourceService resourceService, IProjectService projectService)¶
SpoofaxPrimitiveLibrary¶
-
public class
SpoofaxPrimitiveLibrary
extends GenericPrimitiveLibrary¶
org.metaborg.spoofax.core.stratego.primitive.constraint¶
C_get_resource_analysis¶
-
public class
C_get_resource_analysis
extends ConstraintContextPrimitive¶
C_get_resource_partial_analysis¶
-
public class
C_get_resource_partial_analysis
extends ConstraintContextPrimitive¶
org.metaborg.spoofax.core.stratego.primitive.flowspec¶
FS_solve¶
-
public class
FS_solve
extends AbstractPrimitive implements ILanguageCache¶
Fields¶
resourceService¶
-
protected final IResourceService
resourceService
¶
Constructors¶
FS_solve¶
-
public
FS_solve
(IResourceService resourceService, ITermFactoryService termFactoryService)¶
Methods¶
call¶
-
public boolean
call
(org.spoofax.interpreter.core.IContext env, Strategy[] svars, IStrategoTerm[] tvars)¶
getFlowSpecStaticInfo¶
-
protected Optional<StaticInfo>
getFlowSpecStaticInfo
(ILanguageComponent component)¶
getFlowSpecStaticInfo¶
-
protected StaticInfo
getFlowSpecStaticInfo
(ILanguageImpl impl)¶
getFlowSpecStaticInfo¶
-
public static StaticInfo
getFlowSpecStaticInfo
(ILanguageImpl impl, Function<ILanguageComponent, Optional<StaticInfo>> getStaticInfo)¶
getFlowSpecStaticInfo¶
-
public static Optional<StaticInfo>
getFlowSpecStaticInfo
(ILanguageComponent component, IResourceService resourceService, ITermFactory termFactory, StrategoTerms strategoTerms)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageComponent component)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageImpl impl)¶
org.metaborg.spoofax.core.stratego.primitive.generic¶
ASpoofaxContextPrimitive¶
-
public abstract class
ASpoofaxContextPrimitive
extends ASpoofaxPrimitive¶ A primitive base class that requires a Spoofax context to be available.
Constructors¶
ASpoofaxPrimitive¶
-
public abstract class
ASpoofaxPrimitive
extends AbstractPrimitive¶ An improved primitive base class.
org.metaborg.spoofax.core.stratego.primitive.legacy¶
LegacyForeignCallPrimitive¶
-
public class
LegacyForeignCallPrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LegacyForeignCallPrimitive¶
-
public
LegacyForeignCallPrimitive
(ILanguageService languageService, IContextService contextService, IProjectService projectService, IStrategoCommon common)¶
LegacyLanguageIncludeFilesPrimitive¶
-
public class
LegacyLanguageIncludeFilesPrimitive
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageIncludeFilesPrimitive¶
-
public
LegacyLanguageIncludeFilesPrimitive
(LanguageIncludeFilesPrimitive prim)¶
LegacyLanguageIncludeLocationsPrimitive¶
-
public class
LegacyLanguageIncludeLocationsPrimitive
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageIncludeLocationsPrimitive¶
-
public
LegacyLanguageIncludeLocationsPrimitive
(LanguageIncludeDirectoriesPrimitive prim)¶
LegacyLanguageIncludeLocationsPrimitive2¶
-
public class
LegacyLanguageIncludeLocationsPrimitive2
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageIncludeLocationsPrimitive2¶
-
public
LegacyLanguageIncludeLocationsPrimitive2
(LanguageIncludeDirectoriesPrimitive prim)¶
LegacyLanguageSourceFilesPrimitive¶
-
public class
LegacyLanguageSourceFilesPrimitive
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageSourceFilesPrimitive¶
-
public
LegacyLanguageSourceFilesPrimitive
(LanguageSourceFilesPrimitive prim)¶
LegacyLanguageSourceLocationsPrimitive¶
-
public class
LegacyLanguageSourceLocationsPrimitive
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageSourceLocationsPrimitive¶
-
public
LegacyLanguageSourceLocationsPrimitive
(LanguageSourceDirectoriesPrimitive prim)¶
LegacyLanguageSourceLocationsPrimitive2¶
-
public class
LegacyLanguageSourceLocationsPrimitive2
extends RedirectingPrimitive¶
Constructors¶
LegacyLanguageSourceLocationsPrimitive2¶
-
public
LegacyLanguageSourceLocationsPrimitive2
(LanguageSourceDirectoriesPrimitive prim)¶
LegacyProjectPathPrimitive¶
-
public class
LegacyProjectPathPrimitive
extends RedirectingPrimitive¶
Constructors¶
LegacyProjectPathPrimitive¶
-
public
LegacyProjectPathPrimitive
(ProjectPathPrimitive prim)¶
org.metaborg.spoofax.core.stratego.primitive.legacy.parse¶
LegacyParseFilePrimitive¶
-
public class
LegacyParseFilePrimitive
extends AbstractPrimitive¶
Constructors¶
LegacyParseFilePrimitive¶
-
public
LegacyParseFilePrimitive
(IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, ISpoofaxSyntaxService syntaxService)¶
LegacyParseFilePrimitive¶
-
protected
LegacyParseFilePrimitive
(String name, IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, ISpoofaxSyntaxService syntaxService)¶
LegacyParseFilePtPrimitive¶
-
public class
LegacyParseFilePtPrimitive
extends LegacyParseFilePrimitive¶
Constructors¶
LegacyParseFilePtPrimitive¶
-
public
LegacyParseFilePtPrimitive
(IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, SpoofaxSyntaxService syntaxService)¶
org.metaborg.spoofax.core.stratego.primitive.nabl2¶
SG_is_debug_collection_enabled¶
-
public class
SG_is_debug_collection_enabled
extends ScopeGraphConfigPrimitive¶
Constructors¶
SG_is_debug_collection_enabled¶
-
public
SG_is_debug_collection_enabled
(ISpoofaxProjectConfigService configService)¶
SG_is_debug_custom_enabled¶
-
public class
SG_is_debug_custom_enabled
extends ScopeGraphConfigPrimitive¶
Constructors¶
SG_is_debug_custom_enabled¶
-
public
SG_is_debug_custom_enabled
(ISpoofaxProjectConfigService configService)¶
SG_is_debug_resolution_enabled¶
-
public class
SG_is_debug_resolution_enabled
extends ScopeGraphConfigPrimitive¶
Constructors¶
SG_is_debug_resolution_enabled¶
-
public
SG_is_debug_resolution_enabled
(ISpoofaxProjectConfigService configService)¶
ScopeGraphConfigPrimitive¶
-
public abstract class
ScopeGraphConfigPrimitive
extends ASpoofaxPrimitive¶
Constructors¶
ScopeGraphConfigPrimitive¶
-
public
ScopeGraphConfigPrimitive
(String name, ISpoofaxProjectConfigService configService)¶
org.metaborg.spoofax.core.stratego.strategies¶
ParseFileStrategy¶
-
public class
ParseFileStrategy
extends Strategy¶
Constructors¶
ParseFileStrategy¶
-
public
ParseFileStrategy
(IResourceService resourceService, ILanguageIdentifierService languageIdentifierService, ISpoofaxUnitService unitService, ISourceTextService sourceTextService, ISpoofaxSyntaxService syntaxService)¶
org.metaborg.spoofax.core.style¶
CategorizerService¶
-
public class
CategorizerService
implements ISpoofaxCategorizerService¶
Methods¶
categorize¶
-
public Iterable<IRegionCategory<IStrategoTerm>>
categorize
(ILanguageImpl language, ISpoofaxParseUnit parseResult)¶
categorize¶
-
public Iterable<IRegionCategory<IStrategoTerm>>
categorize
(ILanguageImpl language, ISpoofaxAnalyzeUnit analysisResult)¶
CategorizerValidator¶
-
public class
CategorizerValidator
¶
Methods¶
validate¶
-
public static <T> Iterable<IRegionCategory<T>>
validate
(Iterable<IRegionCategory<T>> categorization)¶
ConsCategory¶
ISpoofaxCategorizerService¶
-
public interface
ISpoofaxCategorizerService
extends ICategorizerService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, IStrategoTerm>¶ Typedef interface for
ICategorizerService
with Spoofax interfaces.
ISpoofaxStylerService¶
-
public interface
ISpoofaxStylerService
extends IStylerService<IStrategoTerm>¶ Typedef interface for
IStylerService
with Spoofax interfaces.
SortCategory¶
SortConsCategory¶
StylerFacetFromESV¶
-
public class
StylerFacetFromESV
¶
Methods¶
create¶
-
public static StylerFacet
create
(IStrategoAppl esv)¶
StylerService¶
-
public class
StylerService
implements ISpoofaxStylerService¶
Methods¶
styleAnalyzed¶
-
public Iterable<IRegionStyle<IStrategoTerm>>
styleAnalyzed
(ILanguageImpl language, Iterable<IRegionCategory<IStrategoTerm>> categorization)¶
styleParsed¶
-
public Iterable<IRegionStyle<IStrategoTerm>>
styleParsed
(ILanguageImpl language, Iterable<IRegionCategory<IStrategoTerm>> categorization)¶
org.metaborg.spoofax.core.syntax¶
IParserConfig¶
-
public interface
IParserConfig
¶
Methods¶
getImploderSetting¶
-
ImploderImplementation
getImploderSetting
()¶
getParseTableProvider¶
-
IParseTableProvider
getParseTableProvider
()¶
ISpoofaxParser¶
-
public interface
ISpoofaxParser
extends IParser<ISpoofaxInputUnit, ISpoofaxParseUnit>¶ Typedef interface for
IParser
with Spoofax interfaces.
ISpoofaxSyntaxService¶
-
public interface
ISpoofaxSyntaxService
extends ISyntaxService<ISpoofaxInputUnit, ISpoofaxParseUnit>¶ Typedef interface for
ISyntaxService
with Spoofax interfaces.
ImploderImplementation¶
-
public enum
ImploderImplementation
¶
Enum Constants¶
java¶
-
public static final ImploderImplementation
java
¶
stratego¶
-
public static final ImploderImplementation
stratego
¶
IncrementalParserConfig¶
-
public class
IncrementalParserConfig
implements IParserConfig¶
Constructors¶
IncrementalParserConfig¶
-
public
IncrementalParserConfig
(String startSymbol, IParseTableProvider provider, ParseTable pt, ImploderImplementation imploder)¶
JSGLR1FileParseTableProvider¶
-
public class
JSGLR1FileParseTableProvider
implements IParseTableProvider¶
Constructors¶
JSGLR1FileParseTableProvider¶
-
public
JSGLR1FileParseTableProvider
(FileObject resource, ITermFactory termFactory)¶
JSGLR1I¶
Constructors¶
JSGLR1I¶
-
public
JSGLR1I
(IParserConfig config, ITermFactory termFactory, ILanguageImpl language, ILanguageImpl dialect, FileObject resource, String input)¶
Methods¶
actuallyParse¶
-
public SGLRParseResult
actuallyParse
(String text, String filename, JSGLRParserConfiguration parserConfig)¶
parse¶
-
public ParseContrib
parse
(JSGLRParserConfiguration parserConfig)¶
JSGLR1IncrementalParseTableProvider¶
-
public class
JSGLR1IncrementalParseTableProvider
implements IParseTableProvider¶
Constructors¶
JSGLR1IncrementalParseTableProvider¶
-
public
JSGLR1IncrementalParseTableProvider
(FileObject resource, ITermFactory termFactory, org.metaborg.sdf2table.parsetable.ParseTable referenceTable)¶
JSGLR2FileParseTableProvider¶
-
public class
JSGLR2FileParseTableProvider
implements IParseTableProvider¶
Constructors¶
JSGLR2FileParseTableProvider¶
-
public
JSGLR2FileParseTableProvider
(FileObject resource, ITermFactory termFactory)¶
JSGLR2I¶
Constructors¶
JSGLR2I¶
-
public
JSGLR2I
(IParserConfig config, ITermFactory termFactory, ILanguageImpl language, ILanguageImpl dialect, FileObject resource, String input, boolean dataDependent, boolean layoutSensitive)¶
Methods¶
parse¶
-
public ParseContrib
parse
(JSGLRParserConfiguration parserConfig)¶
JSGLRI¶
-
public abstract class
JSGLRI
<PT>¶
Fields¶
config¶
-
protected final IParserConfig
config
¶
dialect¶
-
protected final ILanguageImpl
dialect
¶
language¶
-
protected final ILanguageImpl
language
¶
resource¶
-
protected final FileObject
resource
¶
Constructors¶
JSGLRI¶
-
public
JSGLRI
(IParserConfig config, ITermFactory termFactory, ILanguageImpl language, ILanguageImpl dialect, FileObject resource, String input)¶
Methods¶
getConfig¶
-
public IParserConfig
getConfig
()¶
getDialect¶
-
public ILanguageImpl
getDialect
()¶
getLanguage¶
-
public ILanguageImpl
getLanguage
()¶
getOrDefaultStartSymbol¶
-
protected String
getOrDefaultStartSymbol
(JSGLRParserConfiguration parserConfig)¶
getParseTable¶
-
protected PT
getParseTable
(IParseTableProvider parseTableProvider)¶
getResource¶
-
public FileObject
getResource
()¶
parse¶
-
public abstract ParseContrib
parse
(JSGLRParserConfiguration parserConfig)¶
JSGLRParseErrorHandler¶
-
public class
JSGLRParseErrorHandler
¶
Constructors¶
JSGLRParseErrorHandler¶
-
public
JSGLRParseErrorHandler
(JSGLRI<?> parser, FileObject resource, boolean hasRecoveryRules)¶
Methods¶
JSGLRParseService¶
-
public class
JSGLRParseService
implements ISpoofaxParser, ILanguageCache¶
Constructors¶
JSGLRParseService¶
-
public
JSGLRParseService
(ISpoofaxUnitService unitService, ITermFactoryService termFactoryService, JSGLRParserConfiguration defaultParserConfig)¶
Methods¶
getCompletionParserConfig¶
-
public IParserConfig
getCompletionParserConfig
(ILanguageImpl lang, ISpoofaxInputUnit input)¶
getParserConfig¶
-
public IParserConfig
getParserConfig
(ILanguageImpl lang, ISpoofaxInputUnit input)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageImpl impl)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageComponent component)¶
parse¶
-
public ISpoofaxParseUnit
parse
(ISpoofaxInputUnit input, IProgress progress, ICancel cancel)¶
parseAll¶
-
public Collection<ISpoofaxParseUnit>
parseAll
(Iterable<ISpoofaxInputUnit> inputs, IProgress progress, ICancel cancel)¶
JSGLRParserConfiguration¶
-
public class
JSGLRParserConfiguration
¶
Fields¶
JSGLRSourceRegionFactory¶
-
public class
JSGLRSourceRegionFactory
¶
Methods¶
fromToken¶
-
public static ISourceRegion
fromToken
(IToken token)¶
fromTokens¶
-
public static ISourceRegion
fromTokens
(IToken left, IToken right)¶
fromTokensLayout¶
-
public static ISourceRegion
fromTokensLayout
(IToken left, IToken right, boolean isNullable)¶
ParserConfig¶
-
public class
ParserConfig
implements IParserConfig¶
Constructors¶
ParserConfig¶
-
public
ParserConfig
(String startSymbol, IParseTableProvider provider, ImploderImplementation imploder)¶
Methods¶
getImploderSetting¶
-
public ImploderImplementation
getImploderSetting
()¶
getParseTableProvider¶
-
public IParseTableProvider
getParseTableProvider
()¶
SourceAttachment¶
-
public class
SourceAttachment
extends AbstractTermAttachment¶ A tree-wide source resource and parse controller attachment. Uses
ParentAttachment
to identify the root of a tree, where this attachment is stored.
Fields¶
TYPE¶
-
public static final TermAttachmentType<SourceAttachment>
TYPE
¶
Methods¶
getAttachmentType¶
-
public TermAttachmentType<SourceAttachment>
getAttachmentType
()¶
getFile¶
-
public FileObject
getFile
()¶
getResource¶
-
public static FileObject
getResource
(ISimpleTerm term, IResourceService resourceService)¶
putSource¶
-
public static void
putSource
(ISimpleTerm term, FileObject resource)¶ Sets the resource for a term tree. Should only be applied to the root of a tree.
SpoofaxSyntaxService¶
-
public class
SpoofaxSyntaxService
extends SyntaxService<ISpoofaxInputUnit, ISpoofaxParseUnit> implements ISpoofaxSyntaxService¶
Constructors¶
SpoofaxSyntaxService¶
-
public
SpoofaxSyntaxService
(Map<String, ISpoofaxParser> parsers)¶
Methods¶
fenceCharacters¶
-
public Iterable<FenceCharacters>
fenceCharacters
(ILanguageImpl language)¶
multiLineCommentCharacters¶
-
public Iterable<MultiLineCommentCharacters>
multiLineCommentCharacters
(ILanguageImpl language)¶
singleLineCommentPrefixes¶
-
public Iterable<String>
singleLineCommentPrefixes
(ILanguageImpl language)¶
SyntaxFacet¶
Fields¶
completionParseTable¶
-
public final FileObject
completionParseTable
¶
fenceCharacters¶
-
public final Iterable<FenceCharacters>
fenceCharacters
¶
imploder¶
-
public final ImploderImplementation
imploder
¶
multiLineCommentCharacters¶
-
public final Iterable<MultiLineCommentCharacters>
multiLineCommentCharacters
¶
parseTable¶
-
public final FileObject
parseTable
¶
Constructors¶
SyntaxFacet¶
-
public
SyntaxFacet
(FileObject parseTable, FileObject completionParseTable, Iterable<String> startSymbols)¶ Creates a syntax facet from a parse table provider and start symbols.
Parameters: - parseTable – Parse table.
- startSymbols – Set of start symbols.
SyntaxFacet¶
-
public
SyntaxFacet
(FileObject parseTable, FileObject completionParseTable, Iterable<String> startSymbols, Iterable<String> singleLineCommentPrefixes, Iterable<MultiLineCommentCharacters> multiLineCommentCharacters, Iterable<FenceCharacters> fenceCharacters, ImploderImplementation imploder)¶ Creates a syntax facet from syntax configuration.
Parameters: - parseTable – Parse table.
- startSymbols – Set of start symbols.
- singleLineCommentPrefixes – Single line comment prefixes.
- multiLineCommentCharacters – Multi line comment characters.
- fenceCharacters – Fence characters.
Methods¶
available¶
withImploderSetting¶
-
public SyntaxFacet
withImploderSetting
(ImploderImplementation imploder)¶ Creates a syntax facet from another syntax facet, only overriding the imploder setting
Parameters: - imploder – The imploder setting.
SyntaxFacetFromESV¶
-
public class
SyntaxFacetFromESV
¶
Methods¶
create¶
-
public static SyntaxFacet
create
(IStrategoAppl esv, FileObject location)¶
org.metaborg.spoofax.core.terms¶
ITermFactoryService¶
-
public interface
ITermFactoryService
¶ Interface for retrieving term factories for languages and generic use.
Methods¶
get¶
-
ITermFactory
get
(ILanguageImpl impl, IProject project, boolean supportsTypesmart)¶ Return the term factory to be used when constructing new terms for given language implementation.
Parameters: - impl – Implementation to get the term factory for.
- project – The current project through which the user can require typesmart analysis.
- supportsTypesmart – Whether the caller supports typesmart analysis.
Returns: Language-specific term factory.
get¶
-
ITermFactory
get
(ILanguageComponent component, IProject project, boolean supportsTypesmart)¶ Return the term factory to be used when constructing new terms for given language component.
Parameters: - component – Component to get the term factory for.
- project – The current project through which the user can require typesmart analysis.
- supportsTypesmart – Whether the caller supports typesmart analysis.
Returns: Language-specific term factory.
TermFactoryService¶
-
public class
TermFactoryService
implements ITermFactoryService, ILanguageCache¶
Constructors¶
TermFactoryService¶
-
public
TermFactoryService
(IDependencyService dependencyService, ISpoofaxProjectConfigService configService)¶
Methods¶
get¶
-
public ITermFactory
get
(ILanguageImpl impl, IProject project, boolean supportsTypesmart)¶
get¶
-
public ITermFactory
get
(ILanguageComponent component, IProject project, boolean supportsTypesmart)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageImpl impl)¶
invalidateCache¶
-
public void
invalidateCache
(ILanguageComponent component)¶
org.metaborg.spoofax.core.tracing¶
HoverFacet¶
HoverService¶
-
public class
HoverService
implements ISpoofaxHoverService¶
Constructors¶
HoverService¶
-
public
HoverService
(IProjectService projectService, IContextService contextService, ITermFactoryService termFactoryService, IStrategoRuntimeService strategoRuntimeService, ISpoofaxTracingService tracingService, TracingCommon common)¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl language)¶
hover¶
-
public Hover
hover
(int offset, ISpoofaxParseUnit result)¶
hover¶
-
public Hover
hover
(int offset, ISpoofaxAnalyzeUnit result)¶
ISpoofaxHoverService¶
-
public interface
ISpoofaxHoverService
extends IHoverService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit>¶ Typedef interface for
IHoverService
with Spoofax interfaces.
ISpoofaxResolverService¶
-
public interface
ISpoofaxResolverService
extends IResolverService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit>¶ Typedef interface for
IResolverService
with Spoofax interfaces.
ISpoofaxTracingService¶
-
public interface
ISpoofaxTracingService
extends ITracingService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxTransformUnit<?>, IStrategoTerm>¶ Typedef interface for
ITracingService
with Spoofax interfaces.
ResolverFacet¶
ResolverFacetFromESV¶
-
public class
ResolverFacetFromESV
¶
Methods¶
createHover¶
-
public static HoverFacet
createHover
(IStrategoAppl esv)¶
createResolver¶
-
public static ResolverFacet
createResolver
(IStrategoAppl esv)¶
ResolverService¶
-
public class
ResolverService
implements ISpoofaxResolverService¶
Constructors¶
ResolverService¶
-
public
ResolverService
(IProjectService projectService, IContextService contextService, ITermFactoryService termFactoryService, IStrategoRuntimeService strategoRuntimeService, ISpoofaxTracingService tracingService, TracingCommon common)¶
Methods¶
available¶
-
public boolean
available
(ILanguageImpl language)¶
resolve¶
-
public Resolution
resolve
(int offset, ISpoofaxParseUnit result)¶
resolve¶
-
public Resolution
resolve
(int offset, ISpoofaxAnalyzeUnit result)¶
TracingCommon¶
-
public class
TracingCommon
¶
Constructors¶
TracingCommon¶
-
public
TracingCommon
(ISpoofaxTracingService tracingService, IStrategoCommon common)¶
Methods¶
getTargetLocation¶
-
public ISourceLocation
getTargetLocation
(IStrategoTerm term)¶
outputs¶
-
public TermWithRegion
outputs
(ITermFactory termFactory, HybridInterpreter runtime, FileObject location, FileObject resource, IStrategoTerm result, Iterable<IStrategoTerm> inRegion, String strategy)¶
TracingCommon.TermWithRegion¶
-
public static class
TermWithRegion
¶ Data class representing a term with its corresponding region in the source text.
Constructors¶
TermWithRegion¶
-
public
TermWithRegion
(IStrategoTerm term, ISourceRegion region)¶
TracingService¶
-
public class
TracingService
implements ISpoofaxTracingService¶
Constructors¶
TracingService¶
-
public
TracingService
(IResourceService resourceService)¶
Methods¶
fragments¶
-
public Iterable<IStrategoTerm>
fragments
(ISpoofaxParseUnit result, ISourceRegion region)¶
fragments¶
-
public Iterable<IStrategoTerm>
fragments
(ISpoofaxAnalyzeUnit result, ISourceRegion region)¶
fragments¶
-
public Iterable<IStrategoTerm>
fragments
(ISpoofaxTransformUnit<?> result, ISourceRegion region)¶
fragmentsWithin¶
-
public Iterable<IStrategoTerm>
fragmentsWithin
(ISpoofaxParseUnit result, ISourceRegion region)¶
fragmentsWithin¶
-
public Iterable<IStrategoTerm>
fragmentsWithin
(ISpoofaxAnalyzeUnit result, ISourceRegion region)¶
fragmentsWithin¶
-
public Iterable<IStrategoTerm>
fragmentsWithin
(ISpoofaxTransformUnit<?> result, ISourceRegion region)¶
location¶
-
public ISourceLocation
location
(IStrategoTerm fragment)¶
org.metaborg.spoofax.core.transform¶
ISpoofaxTransformService¶
-
public interface
ISpoofaxTransformService
extends ITransformService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>>¶ Typedef interface for
ITransformService
with Spoofax interfaces.
IStrategoTransformer¶
-
public interface
IStrategoTransformer
extends ITransformer<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>>¶ Typedef interface for
ITransformer
with Spoofax interfaces.
SpoofaxTransformService¶
-
public class
SpoofaxTransformService
extends TransformService<ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>> implements ISpoofaxTransformService¶ Typedef class for
TransformService
withIStrategoTerm
.
Constructors¶
SpoofaxTransformService¶
-
public
SpoofaxTransformService
(IActionService actionService, ISpoofaxAnalysisService analysisService, IStrategoTransformer transformer)¶
StrategoTransformer¶
-
public class
StrategoTransformer
implements IStrategoTransformer¶
Constructors¶
StrategoTransformer¶
-
public
StrategoTransformer
(IResourceService resourceService, ISpoofaxUnitService unitService, IEditorRegistry editorRegistry, IStrategoRuntimeService strategoRuntimeService, IStrategoCommon common)¶
Methods¶
transform¶
-
public ISpoofaxTransformUnit<ISpoofaxParseUnit>
transform
(ISpoofaxParseUnit input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transform¶
-
public ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>
transform
(ISpoofaxAnalyzeUnit input, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllAnalyzed¶
-
public Collection<ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>>
transformAllAnalyzed
(Iterable<ISpoofaxAnalyzeUnit> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
transformAllParsed¶
-
public Collection<ISpoofaxTransformUnit<ISpoofaxParseUnit>>
transformAllParsed
(Iterable<ISpoofaxParseUnit> inputs, IContext context, TransformActionContrib action, ITransformConfig config)¶
org.metaborg.spoofax.core.unit¶
AnalyzeContrib¶
-
public class
AnalyzeContrib
implements IUnitContrib¶
Fields¶
AnalyzeUnit¶
-
public class
AnalyzeUnit
extends UnitWrapper implements ISpoofaxAnalyzeUnit¶
Constructors¶
AnalyzeUnit¶
-
public
AnalyzeUnit
(Unit unit, AnalyzeContrib contrib, ISpoofaxParseUnit parseUnit, IContext context)¶
AnalyzeUnitUpdate¶
-
public class
AnalyzeUnitUpdate
implements ISpoofaxAnalyzeUnitUpdate¶
Constructors¶
AnalyzeUnitUpdate¶
-
public
AnalyzeUnitUpdate
(FileObject source, AnalyzeUpdateData data)¶
ISpoofaxAnalyzeUnit¶
-
public interface
ISpoofaxAnalyzeUnit
extends IAnalyzeUnit¶ Spoofax-specific extension of an
IAnalyzeUnit
that adds anIStrategoTerm
AST.
ISpoofaxAnalyzeUnitUpdate¶
-
public interface
ISpoofaxAnalyzeUnitUpdate
extends IAnalyzeUnitUpdate¶ Spoofax-specific extension of an analyze unit update.
ISpoofaxInputUnit¶
-
public interface
ISpoofaxInputUnit
extends IInputUnit¶ Spoofax-specific extension of an input unit.
Methods¶
config¶
-
JSGLRParserConfiguration
config
()¶ Returns: Parser-specific configuration, or null when no configuration has been set.
ISpoofaxInputUnitService¶
-
public interface
ISpoofaxInputUnitService
extends IInputUnitService<ISpoofaxInputUnit>¶
Methods¶
inputUnit¶
-
ISpoofaxInputUnit
inputUnit
(FileObject source, String text, ILanguageImpl langImpl, ILanguageImpl dialect, JSGLRParserConfiguration config)¶
inputUnit¶
-
ISpoofaxInputUnit
inputUnit
(String text, ILanguageImpl langImpl, ILanguageImpl dialect, JSGLRParserConfiguration config)¶
ISpoofaxParseUnit¶
-
public interface
ISpoofaxParseUnit
extends IParseUnit¶ Spoofax-specific extension of a parse unit that adds an
IStrategoTerm
AST.
ISpoofaxTransformOutput¶
-
public interface
ISpoofaxTransformOutput
extends ITransformOutput¶
ISpoofaxTransformUnit¶
-
public interface
ISpoofaxTransformUnit
<I extends IUnit> extends ITransformUnit<I>¶ Spoofax-specific extension of an
ITransformUnit
that adds anString
AST.Parameters: - <I> – Type of input unit.
ISpoofaxUnitService¶
-
public interface
ISpoofaxUnitService
extends IUnitService<ISpoofaxInputUnit, ISpoofaxParseUnit, ISpoofaxAnalyzeUnit, ISpoofaxAnalyzeUnitUpdate, ISpoofaxTransformUnit<ISpoofaxParseUnit>, ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>>, ISpoofaxInputUnitService¶ Typedef interface for
IUnitService
with Spoofax interfaces, extended with methods to create new parse, analyze, and transform units.
Methods¶
analyzeUnit¶
-
ISpoofaxAnalyzeUnit
analyzeUnit
(ISpoofaxParseUnit input, AnalyzeContrib contrib, IContext context)¶
analyzeUnitUpdate¶
-
ISpoofaxAnalyzeUnitUpdate
analyzeUnitUpdate
(FileObject source, AnalyzeUpdateData contrib, IContext context)¶
parseUnit¶
-
ISpoofaxParseUnit
parseUnit
(ISpoofaxInputUnit input, ParseContrib contrib)¶
transformUnit¶
-
<I extends IUnit> ISpoofaxTransformUnit<I>
transformUnit
(I input, TransformContrib contrib, IContext context, TransformActionContrib action)¶
InputContrib¶
-
public class
InputContrib
implements IUnitContrib¶
Fields¶
config¶
-
public final JSGLRParserConfiguration
config
¶
dialect¶
-
public final ILanguageImpl
dialect
¶
langImpl¶
-
public final ILanguageImpl
langImpl
¶
Constructors¶
InputContrib¶
-
public
InputContrib
(String text, ILanguageImpl langImpl, ILanguageImpl dialect, JSGLRParserConfiguration config)¶
InputContrib¶
-
public
InputContrib
(String text, ILanguageImpl langImpl, ILanguageImpl dialect)¶
InputContrib¶
-
public
InputContrib
(ILanguageImpl langImpl, ILanguageImpl dialect)¶
InputContrib¶
-
public
InputContrib
(ILanguageImpl langImpl)¶
InputUnit¶
-
public class
InputUnit
extends UnitWrapper implements ISpoofaxInputUnit¶ Wraps a
Unit
andInputContrib
asISpoofaxInputUnit
.
Constructors¶
InputUnit¶
-
public
InputUnit
(Unit unit, InputContrib contrib)¶
Methods¶
config¶
-
public JSGLRParserConfiguration
config
()¶
dialect¶
-
public ILanguageImpl
dialect
()¶
langImpl¶
-
public ILanguageImpl
langImpl
()¶
ParseContrib¶
-
public class
ParseContrib
implements IUnitContrib¶
Fields¶
ParseUnit¶
-
public class
ParseUnit
extends UnitWrapper implements ISpoofaxParseUnit¶ Wraps a
Unit
andParseContrib
asISpoofaxParseUnit
.
Constructors¶
ParseUnit¶
-
public
ParseUnit
(Unit unit, ParseContrib contrib, ISpoofaxInputUnit inputUnit)¶
TransformContrib¶
-
public class
TransformContrib
implements IUnitContrib¶
Fields¶
outputs¶
-
public final Iterable<TransformOutput>
outputs
¶
TransformOutput¶
-
public class
TransformOutput
implements ISpoofaxTransformOutput¶
Fields¶
resource¶
-
public final FileObject
resource
¶
Constructors¶
TransformOutput¶
-
public
TransformOutput
(String name, FileObject output, IStrategoTerm ast)¶
TransformUnit¶
-
public class
TransformUnit
<I extends IUnit> extends UnitWrapper implements ISpoofaxTransformUnit<I>¶
Constructors¶
TransformUnit¶
-
public
TransformUnit
(Unit unit, TransformContrib contrib, I inputUnit, IContext context, TransformActionContrib action)¶
Methods¶
action¶
-
public TransformActionContrib
action
()¶
outputs¶
-
public Iterable<TransformOutput>
outputs
()¶
Unit¶
Constructors¶
Unit¶
-
public
Unit
(FileObject source, Map<String, IUnitContrib> contribs)¶
Unit¶
-
public
Unit
(FileObject source)¶
Methods¶
addUnitContrib¶
-
public void
addUnitContrib
(IUnitContrib contrib)¶
source¶
-
public FileObject
source
()¶
unitContrib¶
-
public IUnitContrib
unitContrib
(String id)¶
unitContribs¶
-
public Iterable<IUnitContrib>
unitContribs
()¶
UnitService¶
-
public class
UnitService
implements ISpoofaxUnitService¶
Constructors¶
UnitService¶
-
public
UnitService
(ITermFactoryService termFactoryService)¶
Methods¶
analyzeUnit¶
-
public ISpoofaxAnalyzeUnit
analyzeUnit
(ISpoofaxParseUnit input, AnalyzeContrib contrib, IContext context)¶
analyzeUnitUpdate¶
-
public ISpoofaxAnalyzeUnitUpdate
analyzeUnitUpdate
(FileObject source, AnalyzeUpdateData contrib, IContext context)¶
emptyAnalyzeUnit¶
-
public ISpoofaxAnalyzeUnit
emptyAnalyzeUnit
(ISpoofaxParseUnit input, IContext context)¶
emptyAnalyzeUnitUpdate¶
-
public ISpoofaxAnalyzeUnitUpdate
emptyAnalyzeUnitUpdate
(FileObject source, IContext context)¶
emptyInputUnit¶
-
public ISpoofaxInputUnit
emptyInputUnit
(FileObject source, ILanguageImpl langImpl, ILanguageImpl dialect)¶
emptyInputUnit¶
-
public ISpoofaxInputUnit
emptyInputUnit
(ILanguageImpl langImpl, ILanguageImpl dialect)¶
emptyParseUnit¶
-
public ISpoofaxParseUnit
emptyParseUnit
(ISpoofaxInputUnit input)¶
emptyTransformUnit¶
-
public ISpoofaxTransformUnit<ISpoofaxParseUnit>
emptyTransformUnit
(ISpoofaxParseUnit input, IContext context, TransformActionContrib action)¶
emptyTransformUnit¶
-
public ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>
emptyTransformUnit
(ISpoofaxAnalyzeUnit input, IContext context, TransformActionContrib action)¶
inputUnit¶
-
public ISpoofaxInputUnit
inputUnit
(FileObject source, String text, ILanguageImpl langImpl, ILanguageImpl dialect, JSGLRParserConfiguration config)¶
inputUnit¶
-
public ISpoofaxInputUnit
inputUnit
(String text, ILanguageImpl langImpl, ILanguageImpl dialect, JSGLRParserConfiguration config)¶
inputUnit¶
-
public ISpoofaxInputUnit
inputUnit
(FileObject source, String text, ILanguageImpl langImpl, ILanguageImpl dialect)¶
inputUnit¶
-
public ISpoofaxInputUnit
inputUnit
(String text, ILanguageImpl langImpl, ILanguageImpl dialect)¶
parseUnit¶
-
public ISpoofaxParseUnit
parseUnit
(ISpoofaxInputUnit input, ParseContrib contrib)¶
transformUnit¶
-
public <I extends IUnit> ISpoofaxTransformUnit<I>
transformUnit
(I input, TransformContrib contrib, IContext context, TransformActionContrib action)¶
UnitWrapper¶
Methods¶
addUnitContrib¶
-
public void
addUnitContrib
(IUnitContrib contrib)¶
source¶
-
public FileObject
source
()¶
unitContrib¶
-
public IUnitContrib
unitContrib
(String id)¶
unitContribs¶
-
public Iterable<IUnitContrib>
unitContribs
()¶
Javadoc¶
org.metaborg.meta.core¶
MetaBorgMeta¶
-
public class
MetaBorgMeta
implements AutoCloseable¶ Facade for instantiating and accessing the MetaBorg meta API, as an extension of the
MetaBorg
API.
Fields¶
autoCloseables¶
-
public final Set<AutoCloseable>
autoCloseables
¶
languageSpecConfigService¶
-
public final ILanguageSpecConfigService
languageSpecConfigService
¶
languageSpecService¶
-
public final ILanguageSpecService
languageSpecService
¶
Constructors¶
MetaBorgMeta¶
-
public
MetaBorgMeta
(MetaBorg metaborg, IModulePluginLoader loader, MetaborgMetaModule module, Module... additionalModules)¶ Instantiate the MetaBorg meta API.
Parameters: - metaborg – MetaBorg API to extend.
- loader – Meta-module plugin loader to use.
- module – MetaBorg meta-module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
MetaBorgMeta¶
-
public
MetaBorgMeta
(MetaBorg metaborg, MetaborgMetaModule module, Module... additionalModules)¶ Instantiate the MetaBorg meta API.
Parameters: - metaborg – MetaBorg API to extend.
- module – MetaBorg meta-module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
MetaBorgMeta¶
-
public
MetaBorgMeta
(MetaBorg metaborg, IModulePluginLoader loader, Module... additionalModules)¶ Instantiate the MetaBorg meta API.
Parameters: - metaborg – MetaBorg API to extend.
- loader – Meta-module plugin loader to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Methods¶
close¶
-
public void
close
()¶ Closes the MetaBorg meta API, closing any resources and services created by the API. The parent MetaBorg (non-meta) API is NOT closed.
defaultModule¶
-
protected static MetaborgMetaModule
defaultModule
()¶
defaultPluginLoader¶
-
protected static IModulePluginLoader
defaultPluginLoader
()¶
MetaborgMetaModule¶
-
public class
MetaborgMetaModule
extends AbstractModule¶
Fields¶
autoClosableBinder¶
-
protected Multibinder<AutoCloseable>
autoClosableBinder
¶
org.metaborg.meta.core.config¶
ILanguageSpecConfig¶
-
public interface
ILanguageSpecConfig
extends ILanguageComponentConfig¶ Configuration of a language specification at build time, an extension of the
ILanguageComponentConfig
runtime configuration. To create a new instance of this interface, use anILanguageSpecConfigBuilder
interface.
Methods¶
pardonedLanguages¶
-
Collection<String>
pardonedLanguages
()¶ Gets a sequence of languages whose errors are ignored.
Returns: The pardoned languages.
ILanguageSpecConfigBuilder¶
-
public interface
ILanguageSpecConfigBuilder
extends ILanguageComponentConfigBuilder¶ Builder for
ILanguageSpecConfig
objects.
Methods¶
addCompileDeps¶
-
ILanguageSpecConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addExports¶
-
ILanguageSpecConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶
addGenerates¶
-
ILanguageSpecConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶
addJavaDeps¶
-
ILanguageSpecConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addLangContribs¶
-
ILanguageSpecConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
addPardonedLanguages¶
-
ILanguageSpecConfigBuilder
addPardonedLanguages
(Iterable<String> languages)¶ Adds pardoned languages.
Parameters: - languages – The pardoned languages.
Returns: This builder.
addSourceDeps¶
-
ILanguageSpecConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
build¶
-
ILanguageSpecConfig
build
(FileObject rootFolder)¶
copyFrom¶
-
ILanguageSpecConfigBuilder
copyFrom
(ILanguageSpecConfig obj)¶ Copies the values from the specified configuration.
Parameters: - config – The configuration to copy values from.
reset¶
-
ILanguageSpecConfigBuilder
reset
()¶
withCompileDeps¶
-
ILanguageSpecConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withExports¶
-
ILanguageSpecConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶
withGenerates¶
-
ILanguageSpecConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶
withIdentifier¶
-
ILanguageSpecConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶
withJavaDeps¶
-
ILanguageSpecConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withLangContribs¶
-
ILanguageSpecConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
withMetaborgVersion¶
-
ILanguageSpecConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withName¶
-
ILanguageSpecConfigBuilder
withName
(String name)¶
withPardonedLanguages¶
-
ILanguageSpecConfigBuilder
withPardonedLanguages
(Iterable<String> languages)¶ Sets the pardoned languages.
Parameters: - languages – The pardoned languages.
Returns: This builder.
withSourceDeps¶
-
ILanguageSpecConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
withUseBuildSystemSpec¶
-
ILanguageSpecConfigBuilder
withUseBuildSystemSpec
(boolean useBuildSystemSpec)¶ Sets the flag to use the build system specification.
Parameters: - useBuildSystemSpec – True to use the build system specification, false otherwise.
Returns: This builder.
ILanguageSpecConfigService¶
-
public interface
ILanguageSpecConfigService
¶ Stores and retrieves language specification configurations.
Methods¶
available¶
-
boolean
available
(FileObject rootFolder)¶ Checks if a configuration exists for the language specification at the given location.
Parameters: - rootFolder – The language specification root folder.
Returns: True if a configuration exists, false otherwise.
get¶
-
ConfigRequest<? extends ILanguageSpecConfig>
get
(FileObject rootFolder)¶ Gets the configuration for the language specification at the given location.
Parameters: - rootFolder – The language specification root folder.
Returns: Configuration request, either with a valid configuration, or a collection of error messages.
ILanguageSpecConfigWriter¶
-
public interface
ILanguageSpecConfigWriter
¶ Writes a configuration for the specified
ILanguageSpec
.
Methods¶
write¶
-
void
write
(ILanguageSpec languageSpec, ILanguageSpecConfig config, IFileAccess access)¶ Writes the specified configuration for the specified language specification.
Parameters: - languageSpec – The language specification.
- config – The configuration to write.
- access –
LanguageSpecConfig¶
-
public class
LanguageSpecConfig
extends LanguageComponentConfig implements ILanguageSpecConfig, IConfig¶ An implementation of the
ILanguageSpecConfig
interface that is backed by anImmutableConfiguration
object.
Constructors¶
LanguageSpecConfig¶
-
public
LanguageSpecConfig
(HierarchicalConfiguration<ImmutableNode> config, ProjectConfig projectConfig)¶
LanguageSpecConfig¶
-
protected
LanguageSpecConfig
(HierarchicalConfiguration<ImmutableNode> config, ProjectConfig projectConfig, LanguageIdentifier id, String name, Boolean sdfEnabled, Sdf2tableVersion sdf2tableVersion, Boolean dataDependent, String parseTable, String completionsParseTable, JSGLRVersion jsglrVersion, Collection<LanguageContributionIdentifier> langContribs, Collection<IGenerateConfig> generates, Collection<IExportConfig> exports, Collection<String> pardonedLanguages, Boolean useBuildSystemSpec)¶
Methods¶
pardonedLanguages¶
-
public Collection<String>
pardonedLanguages
()¶
validate¶
-
public Collection<IMessage>
validate
(MessageBuilder mb)¶
LanguageSpecConfigBuilder¶
-
public class
LanguageSpecConfigBuilder
extends LanguageComponentConfigBuilder implements ILanguageSpecConfigBuilder¶ Configuration-based builder for
ILanguageSpecConfig
objects.
Fields¶
Constructors¶
LanguageSpecConfigBuilder¶
-
public
LanguageSpecConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
Methods¶
addCompileDeps¶
-
public ILanguageSpecConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> dependencies)¶
addExports¶
-
public ILanguageSpecConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶
addGenerates¶
-
public ILanguageSpecConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶
addJavaDeps¶
-
public ILanguageSpecConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addLangContribs¶
-
public ILanguageSpecConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
addPardonedLanguages¶
-
public ILanguageSpecConfigBuilder
addPardonedLanguages
(Iterable<String> languages)¶
addSourceDeps¶
-
public ILanguageSpecConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> dependencies)¶
build¶
-
public ILanguageSpecConfig
build
(FileObject rootFolder)¶
copyFrom¶
-
public ILanguageSpecConfigBuilder
copyFrom
(ILanguageSpecConfig config)¶
reset¶
-
public ILanguageSpecConfigBuilder
reset
()¶
withCompileDeps¶
-
public ILanguageSpecConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> dependencies)¶
withExports¶
-
public ILanguageSpecConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶
withGenerates¶
-
public ILanguageSpecConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶
withIdentifier¶
-
public ILanguageSpecConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶
withJavaDeps¶
-
public ILanguageSpecConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withLangContribs¶
-
public ILanguageSpecConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
withMetaborgVersion¶
-
public ILanguageSpecConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withName¶
-
public ILanguageSpecConfigBuilder
withName
(String name)¶
withPardonedLanguages¶
-
public ILanguageSpecConfigBuilder
withPardonedLanguages
(Iterable<String> languages)¶
withSourceDeps¶
-
public ILanguageSpecConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> dependencies)¶
withUseBuildSystemSpec¶
-
public ILanguageSpecConfigBuilder
withUseBuildSystemSpec
(boolean useBuildSystemSpec)¶
LanguageSpecConfigService¶
-
public class
LanguageSpecConfigService
extends AConfigService<ILanguageSpec, ILanguageSpecConfig> implements ILanguageSpecConfigService, ILanguageSpecConfigWriter¶
Constructors¶
LanguageSpecConfigService¶
-
public
LanguageSpecConfigService
(AConfigurationReaderWriter configReaderWriter, LanguageSpecConfigBuilder configBuilder)¶
Methods¶
fromConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
fromConfig
(ILanguageSpecConfig config)¶
getConfigFile¶
-
protected FileObject
getConfigFile
(FileObject rootFolder)¶
getRootDirectory¶
-
protected FileObject
getRootDirectory
(ILanguageSpec languageSpec)¶
toConfig¶
-
protected ConfigRequest<ILanguageSpecConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶
org.metaborg.meta.core.plugin¶
org.metaborg.meta.core.project¶
ILanguageSpec¶
-
public interface
ILanguageSpec
extends IProject¶ A language specification project. A language specification is compiled into a language implementation.
Methods¶
config¶
-
ILanguageSpecConfig
config
()¶ Gets the configuration of the language specification. The configuration is read only once when this class is instantiated. To get a new configuration, get a new instance of this class.
Returns: Configuration of the language specification.
ILanguageSpecService¶
-
public interface
ILanguageSpecService
¶ Service for getting a language specification.
Methods¶
available¶
get¶
-
ILanguageSpec
get
(IProject project)¶ Gets a language specification from the specified project.
Parameters: - project – The project.
Throws: - ConfigException – When reading language specification configuration fails.
Returns: The language specification, or
null
when the project is not a language specification.
LanguageSpec¶
-
public class
LanguageSpec
extends Project implements ILanguageSpec¶
Constructors¶
LanguageSpec¶
-
public
LanguageSpec
(FileObject location, ILanguageSpecConfig config)¶
Methods¶
config¶
-
public ILanguageSpecConfig
config
()¶
org.metaborg.meta.core.wizard¶
CreateLanguageSpecWizard¶
-
public abstract class
CreateLanguageSpecWizard
extends UpgradeLanguageSpecWizard¶ Helps with the validation and UI of a ‘create language specification’ wizard.
UpgradeLanguageSpecWizard¶
-
public abstract class
UpgradeLanguageSpecWizard
¶ Helps with the validation and UI of an ‘upgrade language specification’ wizard.
Methods¶
languageIdentifier¶
-
public LanguageIdentifier
languageIdentifier
()¶
validate¶
-
public ValidationResult
validate
()¶
Javadoc¶
org.metaborg.spoofax.meta.core¶
SpoofaxExtensionModule¶
-
public class
SpoofaxExtensionModule
extends AbstractModule¶ Module for extending
Spoofax
. Note that this module is loaded together with aSpoofaxModule
, so only those bindings are available. Bindings fromSpoofaxMetaModule
are NOT available. To inject bindings fromSpoofaxMetaModule
, use static injection and request injection in theSpoofaxMetaModule
.
SpoofaxExtensionModulePlugin¶
-
public class
SpoofaxExtensionModulePlugin
implements IServiceModulePlugin¶ Module plugin service provider for
SpoofaxExtensionModule
.
SpoofaxMeta¶
-
public class
SpoofaxMeta
extends MetaBorgMeta¶ Facade for instantiating and accessing the MetaBorg meta API, as an extension of the
MetaBorg
API, instantiated with the Spoofax implementation.
Fields¶
languageSpecConfigService¶
-
public final ISpoofaxLanguageSpecConfigService
languageSpecConfigService
¶
languageSpecService¶
-
public final ISpoofaxLanguageSpecService
languageSpecService
¶
metaBuilder¶
-
public final LanguageSpecBuilder
metaBuilder
¶
Constructors¶
SpoofaxMeta¶
-
public
SpoofaxMeta
(Spoofax spoofax, IModulePluginLoader loader, SpoofaxMetaModule module, Module... additionalModules)¶ Instantiate the MetaBorg meta API, with a Spoofax implementation.
Parameters: - spoofax – MetaBorg API, implemented by Spoofax, to extend.
- loader – Meta-module plugin loader to use.
- module – Spoofax meta-module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
SpoofaxMeta¶
-
public
SpoofaxMeta
(Spoofax spoofax, SpoofaxMetaModule module, Module... additionalModules)¶ Instantiate the MetaBorg meta API, with a Spoofax implementation.
Parameters: - spoofax – MetaBorg API, implemented by Spoofax, to extend.
- module – Spoofax meta-module to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
SpoofaxMeta¶
-
public
SpoofaxMeta
(Spoofax spoofax, IModulePluginLoader loader, Module... additionalModules)¶ Instantiate the MetaBorg meta API, with a Spoofax implementation.
Parameters: - spoofax – MetaBorg API, implemented by Spoofax, to extend.
- loader – Meta-module plugin loader to use.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
SpoofaxMeta¶
-
public
SpoofaxMeta
(Spoofax spoofax, Module... additionalModules)¶ Instantiate the MetaBorg meta API, with a Spoofax implementation.
Parameters: - spoofax – MetaBorg API, implemented by Spoofax, to extend.
- additionalModules – Additional modules to use.
Throws: - MetaborgException – When loading plugins or dependency injection fails.
Methods¶
defaultModule¶
-
protected static SpoofaxMetaModule
defaultModule
()¶
languageSpecConfigBuilder¶
-
public ISpoofaxLanguageSpecConfigBuilder
languageSpecConfigBuilder
()¶ Returns: Fresh language specification configuration builder.
SpoofaxMetaModule¶
-
public class
SpoofaxMetaModule
extends MetaborgMetaModule¶
Methods¶
bindLanguageSpec¶
-
protected void
bindLanguageSpec
()¶ Overrides
MetaborgMetaModule.bindLanguageSpec()
for Spoofax implementation of language specifications.
bindLanguageSpecConfig¶
-
protected void
bindLanguageSpecConfig
()¶ Overrides
MetaborgMetaModule.bindLanguageSpecConfig()
for Spoofax implementation of language specification configuration.
org.metaborg.spoofax.meta.core.ant¶
AntRunner¶
-
public class
AntRunner
implements IAntRunner¶
Constructors¶
AntRunner¶
-
public
AntRunner
(IResourceService resourceService, FileObject antFile, FileObject baseDir, Map<String, String> properties, URL[] classpaths, BuildListener listener)¶
AntRunnerService¶
-
public class
AntRunnerService
implements IAntRunnerService¶
Constructors¶
AntRunnerService¶
-
public
AntRunnerService
(IResourceService resourceService)¶
Methods¶
get¶
-
public IAntRunner
get
(FileObject antFile, FileObject baseDir, Map<String, String> properties, URL[] classpaths, BuildListener listener)¶
IAntRunnerService¶
-
public interface
IAntRunnerService
¶
Methods¶
get¶
-
IAntRunner
get
(FileObject antFile, FileObject baseDir, Map<String, String> properties, URL[] classpaths, BuildListener listener)¶
org.metaborg.spoofax.meta.core.build¶
AConfigBuildStep¶
-
public abstract class
AConfigBuildStep
<T> implements IBuildStep¶
Methods¶
execute¶
-
public void
execute
(LanguageSpecBuildPhase phase, LanguageSpecBuildInput input)¶
execute¶
-
protected abstract void
execute
(T config, LanguageSpecBuildPhase phase, LanguageSpecBuildInput input)¶
AntBuildStep¶
-
public class
AntBuildStep
extends AConfigBuildStep<AntBuildStepConfig>¶
Constructors¶
AntBuildStep¶
-
public
AntBuildStep
(IResourceService resourceService, IAntRunnerService antRunnerService)¶
Methods¶
execute¶
-
protected void
execute
(AntBuildStepConfig config, LanguageSpecBuildPhase phase, LanguageSpecBuildInput input)¶
IBuildStep¶
-
public interface
IBuildStep
¶
Methods¶
execute¶
-
void
execute
(LanguageSpecBuildPhase phase, LanguageSpecBuildInput input)¶ Executes the build step.
Parameters: - phase – Phase in which the build step is executed.
- input – Build input
LanguageSpecBuildInput¶
-
public class
LanguageSpecBuildInput
extends ProjectBuildInput¶ Language specification build input arguments.
Constructors¶
LanguageSpecBuildInput¶
-
public
LanguageSpecBuildInput
(ISpoofaxLanguageSpec languageSpec)¶
Methods¶
languageSpec¶
-
public ISpoofaxLanguageSpec
languageSpec
()¶
LanguageSpecBuilder¶
-
public class
LanguageSpecBuilder
¶
Constructors¶
LanguageSpecBuilder¶
-
public
LanguageSpecBuilder
(Injector injector, IResourceService resourceService, ISourceTextService sourceTextService, ILanguageIdentifierService languageIdentifierService, IDependencyService dependencyService, ILanguagePathService languagePathService, ISpoofaxProcessorRunner runner, Set<IBuildStep> buildSteps, ILanguageComponentConfigBuilder componentConfigBuilder, ILanguageComponentConfigWriter componentConfigWriter)¶
Methods¶
archive¶
-
public FileObject
archive
(LanguageSpecBuildInput input)¶
clean¶
-
public void
clean
(LanguageSpecBuildInput input)¶
compile¶
-
public void
compile
(LanguageSpecBuildInput input)¶
generateSources¶
-
public void
generateSources
(LanguageSpecBuildInput input, IFileAccess access)¶
initialize¶
-
public void
initialize
(LanguageSpecBuildInput input)¶
pkg¶
-
public void
pkg
(LanguageSpecBuildInput input)¶
SpoofaxLangSpecCommonPaths¶
-
public class
SpoofaxLangSpecCommonPaths
extends SpoofaxCommonPaths¶
Constructors¶
SpoofaxLangSpecCommonPaths¶
-
public
SpoofaxLangSpecCommonPaths
(FileObject root)¶
Methods¶
dsTargetClassesGenerateDir¶
-
public FileObject
dsTargetClassesGenerateDir
()¶ Returns: Target output directory for compiled generated DynSem interpreter classes.
dsTargetClassesManualDir¶
-
public FileObject
dsTargetClassesManualDir
()¶ Returns: Target output directory for compiled manual DynSem interpreter classes.
javaSrcDirs¶
-
public Collection<FileObject>
javaSrcDirs
(String languageId)¶
plutoBuildInfoDir¶
-
public FileObject
plutoBuildInfoDir
()¶ Returns: Target output directory for pluto build information.
strSrcGenJavaTransDir¶
-
public FileObject
strSrcGenJavaTransDir
(String languageId)¶ Returns: Generated Stratego Java directory, generated from Stratego definition.
strTargetClassesJavaStratDir¶
-
public FileObject
strTargetClassesJavaStratDir
(String languageId)¶ Parameters: - languageId – Identifier of the language.
Returns: Target output directory for compiled Stratego Java strategy classes.
strTargetClassesTransDir¶
-
public FileObject
strTargetClassesTransDir
(String languageId)¶ Returns: Target output directory for compiled Stratego Java classes.
targetClassesDir¶
-
public FileObject
targetClassesDir
()¶ Returns: Target output directory for compiled Java classes.
targetTestClassesDir¶
-
public FileObject
targetTestClassesDir
()¶ Returns: Target output directory for compiled Java classes.
StrategoBuildStep¶
-
public class
StrategoBuildStep
extends AConfigBuildStep<StrategoBuildStepConfig>¶
Constructors¶
StrategoBuildStep¶
-
public
StrategoBuildStep
(IResourceService resourceService)¶
Methods¶
execute¶
-
protected void
execute
(StrategoBuildStepConfig config, LanguageSpecBuildPhase phase, LanguageSpecBuildInput input)¶
org.metaborg.spoofax.meta.core.config¶
AntBuildStepConfig¶
-
public class
AntBuildStepConfig
implements IBuildStepConfig¶
Fields¶
phase¶
-
public final LanguageSpecBuildPhase
phase
¶
Constructors¶
AntBuildStepConfig¶
-
public
AntBuildStepConfig
(LanguageSpecBuildPhase phase, String file, String target)¶
Methods¶
accept¶
-
public void
accept
(IBuildStepVisitor visitor)¶
accept¶
-
public void
accept
(IBuildStepVisitor visitor, LanguageSpecBuildPhase phase)¶
phase¶
-
public LanguageSpecBuildPhase
phase
()¶
IBuildStepConfig¶
-
public interface
IBuildStepConfig
extends Serializable¶ Configuration for additional build steps. Use the visitor pattern access implementations.
Methods¶
accept¶
-
void
accept
(IBuildStepVisitor visitor)¶ Accepts a build step visitor.
Parameters: - visitor – Visitor to accept.
accept¶
-
void
accept
(IBuildStepVisitor visitor, LanguageSpecBuildPhase phase)¶ Accepts a build step visitor, only visiting configurations for given phase.
Parameters: - visitor – Visitor to accept.
- phase – Phase of build step configurations to visit.
phase¶
-
LanguageSpecBuildPhase
phase
()¶ Returns: The phase in which the build step is configured to run.
IBuildStepVisitor¶
-
public interface
IBuildStepVisitor
¶ Visitor for
IBuildStepConfig
s.
Methods¶
visit¶
-
void
visit
(StrategoBuildStepConfig buildStep)¶ Visit a Stratego build step configuration.
Parameters: - buildStep – Stratego build step configuration
visit¶
-
void
visit
(AntBuildStepConfig buildStep)¶ Visit an Ant build step configuration.
Parameters: - buildStep – Ant build step configuration.
ISpoofaxLanguageSpecConfig¶
-
public interface
ISpoofaxLanguageSpecConfig
extends ISpoofaxProjectConfig, ILanguageSpecConfig¶ Spoofax-specific configuration for a language specification. To create a new instance of this interface, use the
ILanguageSpecConfigBuilder
interface.
Methods¶
buildSteps¶
-
Collection<IBuildStepConfig>
buildSteps
()¶ Gets additional build step configurations.
Returns: Additional build step configurations.
placeholderChars¶
-
PlaceholderCharacters
placeholderChars
()¶ Gets the Placeholder fences.
Returns: Placeholder fences
prettyPrintLanguage¶
sdfMainFile¶
sdfMetaFiles¶
sdfVersion¶
-
SdfVersion
sdfVersion
()¶ Gets the SDF version to use.
Returns: Sdf version to use.
strBuildSetting¶
-
StrategoBuildSetting
strBuildSetting
()¶ Gets the project artifact build setting.
Returns: A member of the StrategoBuildSetting
enumeration.
strExternalJarFlags¶
strFormat¶
-
StrategoFormat
strFormat
()¶ Gets the project artifact format.
Returns: A member of the StrategoFormat
enumeration.
ISpoofaxLanguageSpecConfigBuilder¶
-
public interface
ISpoofaxLanguageSpecConfigBuilder
extends ILanguageSpecConfigBuilder¶ Builder for
ISpoofaxLanguageSpecConfig
objects.
Methods¶
addBuildSteps¶
-
ISpoofaxLanguageSpecConfigBuilder
addBuildSteps
(Iterable<IBuildStepConfig> buildSteps)¶ Adds build step configurations.
Parameters: - buildSteps – Build step configurations.
Returns: This builder.
addCompileDeps¶
-
ISpoofaxLanguageSpecConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> dependencies)¶
addExports¶
-
ISpoofaxLanguageSpecConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶
addGenerates¶
-
ISpoofaxLanguageSpecConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶
addLangContribs¶
-
ISpoofaxLanguageSpecConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
addPardonedLanguages¶
-
ISpoofaxLanguageSpecConfigBuilder
addPardonedLanguages
(Iterable<String> languages)¶
addSourceDeps¶
-
ISpoofaxLanguageSpecConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> dependencies)¶
build¶
-
ISpoofaxLanguageSpecConfig
build
(FileObject rootFolder)¶ Builds the object.
Parameters: - rootFolder – The root folder.
Throws: - IllegalStateException – The builder state is not valid, i.e.
isValid()
returnedfalse
.
Returns: The built object.
copyFrom¶
-
ISpoofaxLanguageSpecConfigBuilder
copyFrom
(ISpoofaxLanguageSpecConfig obj)¶ Copies the values from the specified object.
Parameters: - obj – The object to copy values from.
reset¶
withBuildSteps¶
-
ISpoofaxLanguageSpecConfigBuilder
withBuildSteps
(Iterable<IBuildStepConfig> buildSteps)¶ Sets the build step configurations.
Parameters: - buildSteps – Build step configurations.
Returns: This builder.
withCompileDeps¶
-
ISpoofaxLanguageSpecConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> dependencies)¶
withExports¶
-
ISpoofaxLanguageSpecConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶
withGenerates¶
-
ISpoofaxLanguageSpecConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶
withIdentifier¶
-
ISpoofaxLanguageSpecConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶
withLangContribs¶
-
ISpoofaxLanguageSpecConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
withMetaborgVersion¶
-
ISpoofaxLanguageSpecConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withNaBL2Config¶
-
ISpoofaxLanguageSpecConfigBuilder
withNaBL2Config
(NaBL2Config config)¶ {@see ISpoofaxProjectConfigBuilder#withNaBL2Config(NaBL2Config)}
withName¶
-
ISpoofaxLanguageSpecConfigBuilder
withName
(String name)¶
withPardonedLanguages¶
-
ISpoofaxLanguageSpecConfigBuilder
withPardonedLanguages
(Iterable<String> languages)¶
withPlaceholderPostfix¶
-
ISpoofaxLanguageSpecConfigBuilder
withPlaceholderPostfix
(String placeholderPostfix)¶ Sets the placeholder postfix.
Parameters: - placeholderPostfix – The placeholder postfix.
Returns: This builder.
withPlaceholderPrefix¶
-
ISpoofaxLanguageSpecConfigBuilder
withPlaceholderPrefix
(String placeholderPrefix)¶ Sets the placeholder prefix.
Parameters: - placeholderPrefix – The placeholder prefix.
Returns: This builder.
withPrettyPrintLanguage¶
-
ISpoofaxLanguageSpecConfigBuilder
withPrettyPrintLanguage
(String prettyPrintLanguage)¶ Sets the language to be pretty printed.
Parameters: - prettyPrintLanguage – The language to be pretty printed.
Returns: This builder.
withSdfArgs¶
-
ISpoofaxLanguageSpecConfigBuilder
withSdfArgs
(Arguments args)¶ Sets the SDF arguments.
Parameters: - args – An iterable of SDF arguments.
Returns: This builder.
withSdfExternalDef¶
-
ISpoofaxLanguageSpecConfigBuilder
withSdfExternalDef
(String def)¶ Sets the external def.
Parameters: - def – The external def.
Returns: This builder.
withSdfMainFile¶
-
ISpoofaxLanguageSpecConfigBuilder
withSdfMainFile
(String sdfMainFile)¶ Sets the path to the main SDF file.
Parameters: - sdfMainFile – The path to the main SDF file.
Returns: This builder.
withSdfMetaFiles¶
-
ISpoofaxLanguageSpecConfigBuilder
withSdfMetaFiles
(List<String> sdfMetaFiles)¶ Sets the name of SDF meta files.
Parameters: - sdfMetaFile – The name of the SDF meta files.
Returns: This builder.
withSdfVersion¶
-
ISpoofaxLanguageSpecConfigBuilder
withSdfVersion
(SdfVersion sdfversion)¶ Sets the SDF version.
Parameters: - sdfVersion – The SDF version.
Returns: This builder.
withSourceDeps¶
-
ISpoofaxLanguageSpecConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> dependencies)¶
withStrArgs¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrArgs
(Arguments args)¶ Sets the Stratego arguments.
Parameters: - args – The Stratego arguments.
Returns: This builder.
withStrBuildSetting¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrBuildSetting
(StrategoBuildSetting format)¶ Sets the project artifact format.
Parameters: - format – A member of the
StrategoBuildSetting
enumeration.
Returns: This builder.
- format – A member of the
withStrExternalJar¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrExternalJar
(String jar)¶ Sets the external JAR.
Parameters: - jar – The external JAR.
Returns: This builder.
withStrExternalJarFlags¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrExternalJarFlags
(String flags)¶ Sets the external JAR flags.
Parameters: - flags – The external JAR flags.
Returns: This builder.
withStrFormat¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrFormat
(StrategoFormat format)¶ Sets the project artifact format.
Parameters: - format – A member of the
StrategoFormat
enumeration.
Returns: This builder.
- format – A member of the
withStrTypesmart¶
-
ISpoofaxLanguageSpecConfigBuilder
withStrTypesmart
(boolean typesmart)¶ Sets the Stratego typesmart property.
Parameters: - args – The Stratego typesmart property.
Returns: This builder.
withTypesmart¶
-
ISpoofaxLanguageSpecConfigBuilder
withTypesmart
(boolean typesmart)¶ {@see ISpoofaxProjectConfigBuilder#withTypesmart(boolean)}
withUseBuildSystemSpec¶
-
ISpoofaxLanguageSpecConfigBuilder
withUseBuildSystemSpec
(boolean useBuildSystemSpec)¶
ISpoofaxLanguageSpecConfigService¶
-
public interface
ISpoofaxLanguageSpecConfigService
extends ILanguageSpecConfigService¶ Stores and retrieves Spoofax language specification configurations.
Methods¶
available¶
-
boolean
available
(FileObject rootFolder)¶ Checks if a configuration exists for the Spoofax language specification at the given location.
Parameters: - rootFolder – The language specification root folder.
Throws: - IOException – When location the configuration fails.
Returns: True if a configuration exists, false otherwise.
get¶
-
ConfigRequest<ISpoofaxLanguageSpecConfig>
get
(FileObject rootFolder)¶ Gets the configuration for the Spoofax language specification at the given location.
Parameters: - rootFolder – The language specification root folder.
Returns: Configuration request, either with a valid configuration, or a collection of error messages.
ISpoofaxLanguageSpecConfigWriter¶
-
public interface
ISpoofaxLanguageSpecConfigWriter
¶ Writes a configuration for the specified
ILanguageSpec
.
Methods¶
exists¶
-
boolean
exists
(ILanguageSpec languageSpec)¶ Checks if a configuration file already exists for given language specification project.
Parameters: - languageSpec – Language specification project.
Returns: True if configuration file exists, false otherwise.
write¶
-
void
write
(ILanguageSpec languageSpec, ISpoofaxLanguageSpecConfig config, IFileAccess access)¶ Writes the specified configuration for the specified language specification.
Parameters: - languageSpec – The language specification.
- config – The configuration to write.
- access –
LanguageSpecBuildPhase¶
-
public enum
LanguageSpecBuildPhase
¶
Enum Constants¶
clean¶
-
public static final LanguageSpecBuildPhase
clean
¶
compile¶
-
public static final LanguageSpecBuildPhase
compile
¶
generateSources¶
-
public static final LanguageSpecBuildPhase
generateSources
¶
initialize¶
-
public static final LanguageSpecBuildPhase
initialize
¶
pkg¶
-
public static final LanguageSpecBuildPhase
pkg
¶
SdfVersion¶
-
public enum
SdfVersion
¶
Enum Constants¶
sdf2¶
-
public static final SdfVersion
sdf2
¶
sdf3¶
-
public static final SdfVersion
sdf3
¶
SpoofaxLanguageSpecConfig¶
-
public class
SpoofaxLanguageSpecConfig
extends LanguageSpecConfig implements ISpoofaxLanguageSpecConfig¶ An implementation of the
ISpoofaxLanguageSpecConfig
interface that is backed by anImmutableConfiguration
object.
Constructors¶
SpoofaxLanguageSpecConfig¶
-
public
SpoofaxLanguageSpecConfig
(HierarchicalConfiguration<ImmutableNode> config, SpoofaxProjectConfig projectConfig)¶
SpoofaxLanguageSpecConfig¶
-
protected
SpoofaxLanguageSpecConfig
(HierarchicalConfiguration<ImmutableNode> config, SpoofaxProjectConfig projectConfig, LanguageIdentifier id, String name, Collection<LanguageContributionIdentifier> langContribs, Collection<IGenerateConfig> generates, Collection<IExportConfig> exports, Collection<String> pardonedLanguages, Boolean useBuildSystemSpec, SdfVersion sdfVersion, Boolean sdfEnabled, Sdf2tableVersion sdf2tableVersion, Boolean dataDependent, String parseTable, String completionsParseTable, JSGLRVersion jsglrVersion, String sdfMainFile, PlaceholderCharacters placeholderCharacters, String prettyPrint, List<String> sdfMetaFile, String externalDef, Arguments sdfArgs, StrategoBuildSetting buildSetting, StrategoFormat format, String externalJar, String externalJarFlags, Arguments strategoArgs, Collection<IBuildStepConfig> buildSteps)¶
Methods¶
buildSteps¶
-
public Collection<IBuildStepConfig>
buildSteps
()¶
placeholderChars¶
-
public PlaceholderCharacters
placeholderChars
()¶
sdfVersion¶
-
public SdfVersion
sdfVersion
()¶
strBuildSetting¶
-
public StrategoBuildSetting
strBuildSetting
()¶
strFormat¶
-
public StrategoFormat
strFormat
()¶
validate¶
-
public Collection<IMessage>
validate
(MessageBuilder mb)¶
SpoofaxLanguageSpecConfigBuilder¶
-
public class
SpoofaxLanguageSpecConfigBuilder
extends LanguageSpecConfigBuilder implements ISpoofaxLanguageSpecConfigBuilder¶ Configuration-based builder for
ILanguageSpecConfig
objects.
Fields¶
buildSteps¶
-
protected Collection<IBuildStepConfig>
buildSteps
¶
placeholderCharacters¶
-
protected PlaceholderCharacters
placeholderCharacters
¶
projectConfigBuilder¶
-
protected final SpoofaxProjectConfigBuilder
projectConfigBuilder
¶
sdfVersion¶
-
protected SdfVersion
sdfVersion
¶
strBuildSetting¶
-
protected StrategoBuildSetting
strBuildSetting
¶
strFormat¶
-
protected StrategoFormat
strFormat
¶
Constructors¶
SpoofaxLanguageSpecConfigBuilder¶
-
public
SpoofaxLanguageSpecConfigBuilder
(AConfigurationReaderWriter configReaderWriter)¶
Methods¶
addBuildSteps¶
-
public ISpoofaxLanguageSpecConfigBuilder
addBuildSteps
(Iterable<IBuildStepConfig> buildSteps)¶
addCompileDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
addCompileDeps
(Iterable<LanguageIdentifier> deps)¶
addExports¶
-
public ISpoofaxLanguageSpecConfigBuilder
addExports
(Iterable<IExportConfig> exports)¶
addGenerates¶
-
public ISpoofaxLanguageSpecConfigBuilder
addGenerates
(Iterable<IGenerateConfig> generates)¶
addJavaDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
addJavaDeps
(Iterable<LanguageIdentifier> deps)¶
addLangContribs¶
-
public ISpoofaxLanguageSpecConfigBuilder
addLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
addPardonedLanguages¶
-
public ISpoofaxLanguageSpecConfigBuilder
addPardonedLanguages
(Iterable<String> languages)¶
addSourceDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
addSourceDeps
(Iterable<LanguageIdentifier> deps)¶
build¶
-
public ISpoofaxLanguageSpecConfig
build
(FileObject rootFolder)¶
copyFrom¶
-
public ISpoofaxLanguageSpecConfigBuilder
copyFrom
(ISpoofaxLanguageSpecConfig config)¶
reset¶
-
public ISpoofaxLanguageSpecConfigBuilder
reset
()¶
withBuildSteps¶
-
public ISpoofaxLanguageSpecConfigBuilder
withBuildSteps
(Iterable<IBuildStepConfig> buildSteps)¶
withCompileDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
withCompileDeps
(Iterable<LanguageIdentifier> deps)¶
withExports¶
-
public ISpoofaxLanguageSpecConfigBuilder
withExports
(Iterable<IExportConfig> exports)¶
withGenerates¶
-
public ISpoofaxLanguageSpecConfigBuilder
withGenerates
(Iterable<IGenerateConfig> generates)¶
withIdentifier¶
-
public ISpoofaxLanguageSpecConfigBuilder
withIdentifier
(LanguageIdentifier identifier)¶
withJavaDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
withJavaDeps
(Iterable<LanguageIdentifier> deps)¶
withLangContribs¶
-
public ISpoofaxLanguageSpecConfigBuilder
withLangContribs
(Iterable<LanguageContributionIdentifier> contribs)¶
withMetaborgVersion¶
-
public ISpoofaxLanguageSpecConfigBuilder
withMetaborgVersion
(String metaborgVersion)¶
withNaBL2Config¶
-
public ISpoofaxLanguageSpecConfigBuilder
withNaBL2Config
(NaBL2Config config)¶
withName¶
-
public ISpoofaxLanguageSpecConfigBuilder
withName
(String name)¶
withPardonedLanguages¶
-
public ISpoofaxLanguageSpecConfigBuilder
withPardonedLanguages
(Iterable<String> languages)¶
withPlaceholderPostfix¶
-
public ISpoofaxLanguageSpecConfigBuilder
withPlaceholderPostfix
(String placeholderPostfix)¶
withPlaceholderPrefix¶
-
public ISpoofaxLanguageSpecConfigBuilder
withPlaceholderPrefix
(String placeholderPrefix)¶
withPrettyPrintLanguage¶
-
public ISpoofaxLanguageSpecConfigBuilder
withPrettyPrintLanguage
(String prettyPrintLanguage)¶
withSdfArgs¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSdfArgs
(Arguments args)¶
withSdfExternalDef¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSdfExternalDef
(String def)¶
withSdfMainFile¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSdfMainFile
(String sdfMainFile)¶
withSdfMetaFiles¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSdfMetaFiles
(List<String> sdfMetaFile)¶
withSdfVersion¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSdfVersion
(SdfVersion sdfVersion)¶
withSourceDeps¶
-
public ISpoofaxLanguageSpecConfigBuilder
withSourceDeps
(Iterable<LanguageIdentifier> deps)¶
withStrArgs¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrArgs
(Arguments args)¶
withStrBuildSetting¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrBuildSetting
(StrategoBuildSetting buildSetting)¶
withStrExternalJar¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrExternalJar
(String jar)¶
withStrExternalJarFlags¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrExternalJarFlags
(String flags)¶
withStrFormat¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrFormat
(StrategoFormat format)¶
withStrTypesmart¶
-
public ISpoofaxLanguageSpecConfigBuilder
withStrTypesmart
(boolean typesmart)¶
withTypesmart¶
-
public ISpoofaxLanguageSpecConfigBuilder
withTypesmart
(boolean typesmart)¶
withUseBuildSystemSpec¶
-
public ISpoofaxLanguageSpecConfigBuilder
withUseBuildSystemSpec
(boolean useBuildSystemSpec)¶
SpoofaxLanguageSpecConfigService¶
-
public class
SpoofaxLanguageSpecConfigService
extends AConfigService<ILanguageSpec, ISpoofaxLanguageSpecConfig> implements ISpoofaxLanguageSpecConfigService, ISpoofaxLanguageSpecConfigWriter¶
Constructors¶
SpoofaxLanguageSpecConfigService¶
-
public
SpoofaxLanguageSpecConfigService
(AConfigurationReaderWriter configReaderWriter, SpoofaxLanguageSpecConfigBuilder configBuilder)¶
Methods¶
exists¶
-
public boolean
exists
(ILanguageSpec languageSpec)¶
fromConfig¶
-
protected HierarchicalConfiguration<ImmutableNode>
fromConfig
(ISpoofaxLanguageSpecConfig config)¶
getConfigFile¶
-
protected FileObject
getConfigFile
(FileObject rootFolder)¶
getRootDirectory¶
-
protected FileObject
getRootDirectory
(ILanguageSpec languageSpec)¶
toConfig¶
-
protected ConfigRequest<ISpoofaxLanguageSpecConfig>
toConfig
(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile)¶
StrategoBuildSetting¶
-
public enum
StrategoBuildSetting
¶
Enum Constants¶
batch¶
-
public static final StrategoBuildSetting
batch
¶
incremental¶
-
public static final StrategoBuildSetting
incremental
¶
StrategoBuildStepConfig¶
-
public class
StrategoBuildStepConfig
implements IBuildStepConfig¶
Fields¶
phase¶
-
public final LanguageSpecBuildPhase
phase
¶
Constructors¶
Methods¶
accept¶
-
public void
accept
(IBuildStepVisitor visitor)¶
accept¶
-
public void
accept
(IBuildStepVisitor visitor, LanguageSpecBuildPhase phase)¶
phase¶
-
public LanguageSpecBuildPhase
phase
()¶
StrategoFormat¶
-
public enum
StrategoFormat
¶
Enum Constants¶
ctree¶
-
public static final StrategoFormat
ctree
¶
jar¶
-
public static final StrategoFormat
jar
¶
org.metaborg.spoofax.meta.core.generator¶
BaseGenerator¶
-
public abstract class
BaseGenerator
¶
Fields¶
writer¶
-
protected final MustacheWriter
writer
¶
Constructors¶
BaseGenerator¶
-
public
BaseGenerator
(GeneratorSettings scope, IFileAccess access)¶
BaseGenerator¶
-
public
BaseGenerator
(GeneratorSettings scope)¶
GeneratorSettings¶
-
public class
GeneratorSettings
¶ Provides the values that can be used in a generator template, e.g. a Mustache template.
Constructors¶
GeneratorSettings¶
-
public
GeneratorSettings
(FileObject location, ISpoofaxLanguageSpecConfig config)¶
GeneratorSettings¶
-
public
GeneratorSettings
(FileObject location, ISpoofaxLanguageSpecConfig config, AnalysisType analysisType)¶
Methods¶
analysisType¶
-
public AnalysisType
analysisType
()¶
format¶
-
public StrategoFormat
format
()¶
location¶
-
public FileObject
location
()¶
org.metaborg.spoofax.meta.core.generator.eclipse¶
EclipseFeatureGenerator¶
-
public class
EclipseFeatureGenerator
extends BaseGenerator¶
Constructors¶
EclipseFeatureGenerator¶
-
public
EclipseFeatureGenerator
(GeneratorSettings scope, IFileAccess access)¶
EclipseFeatureGenerator¶
-
public
EclipseFeatureGenerator
(GeneratorSettings scope)¶
Methods¶
EclipseLangSpecGenerator¶
-
public class
EclipseLangSpecGenerator
extends BaseGenerator¶ Generates Eclipse support files for language specification projects.
Constructors¶
EclipseLangSpecGenerator¶
-
public
EclipseLangSpecGenerator
(GeneratorSettings settings, IFileAccess access)¶
EclipseLangSpecGenerator¶
-
public
EclipseLangSpecGenerator
(GeneratorSettings settings)¶
EclipsePluginGenerator¶
-
public class
EclipsePluginGenerator
extends BaseGenerator¶ Generates a companion Eclipse plugin project for a language specification project, that lifts the language implementation built from the language specification project into an Eclipse plugin that can be installed into Eclipse.
Constructors¶
EclipsePluginGenerator¶
-
public
EclipsePluginGenerator
(GeneratorSettings scope, IFileAccess access)¶
EclipsePluginGenerator¶
-
public
EclipsePluginGenerator
(GeneratorSettings scope)¶
Methods¶
EclipseSiteGenerator¶
-
public class
EclipseSiteGenerator
extends BaseGenerator¶
Constructors¶
EclipseSiteGenerator¶
-
public
EclipseSiteGenerator
(GeneratorSettings scope, IFileAccess access)¶
EclipseSiteGenerator¶
-
public
EclipseSiteGenerator
(GeneratorSettings scope)¶
org.metaborg.spoofax.meta.core.generator.general¶
AnalysisType¶
-
public enum
AnalysisType
¶
Enum Constants¶
NaBL2¶
-
public static final AnalysisType
NaBL2
¶
NaBL_TS¶
-
public static final AnalysisType
NaBL_TS
¶
None¶
-
public static final AnalysisType
None
¶
Statix¶
-
public static final AnalysisType
Statix
¶
Stratego¶
-
public static final AnalysisType
Stratego
¶
ContinuousLanguageSpecGenerator¶
-
public class
ContinuousLanguageSpecGenerator
extends BaseGenerator¶ Generates project files which need to be generated after each build. Files are not specific to an IDE.
Constructors¶
ContinuousLanguageSpecGenerator¶
-
public
ContinuousLanguageSpecGenerator
(GeneratorSettings scope, IFileAccess access, boolean sdfEnabled, SdfVersion version)¶
ContinuousLanguageSpecGenerator¶
-
public
ContinuousLanguageSpecGenerator
(GeneratorSettings scope, boolean sdfEnabled, SdfVersion version)¶
LangProjectGenerator¶
-
public class
LangProjectGenerator
extends BaseGenerator¶ Generates a language-specific project.
Constructors¶
LangProjectGenerator¶
-
public
LangProjectGenerator
(GeneratorSettings settings, IFileAccess access)¶
LangProjectGenerator¶
-
public
LangProjectGenerator
(GeneratorSettings settings)¶
Methods¶
LangSpecGenerator¶
-
public class
LangSpecGenerator
extends BaseGenerator¶ Generates language project files that are only generated once when a new language project is created. Files are not specific to an IDE.
Constructors¶
LangSpecGenerator¶
-
public
LangSpecGenerator
(LangSpecGeneratorSettings config)¶
Methods¶
syntaxType¶
-
public SyntaxType
syntaxType
()¶
LangSpecGeneratorSettings¶
-
public class
LangSpecGeneratorSettings
¶
Fields¶
extensions¶
-
public final Collection<String>
extensions
¶
generatorSettings¶
-
public final GeneratorSettings
generatorSettings
¶
syntaxType¶
-
public final SyntaxType
syntaxType
¶
Constructors¶
LangSpecGeneratorSettings¶
-
public
LangSpecGeneratorSettings
(GeneratorSettings generatorSettings, Collection<String> extensions, SyntaxType syntaxType)¶
LangSpecGeneratorSettingsBuilder¶
-
public class
LangSpecGeneratorSettingsBuilder
¶
Fields¶
standardAnalysisType¶
-
public static final AnalysisType
standardAnalysisType
¶
standardSyntaxType¶
-
public static final SyntaxType
standardSyntaxType
¶
Methods¶
build¶
-
public LangSpecGeneratorSettings
build
(FileObject projectLocation, ISpoofaxLanguageSpecConfigBuilder languageSpecConfigBuilder)¶
configureFromPrompt¶
-
public LangSpecGeneratorSettingsBuilder
configureFromPrompt
(Prompter prompter)¶
withAnalysisType¶
-
public LangSpecGeneratorSettingsBuilder
withAnalysisType
(AnalysisType analysisType)¶
withConfig¶
-
public LangSpecGeneratorSettingsBuilder
withConfig
(ISpoofaxLanguageSpecConfig config)¶
withDefaultAnalysisType¶
-
public LangSpecGeneratorSettingsBuilder
withDefaultAnalysisType
(AnalysisType defaultAnalysisType)¶
withDefaultGroupId¶
-
public LangSpecGeneratorSettingsBuilder
withDefaultGroupId
(String defaultGroupId)¶
withDefaultMetaborgVersion¶
-
public LangSpecGeneratorSettingsBuilder
withDefaultMetaborgVersion
(String defaultMetaborgVersion)¶
withDefaultSyntaxType¶
-
public LangSpecGeneratorSettingsBuilder
withDefaultSyntaxType
(SyntaxType defaultSyntaxType)¶
withDefaultVersion¶
-
public LangSpecGeneratorSettingsBuilder
withDefaultVersion
(String defaultVersionString)¶
withExtensions¶
-
public LangSpecGeneratorSettingsBuilder
withExtensions
(Collection<String> extensions)¶
withGroupId¶
-
public LangSpecGeneratorSettingsBuilder
withGroupId
(String groupId)¶
withId¶
-
public LangSpecGeneratorSettingsBuilder
withId
(String id)¶
withMetaborgVersion¶
-
public LangSpecGeneratorSettingsBuilder
withMetaborgVersion
(String metaborgVersion)¶
withName¶
-
public LangSpecGeneratorSettingsBuilder
withName
(String name)¶
withSyntaxType¶
-
public LangSpecGeneratorSettingsBuilder
withSyntaxType
(SyntaxType syntaxType)¶
withVersion¶
-
public LangSpecGeneratorSettingsBuilder
withVersion
(LanguageVersion version)¶
withoutExtensions¶
-
public LangSpecGeneratorSettingsBuilder
withoutExtensions
()¶
LangTestGenerator¶
-
public class
LangTestGenerator
extends BaseGenerator¶ Generates a language-specific project.
Constructors¶
LangTestGenerator¶
-
public
LangTestGenerator
(GeneratorSettings settings, IFileAccess access)¶
LangTestGenerator¶
-
public
LangTestGenerator
(GeneratorSettings settings)¶
SyntaxType¶
-
public enum
SyntaxType
¶
Enum Constants¶
None¶
-
public static final SyntaxType
None
¶
SDF2¶
-
public static final SyntaxType
SDF2
¶
SDF3¶
-
public static final SyntaxType
SDF3
¶
org.metaborg.spoofax.meta.core.pluto¶
SpoofaxBuilder¶
-
public abstract class
SpoofaxBuilder
<In extends SpoofaxInput, Out extends Output> extends Builder<In, Out> implements IFileAccess¶
Fields¶
context¶
-
protected final SpoofaxContext
context
¶
paths¶
-
protected transient SpoofaxLangSpecCommonPaths
paths
¶
Methods¶
newResourceTracker¶
-
protected ResourceAgentTracker
newResourceTracker
(String... excludePatterns)¶
read¶
-
public void
read
(FileObject file)¶
toFile¶
-
protected File
toFile
(FileObject fileObject)¶
toFileReplicate¶
-
protected File
toFileReplicate
(FileObject fileObject)¶
write¶
-
public void
write
(FileObject file)¶
SpoofaxBuilderFactory¶
-
public interface
SpoofaxBuilderFactory
<In extends SpoofaxInput, Out extends Output, B extends Builder<In, Out>> extends BuilderFactory<In, Out, B>¶
SpoofaxBuilderFactoryFactory.GeneratedSpoofaxBuilderFactory¶
-
class
GeneratedSpoofaxBuilderFactory
implements SpoofaxBuilderFactory<In, Out, B>¶
Methods¶
isOverlappingGeneratedFileCompatible¶
-
public boolean
isOverlappingGeneratedFileCompatible
(File overlap, Serializable input, BuilderFactory<?, ?, ?> otherFactory, Serializable otherInput)¶
SpoofaxContext¶
-
public class
SpoofaxContext
implements Serializable¶
Fields¶
base¶
-
public transient FileObject
base
¶
languageSpec¶
-
public transient ISpoofaxLanguageSpec
languageSpec
¶
Constructors¶
SpoofaxContext¶
-
public
SpoofaxContext
(FileObject baseDir, FileObject depDir)¶
Methods¶
contextService¶
-
public IContextService
contextService
()¶
dialectService¶
-
public IDialectService
dialectService
()¶
languageIdentifierService¶
-
public ILanguageIdentifierService
languageIdentifierService
()¶
languagePathService¶
-
public ILanguagePathService
languagePathService
()¶
languageService¶
-
public ILanguageService
languageService
()¶
newResourceTracker¶
-
public ResourceAgentTracker
newResourceTracker
(String... excludePatterns)¶
resourceService¶
-
public IResourceService
resourceService
()¶
sourceTextService¶
-
public ISourceTextService
sourceTextService
()¶
strategoCommon¶
-
public IStrategoCommon
strategoCommon
()¶
syntaxService¶
-
public ISpoofaxSyntaxService
syntaxService
()¶
termFactoryService¶
-
public ITermFactoryService
termFactoryService
()¶
toFile¶
-
public File
toFile
(FileObject fileObject)¶
toFileReplicate¶
-
public File
toFileReplicate
(FileObject fileObject)¶
transformService¶
-
public ISpoofaxTransformService
transformService
()¶
unitService¶
-
public ISpoofaxUnitService
unitService
()¶
SpoofaxInput¶
-
public class
SpoofaxInput
implements Serializable¶
Fields¶
context¶
-
public final SpoofaxContext
context
¶
Constructors¶
SpoofaxInput¶
-
public
SpoofaxInput
(SpoofaxContext context)¶
SpoofaxReporting¶
-
public class
SpoofaxReporting
implements IReporting¶
Methods¶
buildRequirement¶
-
public <O extends Output> void
buildRequirement
(BuildRequest<?, O, ?, ?> req)¶
canceledBuilderCycle¶
-
public <O extends Output> void
canceledBuilderCycle
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit, BuildCycleException t)¶
canceledBuilderException¶
-
public <O extends Output> void
canceledBuilderException
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit, Throwable t)¶
canceledBuilderFailure¶
-
public <O extends Output> void
canceledBuilderFailure
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit)¶
canceledBuilderInterrupt¶
-
public <O extends Output> void
canceledBuilderInterrupt
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit)¶
canceledBuilderRequiredBuilderFailed¶
-
public <O extends Output> void
canceledBuilderRequiredBuilderFailed
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit, RequiredBuilderFailed e)¶
cancelledBuildCycleException¶
finishedBuildCycle¶
finishedBuildRequirement¶
-
public <O extends Output> void
finishedBuildRequirement
(BuildRequest<?, O, ?, ?> req)¶
finishedBuilder¶
-
public <O extends Output> void
finishedBuilder
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit)¶
messageFromBuilder¶
skippedBuilder¶
-
public <O extends Output> void
skippedBuilder
(BuildRequest<?, O, ?, ?> req, BuildUnit<O> unit)¶
startedBuilder¶
-
public <O extends Output> void
startedBuilder
(BuildRequest<?, O, ?, ?> req, Builder<?, ?> b, BuildUnit<O> oldUnit, Set<BuildReason> reasons)¶
org.metaborg.spoofax.meta.core.pluto.build¶
MakePermissive¶
-
public class
MakePermissive
extends SpoofaxBuilder<MakePermissive.Input, OutputPersisted<File>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputPersisted<File>, MakePermissive>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputPersisted<File>, MakePermissive, SpoofaxBuilderFactory<Input, OutputPersisted<File>, MakePermissive>>
request
(Input input)¶
PackSdf¶
-
public class
PackSdf
extends SpoofaxBuilder<PackSdf.Input, OutputPersisted<File>>¶
Fields¶
Methods¶
Rtg2Sig¶
-
public class
Rtg2Sig
extends SpoofaxBuilder<Rtg2Sig.Input, OutputPersisted<File>>¶
Fields¶
Methods¶
Sdf2Parenthesize¶
-
public class
Sdf2Parenthesize
extends SpoofaxBuilder<Sdf2Parenthesize.Input, OutputPersisted<File>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputPersisted<File>, Sdf2Parenthesize>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputPersisted<File>, Sdf2Parenthesize, SpoofaxBuilderFactory<Input, OutputPersisted<File>, Sdf2Parenthesize>>
request
(Input input)¶
Sdf2ParenthesizeLegacy¶
-
public class
Sdf2ParenthesizeLegacy
extends SpoofaxBuilder<Sdf2ParenthesizeLegacy.Input, None>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, None, Sdf2ParenthesizeLegacy>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, None, Sdf2ParenthesizeLegacy, SpoofaxBuilderFactory<Input, None, Sdf2ParenthesizeLegacy>>
request
(Input input)¶
Sdf2Rtg¶
-
public class
Sdf2Rtg
extends SpoofaxBuilder<Sdf2Rtg.Input, OutputPersisted<File>>¶
Fields¶
Methods¶
Sdf2Table¶
-
public class
Sdf2Table
extends SpoofaxBuilder<Sdf2Table.Input, OutputPersisted<File>>¶
Fields¶
Methods¶
Sdf2TableLegacy¶
-
public class
Sdf2TableLegacy
extends SpoofaxBuilder<Sdf2TableLegacy.Input, OutputPersisted<File>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputPersisted<File>, Sdf2TableLegacy>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputPersisted<File>, Sdf2TableLegacy, SpoofaxBuilderFactory<Input, OutputPersisted<File>, Sdf2TableLegacy>>
request
(Input input)¶
StrIncr¶
-
public class
StrIncr
extends SpoofaxBuilder<StrIncr.Input, None>¶
Methods¶
request¶
-
public static BuildRequest
request
(Input input)¶
StrIncr.BuildRequest¶
StrIncrBackEnd¶
-
public class
StrIncrBackEnd
extends SpoofaxBuilder<StrIncrBackEnd.Input, None>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, None, StrIncrBackEnd>
factory
¶
StrIncrBackEnd.BuildRequest¶
-
public static class
BuildRequest
extends build.pluto.builder.BuildRequest<Input, None, StrIncrBackEnd, SpoofaxBuilderFactory<Input, None, StrIncrBackEnd>>¶
Constructors¶
BuildRequest¶
-
public
BuildRequest
(SpoofaxBuilderFactory<Input, None, StrIncrBackEnd> factory, Input input)¶
StrIncrBackEnd.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
strategyContributions¶
-
public final Collection<File>
strategyContributions
¶
StrIncrFrontEnd¶
-
public class
StrIncrFrontEnd
extends SpoofaxBuilder<StrIncrFrontEnd.Input, StrIncrFrontEnd.Output>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, Output, StrIncrFrontEnd>
factory
¶
Methods¶
request¶
-
public static BuildRequest
request
(Input input)¶
runStrategoCompileBuilder¶
-
public IStrategoTerm
runStrategoCompileBuilder
(FileObject resource, String projectName)¶
StrIncrFrontEnd.BuildRequest¶
-
public static class
BuildRequest
extends build.pluto.builder.BuildRequest<Input, Output, StrIncrFrontEnd, SpoofaxBuilderFactory<Input, Output, StrIncrFrontEnd>>¶
Constructors¶
BuildRequest¶
-
public
BuildRequest
(SpoofaxBuilderFactory<Input, Output, StrIncrFrontEnd> factory, Input input)¶
StrIncrFrontEnd.Import¶
-
public static class
Import
implements Serializable¶
Fields¶
importType¶
-
public final ImportType
importType
¶
Constructors¶
Import¶
-
protected
Import
(ImportType importType, String importString)¶
Methods¶
StrIncrFrontEnd.Import.ImportType¶
-
public static enum
ImportType
¶
Enum Constants¶
normal¶
-
public static final StrIncrFrontEnd.Import.ImportType
normal
¶
wildcard¶
-
public static final StrIncrFrontEnd.Import.ImportType
wildcard
¶
StrIncrFrontEnd.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
org.metaborg.spoofax.meta.core.pluto.build.main¶
ArchiveBuilder¶
-
public class
ArchiveBuilder
extends SpoofaxBuilder<ArchiveBuilder.Input, OutputTransient<File>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputTransient<File>, ArchiveBuilder>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputTransient<File>, ArchiveBuilder, SpoofaxBuilderFactory<Input, OutputTransient<File>, ArchiveBuilder>>
request
(Input input)¶
ArchiveBuilder.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
exports¶
-
public final Iterable<IExportConfig>
exports
¶
languageIdentifier¶
-
public final LanguageIdentifier
languageIdentifier
¶
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context, Origin origin, Iterable<IExportConfig> exports, LanguageIdentifier languageIdentifier)¶
GenerateSourcesBuilder¶
-
public class
GenerateSourcesBuilder
extends SpoofaxBuilder<GenerateSourcesBuilder.Input, None>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, None, GenerateSourcesBuilder>
factory
¶
Methods¶
build¶
-
public None
build
(GenerateSourcesBuilder.Input input)¶
request¶
-
public static BuildRequest<Input, None, GenerateSourcesBuilder, SpoofaxBuilderFactory<Input, None, GenerateSourcesBuilder>>
request
(Input input)¶
GenerateSourcesBuilder.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
jsglrVersion¶
-
public final JSGLRVersion
jsglrVersion
¶
sdf2tableVersion¶
-
public final Sdf2tableVersion
sdf2tableVersion
¶
sdfVersion¶
-
public final SdfVersion
sdfVersion
¶
sourceDeps¶
-
public final Collection<LanguageIdentifier>
sourceDeps
¶
strBuildSetting¶
-
public final StrategoBuildSetting
strBuildSetting
¶
strFormat¶
-
public final StrategoFormat
strFormat
¶
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context, String languageId, Collection<LanguageIdentifier> sourceDeps, Boolean sdfEnabled, String sdfModule, File sdfFile, JSGLRVersion jsglrVersion, SdfVersion sdfVersion, Sdf2tableVersion sdf2tableVersion, File sdfExternalDef, List<File> packSdfIncludePaths, Arguments packSdfArgs, String sdfCompletionModule, File sdfCompletionFile, List<String> sdfMetaModules, List<File> sdfMetaFiles, File strFile, String strJavaPackage, String strJavaStratPackage, File strJavaStratFile, StrategoFormat strFormat, File strExternalJar, String strExternalJarFlags, List<File> strjIncludeDirs, List<File> strjIncludeFiles, Arguments strjArgs, StrategoBuildSetting strBuildSetting)¶
PackageBuilder¶
-
public class
PackageBuilder
extends SpoofaxBuilder<PackageBuilder.Input, None>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, None, PackageBuilder>
factory
¶
Methods¶
jar¶
request¶
-
public static BuildRequest<Input, None, PackageBuilder, SpoofaxBuilderFactory<Input, None, PackageBuilder>>
request
(Input input)¶
PackageBuilder.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
strFormat¶
-
public final StrategoFormat
strFormat
¶
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context, String languageId, Origin origin, StrategoFormat strFormat, File strJavaStratFile, Iterable<File> strJavaStratIncludeDirs)¶
org.metaborg.spoofax.meta.core.pluto.build.misc¶
CopyPattern¶
-
public class
CopyPattern
extends Builder<CopyPattern.Input, None>¶
Methods¶
request¶
-
public static BuildRequest<Input, None, CopyPattern, BuilderFactory<Input, None, CopyPattern>>
request
(Input input)¶
GetStrategoMix¶
-
public class
GetStrategoMix
extends SpoofaxBuilder<GetStrategoMix.Input, OutputPersisted<File>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputPersisted<File>, GetStrategoMix>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputPersisted<File>, GetStrategoMix, SpoofaxBuilderFactory<Input, OutputPersisted<File>, GetStrategoMix>>
request
(Input input)¶
GetStrategoMix.Input¶
-
public static class
Input
extends SpoofaxInput¶ Empty input class to ensure that a new input instance is always created, which is always exactly the same, such that this builder is only executed once.
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context)¶
ParseFile¶
-
public class
ParseFile
extends SpoofaxBuilder<ParseFile.Input, Out<IStrategoTerm>>¶
Fields¶
factory¶
-
public static final SpoofaxBuilderFactory<Input, Out<IStrategoTerm>, ParseFile>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, Out<IStrategoTerm>, ParseFile, SpoofaxBuilderFactory<Input, Out<IStrategoTerm>, ParseFile>>
request
(Input input)¶
ParseFile.Input¶
-
public static class
Input
extends SpoofaxInput¶
Fields¶
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context, File file, boolean persistResult, Origin requiredUnits)¶
Input¶
-
public
Input
(SpoofaxContext context, File file, boolean persistResult, boolean silent, Origin requiredUnits)¶
PrepareNativeBundle¶
-
public class
PrepareNativeBundle
extends SpoofaxBuilder<PrepareNativeBundle.Input, OutputTransient<PrepareNativeBundle.Output>>¶
Fields¶
factory¶
-
public static SpoofaxBuilderFactory<Input, OutputTransient<PrepareNativeBundle.Output>, PrepareNativeBundle>
factory
¶
Methods¶
request¶
-
public static BuildRequest<Input, OutputTransient<Output>, PrepareNativeBundle, SpoofaxBuilderFactory<Input, OutputTransient<Output>, PrepareNativeBundle>>
request
(Input input)¶
PrepareNativeBundle.Input¶
-
public static class
Input
extends SpoofaxInput¶ Empty input class to ensure that a new input instance is always created, which is always exactly the same, such that this builder is only executed once.
Constructors¶
Input¶
-
public
Input
(SpoofaxContext context)¶
PrepareNativeBundle.Output¶
-
public static class
Output
implements Serializable¶
Fields¶
implodePT¶
-
public final transient ExecutableCommandStrategy
implodePT
¶
sdf2table¶
-
public final transient ExecutableCommandStrategy
sdf2table
¶
Constructors¶
Output¶
-
public
Output
(ExecutableCommandStrategy sdf2table, ExecutableCommandStrategy implodePT)¶
org.metaborg.spoofax.meta.core.pluto.stamp¶
DirectoryModifiedStamper¶
-
public class
DirectoryModifiedStamper
implements Stamper¶
org.metaborg.spoofax.meta.core.pluto.util¶
ExecutableCommandStrategy¶
-
public class
ExecutableCommandStrategy
extends xtc_command_1_0¶
Constructors¶
Methods¶
run¶
-
public ExecutionResult
run
(IStrategoTerm... args)¶
run¶
-
public ExecutionResult
run
(String... args)¶
LoggingFilteringIOAgent.LoggingWriter¶
OutputIgnoreOriginBuilder¶
-
public class
OutputIgnoreOriginBuilder
extends Origin.Builder¶ Origin builder that overrides stampers of all added build requests with
IgnoreOutputStamper
.
ResourceAgentTracker¶
-
public class
ResourceAgentTracker
¶
Constructors¶
ResourceAgentTracker¶
-
public
ResourceAgentTracker
(IResourceService resourceService, FileObject initialDir, String... excludePatterns)¶
ResourceAgentTracker¶
-
public
ResourceAgentTracker
(IResourceService resourceService, FileObject initialDir, OutputStream stdoutStream, OutputStream stderrStream)¶
StrategoExecutor¶
-
public class
StrategoExecutor
¶
Methods¶
executeCLI¶
-
public ExecutionResult
executeCLI
(Arguments arguments)¶
setSilent¶
-
public StrategoExecutor
setSilent
(boolean silent)¶
withContext¶
-
public StrategoExecutor
withContext
(Context context)¶
withName¶
-
public StrategoExecutor
withName
(String name)¶
withPermissiveGrammarsContext¶
-
public StrategoExecutor
withPermissiveGrammarsContext
()¶
withSdfContext¶
-
public StrategoExecutor
withSdfContext
()¶
withStrategy¶
-
public StrategoExecutor
withStrategy
(Strategy strategy)¶
withStrategyName¶
-
public StrategoExecutor
withStrategyName
(String strategyName)¶
withStrjContext¶
-
public StrategoExecutor
withStrjContext
()¶
withToolsContext¶
-
public StrategoExecutor
withToolsContext
()¶
withTracker¶
-
public StrategoExecutor
withTracker
(ResourceAgentTracker tracker)¶
org.metaborg.spoofax.meta.core.project¶
ISpoofaxLanguageSpec¶
-
public interface
ISpoofaxLanguageSpec
extends ILanguageSpec¶ Spoofax specialized version of a language specification project.
Methods¶
config¶
-
ISpoofaxLanguageSpecConfig
config
()¶
ISpoofaxLanguageSpecService¶
-
public interface
ISpoofaxLanguageSpecService
extends ILanguageSpecService¶ Service for getting a Spoofax language specification.
Methods¶
available¶
get¶
-
ISpoofaxLanguageSpec
get
(IProject project)¶ Gets a Spoofax language specification from the specified project.
Parameters: - project – The project.
Throws: - ConfigException – When reading Spoofax language specification configuration fails.
Returns: The Spoofax language specification, or
null
when the project is not a Spoofax language specification.
SpoofaxLanguageSpecService¶
-
public class
SpoofaxLanguageSpecService
implements ISpoofaxLanguageSpecService¶
Constructors¶
SpoofaxLanguageSpecService¶
-
public
SpoofaxLanguageSpecService
(ISourceTextService sourceTextService, ISpoofaxLanguageSpecConfigService configService)¶
SpoofaxLanguageSpecWrapper¶
-
public class
SpoofaxLanguageSpecWrapper
implements IProject, ISpoofaxLanguageSpec¶ Wraps an
IProject
to use it as anILanguageSpec
Constructors¶
SpoofaxLanguageSpecWrapper¶
-
public
SpoofaxLanguageSpecWrapper
(ISpoofaxLanguageSpecConfig config, IProject project)¶
Methods¶
config¶
-
public ISpoofaxLanguageSpecConfig
config
()¶
location¶
-
public FileObject
location
()¶
org.metaborg.spoofax.meta.core.stratego.primitive¶
CheckSdf2TablePrimitive¶
-
public class
CheckSdf2TablePrimitive
extends AbstractPrimitive¶
Constructors¶
CheckSdf2TablePrimitive¶
-
public
CheckSdf2TablePrimitive
(IProjectService projectService, ILanguagePathService languagePathService)¶
GetContextualGrammarPrimitive¶
-
public class
GetContextualGrammarPrimitive
extends AbstractPrimitive¶
Constructors¶
GetContextualGrammarPrimitive¶
-
public
GetContextualGrammarPrimitive
(IProjectService projectService)¶
LanguageSpecPpNamePrimitive¶
-
public class
LanguageSpecPpNamePrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LanguageSpecPpNamePrimitive¶
-
public
LanguageSpecPpNamePrimitive
(IProjectService projectService)¶
LanguageSpecSrcGenDirectory¶
-
public class
LanguageSpecSrcGenDirectory
extends ASpoofaxContextPrimitive¶
LanguageSpecificationPrimitive¶
-
public class
LanguageSpecificationPrimitive
extends ASpoofaxContextPrimitive¶
LayoutSensitivePrettyPrinterPrimitive¶
-
public class
LayoutSensitivePrettyPrinterPrimitive
extends AbstractPrimitive¶
Constructors¶
LayoutSensitivePrettyPrinterPrimitive¶
-
public
LayoutSensitivePrettyPrinterPrimitive
(IProjectService projectService)¶
LegacyLanguageSpecNamePrimitive¶
-
public class
LegacyLanguageSpecNamePrimitive
extends ASpoofaxContextPrimitive¶
Constructors¶
LegacyLanguageSpecNamePrimitive¶
-
public
LegacyLanguageSpecNamePrimitive
(IProjectService projectService)¶
org.metaborg.spoofax.meta.core.wizard¶
CreateSpoofaxLanguageSpecWizard¶
-
public abstract class
CreateSpoofaxLanguageSpecWizard
extends CreateLanguageSpecWizard¶ Spoofax specialization of the ‘create language specification’ wizard helper.
Methods¶
analysisType¶
-
public AnalysisType
analysisType
()¶
setGenerateEclipseFeatureProject¶
-
protected abstract void
setGenerateEclipseFeatureProject
(boolean generate)¶
setGenerateEclipsePluginProject¶
-
protected abstract void
setGenerateEclipsePluginProject
(boolean generate)¶
setGenerateEclipseUpdatesiteProject¶
-
protected abstract void
setGenerateEclipseUpdatesiteProject
(boolean generate)¶
syntaxType¶
-
public SyntaxType
syntaxType
()¶