tip.node
Class ALocalDecl

java.lang.Object
  extended by tip.node.Node
      extended by tip.node.PDecl
          extended by tip.node.ALocalDecl
All Implemented Interfaces:
Cloneable, NodeInterface

public final class ALocalDecl
extends PDecl

ALocalDecl represents the local alternative of the decl production in the AST.


Constructor Summary
ALocalDecl()
          Creates a new ALocalDecl node with no children.
ALocalDecl(TIdentifier _name_)
          Creates a new ALocalDecl node with the given nodes as children.
ALocalDecl(TIdentifier _name_, boolean _declared_, int _index_)
          Creates a new ALocalDecl node with the given nodes as children.
 
Method Summary
 void apply(Analysis caller)
          Calls the Analysis.caseALocalDecl(ALocalDecl) of the Analysis caller.
<A> A
apply(Answer<A> caller)
          Returns the answer for caller by applying this ALocalDecl node to the Answer visitor.
<Q> void
apply(Question<Q> caller, Q question)
          Applies this ALocalDecl node to the Question visitor caller.
<Q,A> A
apply(QuestionAnswer<Q,A> caller, Q question)
          Returns the answer for caller by applying this ALocalDecl node with the question to the QuestionAnswer visitor.
 void checkOptionalInvariant()
           
 ALocalDecl clone()
          Returns a deep clone of this ALocalDecl node.
 ALocalDecl clone(Map<Node,Node> oldToNewMap)
          Creates a deep clone of this ALocalDecl node while putting all old node-new node relations in the map oldToNewMap.
<T extends NodeInterface>
void
getChildren(Collection<T> collection, NodeFilter<T> filter)
          Adds all children of this ALocalDecl node that are accepted by the NodeFilter filter to collection.
 boolean getDeclared()
          Returns the declared field of this ALocalDecl node.
<T extends NodeInterface>
void
getDescendants(Collection<T> collection, NodeFilter<T> filter)
          Adds all descendants of this ALocalDecl node (including the node itself) that are accepted by the NodeFilter filter to collection.
 int getIndex()
          Returns the index field of this ALocalDecl node.
 TIdentifier getName()
          Returns the TIdentifier node which is the name child of this ALocalDecl node.
 EDecl kindPDecl()
          Returns the EDecl corresponding to the type of this PDecl node.
 void setDeclared(boolean value)
          Sets the declared field of this ALocalDecl node.
 void setIndex(int value)
          Sets the index field of this ALocalDecl node.
 void setName(TIdentifier value)
          Sets the name child of this ALocalDecl node.
 String toString()
          Returns a textual representation of this ALocalDecl node.
 
Methods inherited from class tip.node.PDecl
kindNode
 
Methods inherited from class tip.node.Node
getAncestor, getAncestor, getAncestor, getChildren, getChildren, getDescendants, getDescendants, getDescendants, isOptionalInvariant, parent, replaceBy, setOptionalInvariant
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ALocalDecl

public ALocalDecl()
Creates a new ALocalDecl node with no children.


ALocalDecl

public ALocalDecl(TIdentifier _name_)
Creates a new ALocalDecl node with the given nodes as children. The basic child nodes are removed from their previous parents.

Parameters:
_name_ - the TIdentifier node for the Name child of this ALocalDecl node

ALocalDecl

public ALocalDecl(TIdentifier _name_,
                  boolean _declared_,
                  int _index_)
Creates a new ALocalDecl node with the given nodes as children. The basic child nodes are removed from their previous parents.

Parameters:
_name_ - the TIdentifier node for the Name child of this ALocalDecl node
_declared_ - the Declared child of this ALocalDecl node
_index_ - the Index child of this ALocalDecl node
Method Detail

clone

public ALocalDecl clone()
Returns a deep clone of this ALocalDecl node.

Specified by:
clone in interface NodeInterface
Specified by:
clone in class PDecl
Returns:
a deep clone of this ALocalDecl node

clone

public ALocalDecl clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this ALocalDecl node while putting all old node-new node relations in the map oldToNewMap.

Specified by:
clone in interface NodeInterface
Specified by:
clone in class PDecl
Parameters:
oldToNewMap - the map filled with the old node-new node relation
Returns:
a deep clone of this ALocalDecl node

toString

public String toString()
Returns a textual representation of this ALocalDecl node.

Overrides:
toString in class Object
Returns:
a textual representation of this ALocalDecl node

kindPDecl

public EDecl kindPDecl()
Returns the EDecl corresponding to the type of this PDecl node.

Specified by:
kindPDecl in class PDecl
Returns:
the EDecl for this node

getName

public TIdentifier getName()
Returns the TIdentifier node which is the name child of this ALocalDecl node.

Specified by:
getName in class PDecl
Returns:
the TIdentifier node which is the name child of this ALocalDecl node

setName

public void setName(TIdentifier value)
Sets the name child of this ALocalDecl node.

Specified by:
setName in class PDecl
Parameters:
value - the new name child of this ALocalDecl node

getDeclared

public boolean getDeclared()
Returns the declared field of this ALocalDecl node.

Returns:
the declared field of this ALocalDecl node

setDeclared

public void setDeclared(boolean value)
Sets the declared field of this ALocalDecl node.

Parameters:
value - the new declared field of this ALocalDecl node

getIndex

public int getIndex()
Returns the index field of this ALocalDecl node.

Specified by:
getIndex in class PDecl
Returns:
the index field of this ALocalDecl node

setIndex

public void setIndex(int value)
Sets the index field of this ALocalDecl node.

Specified by:
setIndex in class PDecl
Parameters:
value - the new index field of this ALocalDecl node

getDescendants

public <T extends NodeInterface> void getDescendants(Collection<T> collection,
                                                     NodeFilter<T> filter)
Adds all descendants of this ALocalDecl node (including the node itself) that are accepted by the NodeFilter filter to collection.

Specified by:
getDescendants in interface NodeInterface
Specified by:
getDescendants in class Node
Parameters:
collection - the collection to which the descendants are added
filter - the NodeFilter used

getChildren

public <T extends NodeInterface> void getChildren(Collection<T> collection,
                                                  NodeFilter<T> filter)
Adds all children of this ALocalDecl node that are accepted by the NodeFilter filter to collection.

Specified by:
getChildren in interface NodeInterface
Specified by:
getChildren in class Node
Parameters:
collection - the collection to which the children are added
filter - the NodeFilter used

checkOptionalInvariant

public void checkOptionalInvariant()
Specified by:
checkOptionalInvariant in interface NodeInterface
Specified by:
checkOptionalInvariant in class Node

apply

public void apply(Analysis caller)
Calls the Analysis.caseALocalDecl(ALocalDecl) of the Analysis caller.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
sw - the Analysis to which this ALocalDecl node is applied

apply

public <A> A apply(Answer<A> caller)
Returns the answer for caller by applying this ALocalDecl node to the Answer visitor.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the Answer to which this node is applied
Returns:
the answer as returned from caller

apply

public <Q> void apply(Question<Q> caller,
                      Q question)
Applies this ALocalDecl node to the Question visitor caller.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the Question to which this node is applied
question - the question provided to caller

apply

public <Q,A> A apply(QuestionAnswer<Q,A> caller,
                     Q question)
Returns the answer for caller by applying this ALocalDecl node with the question to the QuestionAnswer visitor.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the QuestionAnswer to which this node is applied
question - the question provided to caller
Returns:
the answer as returned from caller