Ejemplo n.º 1
0
 private static void addWarning(
     final String message, final EObject object, final Set<Diagnostic> errors) {
   if (!GamaPreferences.WARNINGS_ENABLED.getValue()) {
     return;
   }
   Diagnostic d = new EObjectDiagnosticImpl(Severity.WARNING, "", message, object, null, 0, null);
   errors.add(d);
 }
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;
 }
Ejemplo n.º 3
0
 private static void addInfo(
     final String message, final EObject object, final Set<Diagnostic> errors) {
   Diagnostic d = new EObjectDiagnosticImpl(Severity.INFO, "", message, object, null, 0, null);
   errors.add(d);
 }