Search in sources :

Example 1 with MessageBuilder

use of org.metaborg.core.messages.MessageBuilder in project spoofax by metaborg.

the class SpoofaxLanguageSpecConfigService method toConfig.

@Override
protected ConfigRequest<ISpoofaxLanguageSpecConfig> toConfig(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile) {
    final SpoofaxProjectConfig projectConfig = new SpoofaxProjectConfig(config);
    final SpoofaxLanguageSpecConfig languageSpecConfig = new SpoofaxLanguageSpecConfig(config, projectConfig);
    final MessageBuilder mb = MessageBuilder.create().asError().asInternal().withSource(configFile);
    final Collection<IMessage> messages = languageSpecConfig.validate(mb);
    return new ConfigRequest<ISpoofaxLanguageSpecConfig>(languageSpecConfig, messages);
}
Also used : SpoofaxProjectConfig(org.metaborg.spoofax.core.config.SpoofaxProjectConfig) MessageBuilder(org.metaborg.core.messages.MessageBuilder) ConfigRequest(org.metaborg.core.config.ConfigRequest) IMessage(org.metaborg.core.messages.IMessage)

Example 2 with MessageBuilder

use of org.metaborg.core.messages.MessageBuilder in project spoofax by metaborg.

the class ProjectConfigService method toConfig.

@Override
protected ConfigRequest<IProjectConfig> toConfig(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile) {
    final ProjectConfig projectConfig = new ProjectConfig(config);
    final MessageBuilder mb = MessageBuilder.create().asError().asInternal().withSource(configFile);
    final Collection<IMessage> messages = projectConfig.validate(mb);
    return new ConfigRequest<IProjectConfig>(projectConfig, messages);
}
Also used : MessageBuilder(org.metaborg.core.messages.MessageBuilder) IMessage(org.metaborg.core.messages.IMessage)

Example 3 with MessageBuilder

use of org.metaborg.core.messages.MessageBuilder in project spoofax by metaborg.

the class LanguageComponentConfigService method toConfig.

@Override
protected ConfigRequest<ILanguageComponentConfig> toConfig(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile) {
    final ProjectConfig projectConfig = new ProjectConfig(config);
    final LanguageComponentConfig languageComponentConfig = new LanguageComponentConfig(config, projectConfig);
    final MessageBuilder mb = MessageBuilder.create().asError().asInternal().withSource(configFile);
    final Collection<IMessage> messages = languageComponentConfig.validate(mb);
    return new ConfigRequest<ILanguageComponentConfig>(languageComponentConfig, messages);
}
Also used : MessageBuilder(org.metaborg.core.messages.MessageBuilder) IMessage(org.metaborg.core.messages.IMessage)

Example 4 with MessageBuilder

use of org.metaborg.core.messages.MessageBuilder in project spoofax by metaborg.

the class SpoofaxProjectConfigService method toConfig.

@Override
protected ConfigRequest<ISpoofaxProjectConfig> toConfig(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile) {
    final SpoofaxProjectConfig projectConfig = new SpoofaxProjectConfig(config);
    final MessageBuilder mb = MessageBuilder.create().asError().asInternal().withSource(configFile);
    final Collection<IMessage> messages = projectConfig.validate(mb);
    return new ConfigRequest<>(projectConfig, messages);
}
Also used : MessageBuilder(org.metaborg.core.messages.MessageBuilder) ConfigRequest(org.metaborg.core.config.ConfigRequest) IMessage(org.metaborg.core.messages.IMessage)

Example 5 with MessageBuilder

use of org.metaborg.core.messages.MessageBuilder in project spoofax by metaborg.

the class LanguageSpecConfigService method toConfig.

@Override
protected ConfigRequest<ILanguageSpecConfig> toConfig(HierarchicalConfiguration<ImmutableNode> config, FileObject configFile) {
    final ProjectConfig projectConfig = new ProjectConfig(config);
    final LanguageSpecConfig languageSpecConfig = new LanguageSpecConfig(config, projectConfig);
    final MessageBuilder mb = MessageBuilder.create().asError().asInternal().withSource(configFile);
    final Collection<IMessage> messages = languageSpecConfig.validate(mb);
    return new ConfigRequest<>(languageSpecConfig, messages);
}
Also used : ProjectConfig(org.metaborg.core.config.ProjectConfig) MessageBuilder(org.metaborg.core.messages.MessageBuilder) ConfigRequest(org.metaborg.core.config.ConfigRequest) IMessage(org.metaborg.core.messages.IMessage)

Aggregations

IMessage (org.metaborg.core.messages.IMessage)5 MessageBuilder (org.metaborg.core.messages.MessageBuilder)5 ConfigRequest (org.metaborg.core.config.ConfigRequest)3 ProjectConfig (org.metaborg.core.config.ProjectConfig)1 SpoofaxProjectConfig (org.metaborg.spoofax.core.config.SpoofaxProjectConfig)1