Search in sources :

Example 1 with ProjectConfig

use of org.metaborg.core.config.ProjectConfig in project spoofax by metaborg.

the class LanguageSpecConfigBuilder method build.

@Override
public ILanguageSpecConfig build(@Nullable FileObject rootFolder) throws IllegalStateException {
    if (configuration == null) {
        configuration = configReaderWriter.create(null, rootFolder);
    }
    ProjectConfig projectConfig = projectConfigBuilder.build(configuration);
    final LanguageSpecConfig config = new LanguageSpecConfig(configuration, projectConfig, identifier, name, sdfEnabled, sdf2tableVersion, dataDependent, parseTable, completionsParseTable, jsglrVersion, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec);
    return config;
}
Also used : ProjectConfig(org.metaborg.core.config.ProjectConfig)

Example 2 with ProjectConfig

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

ProjectConfig (org.metaborg.core.config.ProjectConfig)2 ConfigRequest (org.metaborg.core.config.ConfigRequest)1 IMessage (org.metaborg.core.messages.IMessage)1 MessageBuilder (org.metaborg.core.messages.MessageBuilder)1