Exemple #1
0
 /**
  * Returns the full qulified Java class name of a GrammarAccess implementation for a grammar.
  *
  * @param grammar the grammar
  * @return the GrammarAccess' full qualified Java class name
  */
 public String gaFQName(final Grammar grammar) {
   return GrammarAccessUtil.getGrammarAccessFQName(grammar, this.naming);
 }
Exemple #2
0
 /**
  * Converts an arbitary string to a valid Java identifier. The string is split up along the the
  * characters that are not valid as Java identifier. The first character of each segments is made
  * upper case which leads to a camel-case style.
  *
  * @param text the string
  * @param uppercaseFirst whether the first character of the returned identifier should be
  *     uppercase or lowercase
  * @return the java identifier
  */
 public String toJavaIdentifier(final String text, final boolean uppercaseFirst) {
   return GrammarAccessUtil.toJavaIdentifier(text, Boolean.valueOf(uppercaseFirst));
 }
Exemple #3
0
 /**
  * Creates an identifier for an AbstractElement which is a valid Java identifier and which is
  * unique whithin the element's rule. The identifier tries to be as human-readable as possible.
  *
  * @param element the element
  * @return the element's identifier
  */
 public String gaElementIdentifyer(final AbstractElement element) {
   return GrammarAccessUtil.getUniqueElementName(element);
 }
Exemple #4
0
 public String grammarFragmentToStr(final EObject ele, final String prefix) {
   return GrammarAccessUtil.serialize(ele, prefix);
 }