use of org.whole.lang.grammars.reflect.GrammarsEntityDescriptorEnum.Production in project whole by wholeplatform.
the class GrammarsContentAssistVisitor method calculateAsNameValues.
public static Set<String> calculateAsNameValues(IEntity e) {
Grammar grammar = Matcher.findAncestor(Grammar, e);
if (grammar != null) {
Production production = Matcher.findAncestor(Production, e);
String entityName = production.getName().getValue();
ILanguageKit languageKit = getLanguageKitIfExists(grammar);
if (languageKit != null) {
EntityDescriptor<?> ed = languageKit.getEntityDescriptorEnum().valueOf(entityName);
if (ed != null) {
Set<String> names = new HashSet<String>();
for (FeatureDescriptor fd : ed.getEntityFeatureDescriptors()) names.add(fd.getName());
return names;
}
}
}
return Collections.emptySet();
}
Aggregations