org.deft.extension.tools.astmodifier
Class ASTModifier

java.lang.Object
  extended by org.deft.extension.tools.astmodifier.ASTModifier

public class ASTModifier
extends java.lang.Object

Provides modification operation on a AST.

Author:
Martin Heinzerling

Constructor Summary
ASTModifier(SyntaxCheckerVisitor sc)
           
 
Method Summary
 void appendAfter(org.deft.repository.ast.TreeNode ast, org.deft.repository.ast.TreeNode insert, XPath location, int emptyLinesBefore, int emptyLinesAfter, int spacesBefore, int spacesAfter)
           
 void appendBefore(org.deft.repository.ast.TreeNode ast, org.deft.repository.ast.TreeNode insert, XPath location, int emptyLinesBefore, int emptyLinesAfter, int spacesBefore, int spacesAfter)
           
 void changeToComment(org.deft.repository.ast.TreeNode ast, XPath location, int width, CommentTypeVisitor v)
           
 void replace(org.deft.repository.ast.TreeNode ast, org.deft.repository.ast.TreeNode insert, XPath location, int emptyLinesBefore, int emptyLinesAfter, int spacesBefore, int spacesAfter)
           
 void replaceList(org.deft.repository.ast.TreeNode ast, org.deft.repository.ast.TreeNode insert, XPath location, int width, int emptyLinesBefore, int emptyLinesAfter, int spacesBefore, int spacesAfter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTModifier

public ASTModifier(SyntaxCheckerVisitor sc)
Method Detail

appendAfter

public void appendAfter(org.deft.repository.ast.TreeNode ast,
                        org.deft.repository.ast.TreeNode insert,
                        XPath location,
                        int emptyLinesBefore,
                        int emptyLinesAfter,
                        int spacesBefore,
                        int spacesAfter)
Parameters:
location - to insert the treenode

appendBefore

public void appendBefore(org.deft.repository.ast.TreeNode ast,
                         org.deft.repository.ast.TreeNode insert,
                         XPath location,
                         int emptyLinesBefore,
                         int emptyLinesAfter,
                         int spacesBefore,
                         int spacesAfter)
Parameters:
location - to insert the treenode

replace

public void replace(org.deft.repository.ast.TreeNode ast,
                    org.deft.repository.ast.TreeNode insert,
                    XPath location,
                    int emptyLinesBefore,
                    int emptyLinesAfter,
                    int spacesBefore,
                    int spacesAfter)
Parameters:
location - to replace the treenode

replaceList

public void replaceList(org.deft.repository.ast.TreeNode ast,
                        org.deft.repository.ast.TreeNode insert,
                        XPath location,
                        int width,
                        int emptyLinesBefore,
                        int emptyLinesAfter,
                        int spacesBefore,
                        int spacesAfter)
Parameters:
location - to replace the treenode
width - -1 all following sibling

changeToComment

public void changeToComment(org.deft.repository.ast.TreeNode ast,
                            XPath location,
                            int width,
                            CommentTypeVisitor v)
Parameters:
location - to replace
width - -1 all following sibling