Example #1
0
 @Check
 public void checkGOTOvalidID(final Domain domain, final intDirective dir) {
   String _name = dir.getName();
   boolean _notEquals = (!Objects.equal(_name, "GOTO"));
   if (_notEquals) {
     return;
   }
   EList<EObject> _eContents = domain.eContents();
   for (final EObject o : _eContents) {
     if ((o instanceof Bloc)) {
       final Bloc b = ((Bloc) o);
       int _name_1 = b.getName();
       int _value = dir.getValue();
       boolean _equals = (_name_1 == _value);
       if (_equals) {
         return;
       }
     } else {
       this.error(
           "An element of the Macro isn\'t a Bloc. All elements of Macros should be Blocs.",
           Literals.DOMAIN__ELEMENTS,
           MacroValidator.INVALID_ELEMENT);
     }
   }
   this.error(
       "GOTO directive points towards an inexisting Bloc ID.",
       Literals.INT_DIRECTIVE__VALUE,
       MacroValidator.INVALID_ARGUMENT);
 }
Example #2
0
 @Check
 public void checkBlocIDUnique(final Bloc bloc) {
   EObject _eContainer = bloc.eContainer();
   EList<EObject> _eContents = _eContainer.eContents();
   for (final EObject o : _eContents) {
     if ((o instanceof Bloc)) {
       final Bloc b = ((Bloc) o);
       boolean _notEquals = (!Objects.equal(b, bloc));
       if (_notEquals) {
         int _name = b.getName();
         int _name_1 = bloc.getName();
         boolean _equals = (_name == _name_1);
         if (_equals) {
           this.error("Bloc ID already exists.", Literals.BLOC__NAME, MacroValidator.INVALID_NAME);
         }
       }
     } else {
       boolean _equals_1 = ((o instanceof onLoadBloc) == false);
       if (_equals_1) {
         this.error(
             "An element of the Macro isn\'t a Bloc nor an OnLoadBloc. All elements of Macros should be Blocs.",
             Literals.DOMAIN__ELEMENTS,
             MacroValidator.INVALID_ELEMENT);
       }
     }
   }
 }