public TypeReference getPartialContentAssistParserClass(final Grammar g) {
   String _genericIdeBasePackage = this._xtextGeneratorNaming.getGenericIdeBasePackage(g);
   String _plus = (_genericIdeBasePackage + ".contentassist.antlr");
   String _simpleName = GrammarUtil.getSimpleName(g);
   String _plus_1 = ("Partial" + _simpleName);
   String _plus_2 = (_plus_1 + "ContentAssistParser");
   return new TypeReference(_plus, _plus_2);
 }
Пример #2
0
 public List<String> getFileExtensions(Grammar g) {
   if (fileExtensions.isEmpty()) {
     String lowerCase = GrammarUtil.getSimpleName(g).toLowerCase();
     if (LOG.isInfoEnabled())
       LOG.info("No explicit fileExtensions configured. Using '*." + lowerCase + "'.");
     return fileExtensions = Collections.singletonList(lowerCase);
   }
   return fileExtensions;
 }
Пример #3
0
 private String getInheritedUniqueName(AbstractRule rule, Set<String> usedNames) {
   String grammarName = GrammarUtil.getSimpleName(GrammarUtil.getGrammar(rule));
   String candidate = grammarName + rule.getName();
   int i = 1;
   while (usedNames.contains(candidate)) {
     candidate = grammarName + i + rule.getName();
     i++;
   }
   return candidate;
 }