net.sourceforge.pmd.dfa

Class Structure

public class Structure extends Object

Author: raik

Structure contains only raw data. A set of nodes wich represent a data flow and 2 stacks to link the nodes to each other.

Method Summary
IDataFlowNodecreateEndNode(int line)
IDataFlowNodecreateNewNode(SimpleNode node)
This class encapsulates the access to the DataFlowNode class.
IDataFlowNodecreateStartNode(int line)
ListgetBraceStack()
ListgetContinueBreakReturnStack()
IDataFlowNodegetFirst()
IDataFlowNodegetLast()
protected voidpushOnStack(int type, IDataFlowNode node)
The braceStack contains all nodes which are important to link the data flow nodes.

Method Detail

createEndNode

public IDataFlowNode createEndNode(int line)

createNewNode

public IDataFlowNode createNewNode(SimpleNode node)
This class encapsulates the access to the DataFlowNode class. Is this worthwhile? TODO I think it's too confusing to have the DataFlowNode constructor add the created instance to the LinkedList. I think it'd be clearer if we did that more "procedurally", i.e., create the object, then add it to the list.

createStartNode

public IDataFlowNode createStartNode(int line)

getBraceStack

public List getBraceStack()

getContinueBreakReturnStack

public List getContinueBreakReturnStack()

getFirst

public IDataFlowNode getFirst()

getLast

public IDataFlowNode getLast()

pushOnStack

protected void pushOnStack(int type, IDataFlowNode node)
The braceStack contains all nodes which are important to link the data flow nodes. The cbrStack contains continue, break, and return nodes. There are 2 Stacks because the have to process differently.