|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.node.Node
tip.node.PDecl
tip.node.AFuncDecl
public final class AFuncDecl
AFuncDecl
represents the func
alternative of the decl
production in the AST.
Constructor Summary | |
---|---|
AFuncDecl()
Creates a new AFuncDecl node with no children. |
|
AFuncDecl(TIdentifier _name_,
List<? extends ALocalDecl> _formals_,
ABody _body_)
Creates a new AFuncDecl node with the given nodes as children. |
|
AFuncDecl(TIdentifier _name_,
List<? extends ALocalDecl> _formals_,
ABody _body_,
int _num_locals_,
int _num_args_,
int _index_)
Creates a new AFuncDecl node with the given nodes as children. |
Method Summary | ||
---|---|---|
void |
apply(Analysis caller)
Calls the Analysis.caseAFuncDecl(AFuncDecl) of the Analysis caller . |
|
|
apply(Answer<A> caller)
Returns the answer for caller by applying this AFuncDecl
node to the Answer visitor. |
|
|
apply(Question<Q> caller,
Q question)
Applies this AFuncDecl node to the Question visitor caller . |
|
|
apply(QuestionAnswer<Q,A> caller,
Q question)
Returns the answer for caller by applying this AFuncDecl node with the
question to the QuestionAnswer visitor. |
|
void |
checkOptionalInvariant()
|
|
AFuncDecl |
clone()
Returns a deep clone of this AFuncDecl node. |
|
AFuncDecl |
clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this AFuncDecl node while putting all
old node-new node relations in the map oldToNewMap . |
|
ABody |
getBody()
Returns the ABody node which is the body child of this AFuncDecl node. |
|
|
getChildren(Collection<T> collection,
NodeFilter<T> filter)
Adds all children of this AFuncDecl node that are
accepted by the NodeFilter filter to collection . |
|
|
getDescendants(Collection<T> collection,
NodeFilter<T> filter)
Adds all descendants of this AFuncDecl node (including the node itself) that are
accepted by the NodeFilter filter to collection . |
|
LinkedList<ALocalDecl> |
getFormals()
Returns the possibly empty list of ALocalDecl nodes that are the formals children of this AFuncDecl node. |
|
int |
getIndex()
Returns the index field of this AFuncDecl node. |
|
TIdentifier |
getName()
Returns the TIdentifier node which is the name child of this AFuncDecl node. |
|
int |
getNumArgs()
Returns the num_args field of this AFuncDecl node. |
|
int |
getNumLocals()
Returns the num_locals field of this AFuncDecl node. |
|
EDecl |
kindPDecl()
Returns the EDecl corresponding to the
type of this PDecl node. |
|
void |
setBody(ABody value)
Sets the body child of this AFuncDecl node. |
|
void |
setFormals(List<? extends ALocalDecl> value)
Sets the formals children of this AFuncDecl node. |
|
void |
setIndex(int value)
Sets the index field of this AFuncDecl node. |
|
void |
setName(TIdentifier value)
Sets the name child of this AFuncDecl node. |
|
void |
setNumArgs(int value)
Sets the num_args field of this AFuncDecl node. |
|
void |
setNumLocals(int value)
Sets the num_locals field of this AFuncDecl node. |
|
String |
toString()
Returns a textual representation of this AFuncDecl 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 |
---|
public AFuncDecl()
AFuncDecl
node with no children.
public AFuncDecl(TIdentifier _name_, List<? extends ALocalDecl> _formals_, ABody _body_)
AFuncDecl
node with the given nodes as children.
The basic child nodes are removed from their previous parents.
_name_
- the TIdentifier
node for the Name
child of this AFuncDecl
node_formals_
- the list of ALocalDecl
nodes for the Formals
children of this AFuncDecl
node_body_
- the ABody
node for the Body
child of this AFuncDecl
nodepublic AFuncDecl(TIdentifier _name_, List<? extends ALocalDecl> _formals_, ABody _body_, int _num_locals_, int _num_args_, int _index_)
AFuncDecl
node with the given nodes as children.
The basic child nodes are removed from their previous parents.
_name_
- the TIdentifier
node for the Name
child of this AFuncDecl
node_formals_
- the list of ALocalDecl
nodes for the Formals
children of this AFuncDecl
node_body_
- the ABody
node for the Body
child of this AFuncDecl
node_num_locals_
- the NumLocals
child of this AFuncDecl
node_num_args_
- the NumArgs
child of this AFuncDecl
node_index_
- the Index
child of this AFuncDecl
nodeMethod Detail |
---|
public AFuncDecl clone()
AFuncDecl
node.
clone
in interface NodeInterface
clone
in class PDecl
AFuncDecl
nodepublic AFuncDecl clone(Map<Node,Node> oldToNewMap)
AFuncDecl
node while putting all
old node-new node relations in the map oldToNewMap
.
clone
in interface NodeInterface
clone
in class PDecl
oldToNewMap
- the map filled with the old node-new node relation
AFuncDecl
nodepublic String toString()
AFuncDecl
node.
toString
in class Object
AFuncDecl
nodepublic EDecl kindPDecl()
EDecl
corresponding to the
type of this PDecl
node.
kindPDecl
in class PDecl
EDecl
for this nodepublic TIdentifier getName()
TIdentifier
node which is the name
child of this AFuncDecl
node.
getName
in class PDecl
TIdentifier
node which is the name
child of this AFuncDecl
nodepublic void setName(TIdentifier value)
name
child of this AFuncDecl
node.
setName
in class PDecl
value
- the new name
child of this AFuncDecl
nodepublic LinkedList<ALocalDecl> getFormals()
ALocalDecl
nodes that are the formals
children of this AFuncDecl
node.
ALocalDecl
nodes that are the formals
children of this AFuncDecl
nodepublic void setFormals(List<? extends ALocalDecl> value)
formals
children of this AFuncDecl
node.
value
- the new formals
children of this AFuncDecl
nodepublic ABody getBody()
ABody
node which is the body
child of this AFuncDecl
node.
ABody
node which is the body
child of this AFuncDecl
nodepublic void setBody(ABody value)
body
child of this AFuncDecl
node.
value
- the new body
child of this AFuncDecl
nodepublic int getNumLocals()
num_locals
field of this AFuncDecl
node.
num_locals
field of this AFuncDecl
nodepublic void setNumLocals(int value)
num_locals
field of this AFuncDecl
node.
value
- the new num_locals
field of this AFuncDecl
nodepublic int getNumArgs()
num_args
field of this AFuncDecl
node.
num_args
field of this AFuncDecl
nodepublic void setNumArgs(int value)
num_args
field of this AFuncDecl
node.
value
- the new num_args
field of this AFuncDecl
nodepublic int getIndex()
index
field of this AFuncDecl
node.
getIndex
in class PDecl
index
field of this AFuncDecl
nodepublic void setIndex(int value)
index
field of this AFuncDecl
node.
setIndex
in class PDecl
value
- the new index
field of this AFuncDecl
nodepublic <T extends NodeInterface> void getDescendants(Collection<T> collection, NodeFilter<T> filter)
AFuncDecl
node (including the node itself) that are
accepted by the NodeFilter
filter
to collection
.
getDescendants
in interface NodeInterface
getDescendants
in class Node
collection
- the collection to which the descendants are addedfilter
- the NodeFilter
usedpublic <T extends NodeInterface> void getChildren(Collection<T> collection, NodeFilter<T> filter)
AFuncDecl
node that are
accepted by the NodeFilter
filter
to collection
.
getChildren
in interface NodeInterface
getChildren
in class Node
collection
- the collection to which the children are addedfilter
- the NodeFilter
usedpublic void checkOptionalInvariant()
checkOptionalInvariant
in interface NodeInterface
checkOptionalInvariant
in class Node
public void apply(Analysis caller)
Analysis.caseAFuncDecl(AFuncDecl)
of the Analysis
caller
.
apply
in interface NodeInterface
apply
in class Node
sw
- the Analysis
to which this AFuncDecl
node is appliedpublic <A> A apply(Answer<A> caller)
caller
by applying this AFuncDecl
node to the Answer
visitor.
apply
in interface NodeInterface
apply
in class Node
caller
- the Answer
to which this node is applied
caller
public <Q> void apply(Question<Q> caller, Q question)
AFuncDecl
node to the Question
visitor caller
.
apply
in interface NodeInterface
apply
in class Node
caller
- the Question
to which this node is appliedquestion
- the question provided to caller
public <Q,A> A apply(QuestionAnswer<Q,A> caller, Q question)
caller
by applying this AFuncDecl
node with the
question
to the QuestionAnswer
visitor.
apply
in interface NodeInterface
apply
in class Node
caller
- the QuestionAnswer
to which this node is appliedquestion
- the question provided to caller
caller
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |