Search in sources :

Example 1 with ConfigRequest

use of org.metaborg.core.config.ConfigRequest 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 ConfigRequest

use of org.metaborg.core.config.ConfigRequest 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 3 with ConfigRequest

use of org.metaborg.core.config.ConfigRequest 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

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