sota.ast.nodes
Class ASTFunctionNode

java.lang.Object
  extended by sota.ast.nodes.ASTNode
      extended by sota.ast.nodes.ASTScopeNode
          extended by 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


Field Summary
protected  java.lang.String arguments
           
protected  ASTStatementNode entryNode
           
protected  java.util.ArrayList<IConditionNode> listOfConditionNodes
           
protected  java.lang.String modifiers
           
protected  java.util.Vector<java.lang.Integer> nrAtoms
           
private  int nrHits
           
protected  int nrPrimaryConditions
           
protected  java.util.HashSet<ASTStatementNode> setOfExitNodes
           
protected  java.util.Stack<ASTBranchNode> stackOfBranchNodes
           
 
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)
           
 
Method Summary
 void addConditionNode(IConditionNode cs)
           
 void addExitNode(ASTStatementNode en)
           
 void completeBranchNodes()
           
 void completeFunction(ASTManager ast)
          vollendet Struktur einer Funktion, wenn der AST fertig konstruiert ist (erst nach Verknüpfung der Sprungziele aufrufen!)
abstract  void createASCContent(int level)
           
 int decNrHits(int i)
           
 void findReachableNodes()
          färbt alle erreichbaren Knoten und sammelt die ReturnKnoten
private  void findReachableNodes(ASTNode n)
           
 java.lang.String getArguments()
           
 ASTStatementNode getEntryNode()
           
 java.lang.String getExitString()
           
 java.lang.String getFunctionName()
           
 java.lang.String getName()
           
 java.lang.String getNodeString()
           
 int getNrHits()
           
 java.util.HashSet<ASTStatementNode> getSetOfExitNodes()
           
 int incNrHits()
           
 int incNrHits(int i)
           
 boolean isPrivate()
           
 boolean isProtected()
           
 void numerateConditions()
           
 void printCFG()
           
 void printExits()
           
 void printNode()
          Prints **
 void resetHits()
           
 void setEntryNode(ASTStatementNode en)
           
 void setNrHits(int i)
           
 
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
 
Methods inherited from interface sota.ast.nodes.IStatementNode
getID, print
 

Field Detail

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
Constructor Detail

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)
Method Detail

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