use of org.metaborg.spoofax.meta.core.generator.GeneratorSettings 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);
}
}
use of org.metaborg.spoofax.meta.core.generator.GeneratorSettings in project spoofax by metaborg.
the class LangSpecGeneratorSettingsBuilder method build.
public LangSpecGeneratorSettings build(FileObject projectLocation, final ISpoofaxLanguageSpecConfigBuilder languageSpecConfigBuilder) throws ProjectException {
if (!canBuild()) {
throw new ProjectException("Cannot build incomplete configuration, missing " + Joiner.on(", ").join(stillMissing()));
}
if (groupId == null) {
groupId = defaultGroupId;
}
if (version == null) {
version = defaultVersion;
}
if (syntaxType == null) {
syntaxType = defaultSyntaxType;
}
if (analysisType == null) {
analysisType = defaultAnalysisType;
}
if (metaborgVersion == null) {
metaborgVersion = defaultMetaborgVersion;
}
final LanguageIdentifier identifier = new LanguageIdentifier(groupId, id, version);
final ISpoofaxLanguageSpecConfig config = languageSpecConfigBuilder.withIdentifier(identifier).withName(name).build(projectLocation);
final GeneratorSettings generatorSettings = new GeneratorSettings(projectLocation, config, analysisType);
generatorSettings.setMetaborgVersion(metaborgVersion);
return new LangSpecGeneratorSettings(generatorSettings, extensions, syntaxType);
}
Aggregations