Search in sources :

Example 1 with SpoofaxProjectConfig

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

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

the class SpoofaxLanguageSpecConfigBuilder method build.

@Override
public ISpoofaxLanguageSpecConfig build(@Nullable FileObject rootFolder) throws IllegalStateException {
    if (configuration == null) {
        configuration = configReaderWriter.create(null, rootFolder);
    }
    SpoofaxProjectConfig projectConfig = projectConfigBuilder.build(configuration);
    final SpoofaxLanguageSpecConfig config = new SpoofaxLanguageSpecConfig(configuration, projectConfig, identifier, name, langContribs, generates, exports, pardonedLanguages, useBuildSystemSpec, sdfVersion, sdfEnabled, sdf2tableVersion, dataDependent, sdfMainFile, parseTable, jsglrVersion, completionsParseTable, placeholderCharacters, prettyPrint, sdfExternalDef, sdfArgs, strFormat, strExternalJar, strExternalJarFlags, strArgs, buildSteps);
    return config;
}
Also used : SpoofaxProjectConfig(org.metaborg.spoofax.core.config.SpoofaxProjectConfig)

Aggregations

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