Ejemplo n.º 1
0
 private static final IExpressionDescription convExpr(
     final Facet facet, final boolean label, final Set<Diagnostic> errors) {
   if (facet != null) {
     Expression expr = facet.getExpr();
     if (expr != null) {
       return label ? convertToLabel(expr, EGaml.getKeyOf(expr)) : convExpr(expr, errors);
     }
     String name = facet.getName();
     // TODO Verify the use of "facet"
     if (name != null) {
       return convertToLabel(null, name);
     }
   }
   return null;
 }
Ejemplo n.º 2
0
 private static final Set<String> varDependenciesOf(final Statement s) {
   Set<String> list = new HashSet();
   for (Facet facet : EGaml.getFacetsOf(s)) {
     Expression expr = facet.getExpr();
     if (expr != null) {
       if (expr instanceof VariableRef) {
         list.add(EGaml.getKey.caseVariableRef((VariableRef) expr));
       } else {
         for (TreeIterator<EObject> tree = expr.eAllContents(); tree.hasNext(); ) {
           EObject obj = tree.next();
           if (obj instanceof VariableRef) {
             list.add(EGaml.getKey.caseVariableRef((VariableRef) obj));
           }
         }
       }
     }
   }
   if (list.isEmpty()) {
     return null;
   }
   return list;
 }