|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.node.Node
tip.node.PProgram
tip.node.AProgram
public final class AProgram
AProgram
represents the alternative of the
program
production in the AST.
Constructor Summary | |
---|---|
AProgram()
Creates a new AProgram node with no children. |
|
AProgram(List<? extends AFuncDecl> _functions_)
Creates a new AProgram node with the given nodes as children. |
|
AProgram(List<? extends AFuncDecl> _functions_,
int[] _code_,
Map<String,AFuncDecl> _function_env_)
Creates a new AProgram node with the given nodes as children. |
Method Summary | ||
---|---|---|
void |
apply(Analysis caller)
Calls the Analysis.caseAProgram(AProgram) of the Analysis caller . |
|
|
apply(Answer<A> caller)
Returns the answer for caller by applying this AProgram
node to the Answer visitor. |
|
|
apply(Question<Q> caller,
Q question)
Applies this AProgram node to the Question visitor caller . |
|
|
apply(QuestionAnswer<Q,A> caller,
Q question)
Returns the answer for caller by applying this AProgram node with the
question to the QuestionAnswer visitor. |
|
void |
checkOptionalInvariant()
|
|
AProgram |
clone()
Returns a deep clone of this AProgram node. |
|
AProgram |
clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this AProgram node while putting all
old node-new node relations in the map oldToNewMap . |
|
|
getChildren(Collection<T> collection,
NodeFilter<T> filter)
Adds all children of this AProgram node that are
accepted by the NodeFilter filter to collection . |
|
int[] |
getCode()
Returns the code field of this AProgram node. |
|
|
getDescendants(Collection<T> collection,
NodeFilter<T> filter)
Adds all descendants of this AProgram node (including the node itself) that are
accepted by the NodeFilter filter to collection . |
|
Map<String,AFuncDecl> |
getFunctionEnv()
Returns the function_env field of this AProgram node. |
|
LinkedList<AFuncDecl> |
getFunctions()
Returns the possibly empty list of AFuncDecl nodes that are the functions children of this AProgram node. |
|
void |
setCode(int[] value)
Sets the code field of this AProgram node. |
|
void |
setFunctionEnv(Map<String,AFuncDecl> value)
Sets the function_env field of this AProgram node. |
|
void |
setFunctions(List<? extends AFuncDecl> value)
Sets the functions children of this AProgram node. |
|
String |
toString()
Returns a textual representation of this AProgram node. |
Methods inherited from class tip.node.PProgram |
---|
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 AProgram()
AProgram
node with no children.
public AProgram(List<? extends AFuncDecl> _functions_)
AProgram
node with the given nodes as children.
The basic child nodes are removed from their previous parents.
_functions_
- the list of AFuncDecl
nodes for the Functions
children of this AProgram
nodepublic AProgram(List<? extends AFuncDecl> _functions_, int[] _code_, Map<String,AFuncDecl> _function_env_)
AProgram
node with the given nodes as children.
The basic child nodes are removed from their previous parents.
_functions_
- the list of AFuncDecl
nodes for the Functions
children of this AProgram
node_code_
- the Code
child of this AProgram
node_function_env_
- the FunctionEnv
child of this AProgram
nodeMethod Detail |
---|
public AProgram clone()
AProgram
node.
clone
in interface NodeInterface
clone
in class PProgram
AProgram
nodepublic AProgram clone(Map<Node,Node> oldToNewMap)
AProgram
node while putting all
old node-new node relations in the map oldToNewMap
.
clone
in interface NodeInterface
clone
in class PProgram
oldToNewMap
- the map filled with the old node-new node relation
AProgram
nodepublic String toString()
AProgram
node.
toString
in class Object
AProgram
nodepublic LinkedList<AFuncDecl> getFunctions()
AFuncDecl
nodes that are the functions
children of this AProgram
node.
getFunctions
in class PProgram
AFuncDecl
nodes that are the functions
children of this AProgram
nodepublic void setFunctions(List<? extends AFuncDecl> value)
functions
children of this AProgram
node.
setFunctions
in class PProgram
value
- the new functions
children of this AProgram
nodepublic int[] getCode()
code
field of this AProgram
node.
getCode
in class PProgram
code
field of this AProgram
nodepublic void setCode(int[] value)
code
field of this AProgram
node.
setCode
in class PProgram
value
- the new code
field of this AProgram
nodepublic Map<String,AFuncDecl> getFunctionEnv()
function_env
field of this AProgram
node.
getFunctionEnv
in class PProgram
function_env
field of this AProgram
nodepublic void setFunctionEnv(Map<String,AFuncDecl> value)
function_env
field of this AProgram
node.
setFunctionEnv
in class PProgram
value
- the new function_env
field of this AProgram
nodepublic <T extends NodeInterface> void getDescendants(Collection<T> collection, NodeFilter<T> filter)
AProgram
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)
AProgram
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.caseAProgram(AProgram)
of the Analysis
caller
.
apply
in interface NodeInterface
apply
in class Node
sw
- the Analysis
to which this AProgram
node is appliedpublic <A> A apply(Answer<A> caller)
caller
by applying this AProgram
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)
AProgram
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 AProgram
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 |