|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.node.Node
tip.node.PStm
tip.node.AWhileStm
public final class AWhileStm
AWhileStm
represents the while
alternative of the stm
production in the AST.
Constructor Summary | |
---|---|
AWhileStm()
Creates a new AWhileStm node with no children. |
|
AWhileStm(TLPar _token_,
PExp _condition_,
PStm _body_)
Creates a new AWhileStm node with the given nodes as children. |
Method Summary | ||
---|---|---|
void |
apply(Analysis caller)
Calls the Analysis.caseAWhileStm(AWhileStm) of the Analysis caller . |
|
|
apply(Answer<A> caller)
Returns the answer for caller by applying this AWhileStm
node to the Answer visitor. |
|
|
apply(Question<Q> caller,
Q question)
Applies this AWhileStm node to the Question visitor caller . |
|
|
apply(QuestionAnswer<Q,A> caller,
Q question)
Returns the answer for caller by applying this AWhileStm node with the
question to the QuestionAnswer visitor. |
|
void |
checkOptionalInvariant()
|
|
AWhileStm |
clone()
Returns a deep clone of this AWhileStm node. |
|
AWhileStm |
clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this AWhileStm node while putting all
old node-new node relations in the map oldToNewMap . |
|
PStm |
getBody()
Returns the PStm node which is the body child of this AWhileStm node. |
|
|
getChildren(Collection<T> collection,
NodeFilter<T> filter)
Adds all children of this AWhileStm node that are
accepted by the NodeFilter filter to collection . |
|
PExp |
getCondition()
Returns the PExp node which is the condition child of this AWhileStm node. |
|
|
getDescendants(Collection<T> collection,
NodeFilter<T> filter)
Adds all descendants of this AWhileStm node (including the node itself) that are
accepted by the NodeFilter filter to collection . |
|
TLPar |
getToken()
Returns the TLPar node which is the token child of this AWhileStm node. |
|
EStm |
kindPStm()
Returns the EStm corresponding to the
type of this PStm node. |
|
void |
setBody(PStm value)
Sets the body child of this AWhileStm node. |
|
void |
setCondition(PExp value)
Sets the condition child of this AWhileStm node. |
|
void |
setToken(TLPar value)
Sets the token child of this AWhileStm node. |
|
String |
toString()
Returns a textual representation of this AWhileStm node. |
Methods inherited from class tip.node.PStm |
---|
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 AWhileStm()
AWhileStm
node with no children.
public AWhileStm(TLPar _token_, PExp _condition_, PStm _body_)
AWhileStm
node with the given nodes as children.
The basic child nodes are removed from their previous parents.
_token_
- the TLPar
node for the Token
child of this AWhileStm
node_condition_
- the PExp
node for the Condition
child of this AWhileStm
node_body_
- the PStm
node for the Body
child of this AWhileStm
nodeMethod Detail |
---|
public AWhileStm clone()
AWhileStm
node.
clone
in interface NodeInterface
clone
in class PStm
AWhileStm
nodepublic AWhileStm clone(Map<Node,Node> oldToNewMap)
AWhileStm
node while putting all
old node-new node relations in the map oldToNewMap
.
clone
in interface NodeInterface
clone
in class PStm
oldToNewMap
- the map filled with the old node-new node relation
AWhileStm
nodepublic String toString()
AWhileStm
node.
toString
in class Object
AWhileStm
nodepublic EStm kindPStm()
EStm
corresponding to the
type of this PStm
node.
kindPStm
in class PStm
EStm
for this nodepublic TLPar getToken()
TLPar
node which is the token
child of this AWhileStm
node.
getToken
in class PStm
TLPar
node which is the token
child of this AWhileStm
nodepublic void setToken(TLPar value)
token
child of this AWhileStm
node.
value
- the new token
child of this AWhileStm
nodepublic PExp getCondition()
PExp
node which is the condition
child of this AWhileStm
node.
PExp
node which is the condition
child of this AWhileStm
nodepublic void setCondition(PExp value)
condition
child of this AWhileStm
node.
value
- the new condition
child of this AWhileStm
nodepublic PStm getBody()
PStm
node which is the body
child of this AWhileStm
node.
PStm
node which is the body
child of this AWhileStm
nodepublic void setBody(PStm value)
body
child of this AWhileStm
node.
value
- the new body
child of this AWhileStm
nodepublic <T extends NodeInterface> void getDescendants(Collection<T> collection, NodeFilter<T> filter)
AWhileStm
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)
AWhileStm
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.caseAWhileStm(AWhileStm)
of the Analysis
caller
.
apply
in interface NodeInterface
apply
in class Node
sw
- the Analysis
to which this AWhileStm
node is appliedpublic <A> A apply(Answer<A> caller)
caller
by applying this AWhileStm
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)
AWhileStm
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 AWhileStm
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 |