Package org.intocps.maestro.ast
Class AFunctionDeclaration
java.lang.Object
org.intocps.maestro.ast.node.Node
org.intocps.maestro.ast.PDeclarationBase
org.intocps.maestro.ast.AFunctionDeclaration
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<org.intocps.maestro.ast.node.INode>,org.intocps.maestro.ast.node.INode,PDeclaration
Generated file by AST Creator
- Author:
- Kenneth Lausdahl
- See Also:
-
Field Summary
Fields inherited from class org.intocps.maestro.ast.PDeclarationBase
_nameFields inherited from class org.intocps.maestro.ast.node.Node
_visitedNodes -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default constructorAFunctionDeclarationnode with no children.AFunctionDeclaration(LexIdentifier name_, org.intocps.maestro.ast.node.PType returnType_, List<? extends org.intocps.maestro.ast.node.AFormalParameter> formals_) Deprecated.This method should not be used, use AstFactory instead. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.intocps.maestro.ast.analysis.intf.IAnalysis caller) Calls theIAnalysis.caseAFunctionDeclaration(AFunctionDeclaration)of theIAnalysiscaller.<A> Aapply(org.intocps.maestro.ast.analysis.intf.IAnswer<A> caller) Calls theIAnswer.caseAFunctionDeclaration(AFunctionDeclaration)of theIAnswercaller.<Q> voidapply(org.intocps.maestro.ast.analysis.intf.IQuestion<Q> caller, Q question) Calls theIQuestion.caseAFunctionDeclaration(AFunctionDeclaration, Object)of theIQuestioncaller.<Q,A> A apply(org.intocps.maestro.ast.analysis.intf.IQuestionAnswer<Q, A> caller, Q question) Calls theIQuestionAnswer.caseAFunctionDeclaration(AFunctionDeclaration, Object)of theIQuestionAnswercaller.clone()Returns a deep clone of thisAFunctionDeclarationnode.Creates a deep clone of thisAFunctionDeclarationnode while putting all old node-new node relations in the mapoldToNewMap.booleanEssentially this.toString().equals(o.toString()).getChildren(Boolean includeInheritedFields) Creates a map of all field names and their valueLinkedList<org.intocps.maestro.ast.node.AFormalParameter> org.intocps.maestro.ast.node.PTypeinthashCode()Forwarding hashCode call toObject.hashCode().voidremoveChild(org.intocps.maestro.ast.node.INode child) voidsetFormals(List<? extends org.intocps.maestro.ast.node.AFormalParameter> value) Sets the_formalschild of thisAFunctionDeclarationnode.voidsetReturnType(org.intocps.maestro.ast.node.PType value) Sets the_returnTypechild of thisAFunctionDeclarationnode.toString()Methods inherited from class org.intocps.maestro.ast.PDeclarationBase
getName, setNameMethods inherited from class org.intocps.maestro.ast.node.Node
cloneList, cloneList, cloneListExternal, cloneListExternal, cloneListList, cloneListList, cloneNode, cloneNode, compareTo, getAllFields, getAncestor, parent, parent, replaceChildMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.intocps.maestro.ast.node.INode
getAncestor, parent, parent, replaceChild
-
Constructor Details
-
AFunctionDeclaration
public AFunctionDeclaration()Creates a new default constructorAFunctionDeclarationnode with no children. -
AFunctionDeclaration
public AFunctionDeclaration(LexIdentifier name_, org.intocps.maestro.ast.node.PType returnType_, List<? extends org.intocps.maestro.ast.node.AFormalParameter> formals_) Deprecated.This method should not be used, use AstFactory instead. The basic child nodes are removed from their previous parents.Creates a new complete constructorAFunctionDeclarationnode with the given nodes as children.- Parameters:
returnType_- thePTypenode for thereturnTypechild of thisAFunctionDeclarationnodeformals_- theNodeListnode for theformalschild of thisAFunctionDeclarationnode
-
-
Method Details
-
clone
Returns a deep clone of thisAFunctionDeclarationnode.- Specified by:
clonein interfaceorg.intocps.maestro.ast.node.INode- Specified by:
clonein interfacePDeclaration- Specified by:
clonein classPDeclarationBase- Returns:
- a deep clone of this
AFunctionDeclarationnode
-
hashCode
public int hashCode()Forwarding hashCode call toObject.hashCode().- Specified by:
hashCodein interfacePDeclaration- Overrides:
hashCodein classPDeclarationBase
-
toString
- Specified by:
toStringin interfacePDeclaration- Overrides:
toStringin classPDeclarationBase
-
clone
public AFunctionDeclaration clone(Map<org.intocps.maestro.ast.node.INode, org.intocps.maestro.ast.node.INode> oldToNewMap) Creates a deep clone of thisAFunctionDeclarationnode while putting all old node-new node relations in the mapoldToNewMap.- Specified by:
clonein interfaceorg.intocps.maestro.ast.node.INode- Specified by:
clonein interfacePDeclaration- Specified by:
clonein classPDeclarationBase- Parameters:
oldToNewMap- the map filled with the old node-new node relation- Returns:
- a deep clone of this
AFunctionDeclarationnode
-
equals
Essentially this.toString().equals(o.toString()).- Specified by:
equalsin interfacePDeclaration- Overrides:
equalsin classPDeclarationBase
-
removeChild
public void removeChild(org.intocps.maestro.ast.node.INode child) Removes theINodechildas a child of thisAFunctionDeclarationnode. Do not call this method with any graph fields of this node. This will cause any child's with the same reference to be removed unintentionally orRuntimeExceptionwill be thrown.- Specified by:
removeChildin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
removeChildin interfacePDeclaration- Overrides:
removeChildin classPDeclarationBase- Parameters:
child- the child node to be removed from thisAFunctionDeclarationnode- Throws:
RuntimeException- ifchildis not a child of thisAFunctionDeclarationnode
-
getChildren
Creates a map of all field names and their value- Specified by:
getChildrenin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
getChildrenin interfacePDeclaration- Overrides:
getChildrenin classPDeclarationBase- Parameters:
includeInheritedFields- if true all inherited fields are included- Returns:
- a a map of names to values of all fields
-
setReturnType
public void setReturnType(org.intocps.maestro.ast.node.PType value) Sets the_returnTypechild of thisAFunctionDeclarationnode.- Parameters:
value- the new_returnTypechild of thisAFunctionDeclarationnode
-
getReturnType
public org.intocps.maestro.ast.node.PType getReturnType()- Returns:
- the
PTypenode which is the_returnTypechild of thisAFunctionDeclarationnode
-
setFormals
Sets the_formalschild of thisAFunctionDeclarationnode.- Parameters:
value- the new_formalschild of thisAFunctionDeclarationnode
-
getFormals
- Returns:
- the
LinkedListnode which is the_formalschild of thisAFunctionDeclarationnode
-
apply
public void apply(org.intocps.maestro.ast.analysis.intf.IAnalysis caller) throws org.intocps.maestro.ast.analysis.AnalysisException Calls theIAnalysis.caseAFunctionDeclaration(AFunctionDeclaration)of theIAnalysiscaller.- Specified by:
applyin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
applyin classorg.intocps.maestro.ast.node.Node- Parameters:
caller- theIAnalysisto which thisAFunctionDeclarationnode is applied- Throws:
org.intocps.maestro.ast.analysis.AnalysisException
-
apply
public <A> A apply(org.intocps.maestro.ast.analysis.intf.IAnswer<A> caller) throws org.intocps.maestro.ast.analysis.AnalysisException Calls theIAnswer.caseAFunctionDeclaration(AFunctionDeclaration)of theIAnswercaller.- Specified by:
applyin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
applyin classorg.intocps.maestro.ast.node.Node- Parameters:
caller- theIAnswerto which thisAFunctionDeclarationnode is applied- Returns:
- the answer as returned from
caller - Throws:
org.intocps.maestro.ast.analysis.AnalysisException
-
apply
public <Q> void apply(org.intocps.maestro.ast.analysis.intf.IQuestion<Q> caller, Q question) throws org.intocps.maestro.ast.analysis.AnalysisException Calls theIQuestion.caseAFunctionDeclaration(AFunctionDeclaration, Object)of theIQuestioncaller.- Specified by:
applyin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
applyin classorg.intocps.maestro.ast.node.Node- Parameters:
caller- theIQuestionto which thisAFunctionDeclarationnode is appliedquestion- the question provided tocaller- Throws:
org.intocps.maestro.ast.analysis.AnalysisException
-
apply
public <Q,A> A apply(org.intocps.maestro.ast.analysis.intf.IQuestionAnswer<Q, A> caller, Q question) throws org.intocps.maestro.ast.analysis.AnalysisExceptionCalls theIQuestionAnswer.caseAFunctionDeclaration(AFunctionDeclaration, Object)of theIQuestionAnswercaller.- Specified by:
applyin interfaceorg.intocps.maestro.ast.node.INode- Specified by:
applyin classorg.intocps.maestro.ast.node.Node- Parameters:
caller- theIQuestionAnswerto which thisAFunctionDeclarationnode is appliedquestion- the question provided tocaller- Returns:
- the answer as returned from
answer - Throws:
org.intocps.maestro.ast.analysis.AnalysisException
-