system/src/sc/lang/java/JavaModel.java
public void addModelMergingComment(ParentParseNode baseCommentNode) {
      // Not necessary when processing a model stream and breaks cause there's no src file.
      if (!mergeDeclaration)
         return;

      int ix = baseCommentNode.children == null || baseCommentNode.children.size() == 0 ? 0 : 1;
      baseCommentNode.addGeneratedNodeAt(ix, "//   merging: " + getSrcFile() + FileUtil.LINE_SEPARATOR);
      ParentParseNode ppn = (ParentParseNode) parseNode;
      if (ppn != null) {
         Object child = ppn.children.get(0);
         if (child instanceof ParentParseNode) {
            ParentParseNode myCommentNode = ppn.children != null ? (ParentParseNode) child : null;
            if (myCommentNode != null && myCommentNode.length() > 0) {
               int insIx = Math.min(2, baseCommentNode.children.size());
               baseCommentNode.addGeneratedNodeAt(insIx, myCommentNode.toString());
            }
         }
         else if (child != null)
            System.out.println("*** Unable to add model merging comment - unhandled case");
      }
      JavaModel modifiedModel = getModifiedModel();
      if (modifiedModel != null) {
         modifiedModel.addModelMergingComment(baseCommentNode);
      }
   }
// the first type in the chain - the one where we add this comment.
the first type in the chain - the one where we add this comment.
the first type in the chain - the one where we add this comment .
public void addModelMergingComment(ParentParseNode baseCommentNode) {
      if (!mergeDeclaration)
         return;
      int ix = baseCommentNode.children == null || baseCommentNode.children.size() == 0 ? 0 : 1;
      baseCommentNode.addGeneratedNodeAt(ix, "//   merging: " + getSrcFile() + FileUtil.LINE_SEPARATOR);
      ParentParseNode ppn = (ParentParseNode) parseNode;
      if (ppn != null) {
         Object child = ppn.children.get(0);
         if (child instanceof ParentParseNode) {
            ParentParseNode myCommentNode = ppn.children != null ? (ParentParseNode) child : null;
            if (myCommentNode != null && myCommentNode.length() > 0) {
               int insIx = Math.min(2, baseCommentNode.children.size());
               baseCommentNode.addGeneratedNodeAt(insIx, myCommentNode.toString());
            }
         }
         else if (child != null)
            System.out.println("*** Unable to add model merging comment - unhandled case");
      }
      JavaModel modifiedModel = getModifiedModel();
      if (modifiedModel != null) {
         modifiedModel.addModelMergingComment(baseCommentNode);
      }
   }
public void addModelMergingComment ( ParentParseNode baseCommentNode ) { if ( ! mergeDeclaration ) return ; int ix = baseCommentNode . children == null || baseCommentNode . children . size ( ) == 0 ? 0 : 1 ; baseCommentNode . addGeneratedNodeAt ( ix , "//   merging: " + getSrcFile ( ) + FileUtil . LINE_SEPARATOR ) ; ParentParseNode ppn = ( ParentParseNode ) parseNode ; if ( ppn != null ) { Object child = ppn . children . get ( 0 ) ; if ( child instanceof ParentParseNode ) { ParentParseNode myCommentNode = ppn . children != null ? ( ParentParseNode ) child : null ; if ( myCommentNode != null && myCommentNode . length ( ) > 0 ) { int insIx = Math . min ( 2 , baseCommentNode . children . size ( ) ) ; baseCommentNode . addGeneratedNodeAt ( insIx , myCommentNode . toString ( ) ) ; } } else if ( child != null ) System . out . println ( "*** Unable to add model merging comment - unhandled case" ) ; } JavaModel modifiedModel = getModifiedModel ( ) ; if ( modifiedModel != null ) { modifiedModel . addModelMergingComment ( baseCommentNode ) ; } }
the first type in the chain - the one where we add this comment.
the first type in the chain - the one where we add this comment .
// Not necessary when processing a model stream and breaks cause there's no src file.