system/src/sc/lang/sc/ModifyDeclaration.java
public Definition modifyDefinition(BodyTypeDeclaration base, boolean doMerge, boolean inTransformed) {
      TypeDeclaration outer = getEnclosingType();
      if (outer != null) {
         // If this modify is overriding a definition in the same type we need to replace it here
         // so both are not processed when processing the parent type.
         Object toReplaceObj = base.getInnerType(typeName, null, true, false, false, base.isEnumeratedType());
         if (toReplaceObj instanceof BodyTypeDeclaration) {
            BodyTypeDeclaration toReplace = (BodyTypeDeclaration) toReplaceObj;
            if (toReplace.getEnclosingType() == base) {
               toReplace.parentNode.replaceChild(toReplace, this);
            }
            else {
               base.addBodyStatement(this);
            }
         }
         else if (toReplaceObj == null) {
            base.addBodyStatement(this);
         }
      }
      return this;
   }
// we'll do it in the transform method later
we'll do it in the transform method later
we ' ll do it in the transform method later
public Definition modifyDefinition(BodyTypeDeclaration base, boolean doMerge, boolean inTransformed) {
      TypeDeclaration outer = getEnclosingType();
      if (outer != null) {
         Object toReplaceObj = base.getInnerType(typeName, null, true, false, false, base.isEnumeratedType());
         if (toReplaceObj instanceof BodyTypeDeclaration) {
            BodyTypeDeclaration toReplace = (BodyTypeDeclaration) toReplaceObj;
            if (toReplace.getEnclosingType() == base) {
               toReplace.parentNode.replaceChild(toReplace, this);
            }
            else {
               base.addBodyStatement(this);
            }
         }
         else if (toReplaceObj == null) {
            base.addBodyStatement(this);
         }
      }
      return this;
   }
public Definition modifyDefinition ( BodyTypeDeclaration base , boolean doMerge , boolean inTransformed ) { TypeDeclaration outer = getEnclosingType ( ) ; if ( outer != null ) { Object toReplaceObj = base . getInnerType ( typeName , null , true , false , false , base . isEnumeratedType ( ) ) ; if ( toReplaceObj instanceof BodyTypeDeclaration ) { BodyTypeDeclaration toReplace = ( BodyTypeDeclaration ) toReplaceObj ; if ( toReplace . getEnclosingType ( ) == base ) { toReplace . parentNode . replaceChild ( toReplace , this ) ; } else { base . addBodyStatement ( this ) ; } } else if ( toReplaceObj == null ) { base . addBodyStatement ( this ) ; } } return this ; }
we'll do it in the transform method later
we ' ll do it in the transform method later
// If this modify is overriding a definition in the same type we need to replace it here // so both are not processed when processing the parent type.