Example #1
0
 /** @since 2.3 */
 protected void validateReferencedMetamodel(ReferencedMetamodel ref) {
   if (ref.getEPackage() != null && !ref.getEPackage().eIsProxy()) return;
   EReference eref = XtextPackage.Literals.ABSTRACT_METAMODEL_DECLARATION__EPACKAGE;
   List<INode> nodes = NodeModelUtils.findNodesForFeature(ref, eref);
   String refName = nodes.isEmpty() ? "(unknown)" : NodeModelUtils.getTokenText(nodes.get(0));
   String grammarName = GrammarUtil.getGrammar(ref).getName();
   String msg = "The EPackage " + refName + " in grammar " + grammarName + " could not be found. ";
   msg += "You might want to register that EPackage in your workflow file.";
   throw new IllegalStateException(msg);
 }
Example #2
0
 private String textOf(EObject object) {
   return NodeModelUtils.getTokenText(NodeModelUtils.getNode(object));
 }