sota.ast.nodes
Class ASTFunctionNode
java.lang.Object
sota.ast.nodes.ASTNode
sota.ast.nodes.ASTScopeNode
sota.ast.nodes.ASTFunctionNode
- All Implemented Interfaces:
- java.lang.Comparable<ASTNode>, IScopeNode, IStatementNode
- Direct Known Subclasses:
- JavaASTFunctionNode
public abstract class ASTFunctionNode
- extends ASTScopeNode
- implements IStatementNode
AST-Knoten für eine Funktion
Fields inherited from class sota.ast.nodes.ASTScopeNode |
endNode, fileNode, isFirstLevelFunction, isTopLevel, metrics, name, parent, qualifiedName, scopeName, setOfClasseNodes, setOfFunctionNodes |
Fields inherited from class sota.ast.nodes.ASTNode |
ascContent, BRANCH, CASE, CATCH, CONDITION, content, controlingBranchNode, DO, functionNode, id, IF, isDirectReachable, isReachable, isVirtual, ITERATION, JUMP, lineNr, next, NODE, prev, SCOPE, STATEMENT, SWITCH, TRY |
Constructor Summary |
ASTFunctionNode(int ln,
java.lang.String content,
java.lang.String scope,
java.lang.String modifiers,
java.lang.String name,
java.lang.String arguments,
IScopeNode parent)
|
Methods inherited from class sota.ast.nodes.ASTScopeNode |
addClassNode, addFunctionNode, getClassNodes, getEndNode, getFileNode, getFirstLineNr, getFullyQualifiedName, getFunctionNodes, getIDString, getLastLineNr, getMetrics, getParent, getScope, getStartNode, isFirstLevelFunction, isTopLevel, print_indent, printFunctions, setEndNode, setFileNode, setMetrics, setQualifiedName |
Methods inherited from class sota.ast.nodes.ASTNode |
appendToASCContent, compareTo, getASCContent, getContent, getControlingBranchNode, getFunctionNode, getID, getLineNr, getNextNode, getPrevNode, getReachString, getType, isDirectReachable, isDirectReachable, isReachable, isReachable, isVirtual, isVirtual, print, printReach, setASCContent, setContent, setControlingBranchNode, setFunctionNode, setID, setNextNode, setPrevNode, typeToString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
arguments
protected java.lang.String arguments
entryNode
protected ASTStatementNode entryNode
listOfConditionNodes
protected java.util.ArrayList<IConditionNode> listOfConditionNodes
modifiers
protected java.lang.String modifiers
nrAtoms
protected java.util.Vector<java.lang.Integer> nrAtoms
nrHits
private int nrHits
nrPrimaryConditions
protected int nrPrimaryConditions
setOfExitNodes
protected java.util.HashSet<ASTStatementNode> setOfExitNodes
stackOfBranchNodes
protected java.util.Stack<ASTBranchNode> stackOfBranchNodes
ASTFunctionNode
public ASTFunctionNode(int ln,
java.lang.String content,
java.lang.String scope,
java.lang.String modifiers,
java.lang.String name,
java.lang.String arguments,
IScopeNode parent)
addConditionNode
public void addConditionNode(IConditionNode cs)
addExitNode
public void addExitNode(ASTStatementNode en)
completeBranchNodes
public void completeBranchNodes()
completeFunction
public void completeFunction(ASTManager ast)
- vollendet Struktur einer Funktion, wenn der AST fertig konstruiert ist (erst nach Verknüpfung der Sprungziele
aufrufen!)
- Parameters:
ast
-
createASCContent
public abstract void createASCContent(int level)
- Specified by:
createASCContent
in interface IScopeNode
- Overrides:
createASCContent
in class ASTNode
decNrHits
public int decNrHits(int i)
- Specified by:
decNrHits
in interface IStatementNode
findReachableNodes
public void findReachableNodes()
- färbt alle erreichbaren Knoten und sammelt die ReturnKnoten
findReachableNodes
private void findReachableNodes(ASTNode n)
getArguments
public java.lang.String getArguments()
getEntryNode
public ASTStatementNode getEntryNode()
getExitString
public java.lang.String getExitString()
getFunctionName
public java.lang.String getFunctionName()
getName
public java.lang.String getName()
- Specified by:
getName
in interface IScopeNode
getNodeString
public java.lang.String getNodeString()
- Overrides:
getNodeString
in class ASTNode
getNrHits
public int getNrHits()
- Specified by:
getNrHits
in interface IStatementNode
getSetOfExitNodes
public java.util.HashSet<ASTStatementNode> getSetOfExitNodes()
incNrHits
public int incNrHits()
- Specified by:
incNrHits
in interface IStatementNode
incNrHits
public int incNrHits(int i)
- Specified by:
incNrHits
in interface IStatementNode
isPrivate
public boolean isPrivate()
isProtected
public boolean isProtected()
numerateConditions
public void numerateConditions()
printCFG
public void printCFG()
- Overrides:
printCFG
in class ASTNode
printExits
public void printExits()
printNode
public void printNode()
- Prints **
- Overrides:
printNode
in class ASTNode
resetHits
public void resetHits()
- Specified by:
resetHits
in interface IStatementNode
setEntryNode
public void setEntryNode(ASTStatementNode en)
setNrHits
public void setNrHits(int i)
- Specified by:
setNrHits
in interface IStatementNode