Search in sources :

Example 1 with MweIssues

use of org.eclipse.xtext.xtext.generator.MweIssues in project xtext-core by eclipse.

the class XtextGenerator method checkConfigurationInternal.

@Override
protected void checkConfigurationInternal(final Issues issues) {
    this.initialize();
    final MweIssues generatorIssues = new MweIssues(this, issues);
    this.configuration.checkConfiguration(generatorIssues);
    final HashMap<String, Grammar> uris = new HashMap<String, Grammar>();
    for (final XtextGeneratorLanguage language : this.languageConfigs) {
        {
            language.checkConfiguration(generatorIssues);
            Iterable<GeneratedMetamodel> _filter = Iterables.<GeneratedMetamodel>filter(language.getGrammar().getMetamodelDeclarations(), GeneratedMetamodel.class);
            for (final GeneratedMetamodel generatedMetamodel : _filter) {
                {
                    final String nsURI = generatedMetamodel.getEPackage().getNsURI();
                    boolean _containsKey = uris.containsKey(nsURI);
                    if (_containsKey) {
                        String _name = uris.get(nsURI).getName();
                        String _plus = ((("Duplicate generated grammar with nsURI \'" + nsURI) + "\' in ") + _name);
                        String _plus_1 = (_plus + " and ");
                        String _name_1 = language.getGrammar().getName();
                        String _plus_2 = (_plus_1 + _name_1);
                        generatorIssues.addError(_plus_2);
                    } else {
                        uris.put(nsURI, language.getGrammar());
                    }
                }
            }
        }
    }
}
Also used : GeneratedMetamodel(org.eclipse.xtext.GeneratedMetamodel) XtextGeneratorLanguage(org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage) IXtextGeneratorLanguage(org.eclipse.xtext.xtext.generator.IXtextGeneratorLanguage) HashMap(java.util.HashMap) MweIssues(org.eclipse.xtext.xtext.generator.MweIssues) Grammar(org.eclipse.xtext.Grammar)

Aggregations

HashMap (java.util.HashMap)1 GeneratedMetamodel (org.eclipse.xtext.GeneratedMetamodel)1 Grammar (org.eclipse.xtext.Grammar)1 IXtextGeneratorLanguage (org.eclipse.xtext.xtext.generator.IXtextGeneratorLanguage)1 MweIssues (org.eclipse.xtext.xtext.generator.MweIssues)1 XtextGeneratorLanguage (org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage)1