Search in sources :

Example 1 with ContinuousLanguageSpecGenerator

use of org.metaborg.spoofax.meta.core.generator.general.ContinuousLanguageSpecGenerator in project spoofax by metaborg.

the class LanguageSpecBuilder method generateSources.

public void generateSources(LanguageSpecBuildInput input, @Nullable IFileAccess access) throws IOException, MetaborgException {
    final ISpoofaxLanguageSpec languageSpec = input.languageSpec();
    final FileObject location = languageSpec.location();
    final ISpoofaxLanguageSpecConfig config = languageSpec.config();
    logger.debug("Generating sources for {}", input.languageSpec().location());
    final ContinuousLanguageSpecGenerator generator = new ContinuousLanguageSpecGenerator(new GeneratorSettings(location, config), access, config.sdfEnabled(), config.sdfVersion());
    generator.generateAll();
    componentConfigBuilder.reset();
    componentConfigBuilder.copyFrom(input.languageSpec().config());
    final ILanguageComponentConfig componentConfig = componentConfigBuilder.build(location);
    componentConfigWriter.write(location, componentConfig, access);
    for (IBuildStep buildStep : buildSteps) {
        buildStep.execute(LanguageSpecBuildPhase.generateSources, input);
    }
}
Also used : ISpoofaxLanguageSpec(org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpec) ISpoofaxLanguageSpecConfig(org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfig) FileObject(org.apache.commons.vfs2.FileObject) ContinuousLanguageSpecGenerator(org.metaborg.spoofax.meta.core.generator.general.ContinuousLanguageSpecGenerator) GeneratorSettings(org.metaborg.spoofax.meta.core.generator.GeneratorSettings) ILanguageComponentConfig(org.metaborg.core.config.ILanguageComponentConfig)

Aggregations

FileObject (org.apache.commons.vfs2.FileObject)1 ILanguageComponentConfig (org.metaborg.core.config.ILanguageComponentConfig)1 ISpoofaxLanguageSpecConfig (org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfig)1 GeneratorSettings (org.metaborg.spoofax.meta.core.generator.GeneratorSettings)1 ContinuousLanguageSpecGenerator (org.metaborg.spoofax.meta.core.generator.general.ContinuousLanguageSpecGenerator)1 ISpoofaxLanguageSpec (org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpec)1