Changeset 3294 for proto/pabloj


Ignore:
Timestamp:
Jun 11, 2013, 1:50:57 PM (6 years ago)
Author:
ksherdy
Message:

Added insertBefore statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/pabloj/trunk/src/toolchain/pabloS/ast/Mutators.java

    r3115 r3294  
    22
    33import pabloS.ast.ASTNode;
     4import pabloS.ast.AssignNode;
    45import pabloS.ast.BlockStmtNode;
    56
     
    1516                parent.insertAfterChild(node, newNode);
    1617        }
     18       
     19    static public void insertStatementBefore(ASTNode node, ASTNode newNode) {
     20        assert node.getParent() instanceof BlockStmtNode;
     21        insertBefore(node, newNode);
     22    }
     23
     24    static public void insertBefore(ASTNode node, ASTNode newNode) {
     25        ASTNode parent = node.getParent();
     26        parent.insertBeforeChild(node, newNode);
     27    }
    1728
    1829}
Note: See TracChangeset for help on using the changeset viewer.