Package util.demangler
Class GenericDemangledFunction
- java.lang.Object
-
- util.demangler.GenericDemangledObject
-
- util.demangler.GenericDemangledFunction
-
- All Implemented Interfaces:
ParameterReceiver
- Direct Known Subclasses:
GenericDemangledMethod
public class GenericDemangledFunction extends GenericDemangledObject implements ParameterReceiver
A class to represent a demangled function.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcallingConventionprotected booleanisOverloadedOperatorprotected java.util.List<GenericDemangledDataType>parameterListprotected GenericDemangledDataTypereturnTypeprotected GenericDemangledTemplatetemplateprotected booleanthisPassedOnStack-
Fields inherited from class util.demangler.GenericDemangledObject
AT, basedName, EMPTY_STRING, isConst, isPointer64, isRestrict, isStatic, isStruct, isThunk, isUnaligned, isUnsigned, isVirtual, isVolatile, memberScope, name, namespace, NAMESPACE_SEPARATOR, originalMangled, SPACE, specialMidfix, specialPrefix, specialSuffix, storageClass, visibility
-
-
Constructor Summary
Constructors Constructor Description GenericDemangledFunction(java.lang.String name)Constructs a new demangled function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(GenericDemangledDataType parameter)Adds the specified parameter to this object.java.lang.StringgetCallingConvention()Returns the calling convention or null, if unspecified.java.util.List<GenericDemangledDataType>getParameters()Returns the parameters added to this object.java.lang.StringgetParameterString()GenericDemangledDataTypegetReturnType()Returns the return type or null, if unspecified.java.lang.StringgetSignature(boolean format)Returns a complete signature for the demangled symbol.GenericDemangledTemplategetTemplate()booleanisOverloadedOperator()booleanisPassedOnStack()booleanisVirtual()voidsetCallingConvention(java.lang.String callingConvention)Sets the function calling convention.voidsetOverloadedOperator(boolean isOverloadedOperator)Sets whether this demangled function represents an overloaded operator.voidsetReturnType(GenericDemangledDataType returnType)Sets the function return type.voidsetTemplate(GenericDemangledTemplate template)voidsetTemplatedConstructorType(java.lang.String type)Special constructor where it has a templated type before the parameter listvoidsetThisPassedOnStack(boolean thisPassedOnStack)'this' is passed on the stack or false if in a registervoidsetVirtual()-
Methods inherited from class util.demangler.GenericDemangledObject
generatePlateComment, getBasedName, getMemberScope, getName, getNamespace, getOriginalMangled, getSpecialMidfix, getSpecialPrefix, getSpecialSuffix, getStorageClass, getVisibility, isConst, isPointer64, isRestrict, isStatic, isThunk, isUnaligned, isVolatile, pad, setBasedName, setConst, setMemberScope, setName, setNamespace, setOriginalMangled, setPointer64, setRestrict, setSignature, setSpecialMidfix, setSpecialPrefix, setSpecialSuffix, setStatic, setStorageClass, setStruct, setThunk, setUnaligned, setUnsigned, setVirtual, setVisibilty, setVolatile, toString
-
-
-
-
Field Detail
-
returnType
protected GenericDemangledDataType returnType
-
callingConvention
protected java.lang.String callingConvention
-
thisPassedOnStack
protected boolean thisPassedOnStack
-
parameterList
protected java.util.List<GenericDemangledDataType> parameterList
-
template
protected GenericDemangledTemplate template
-
isOverloadedOperator
protected boolean isOverloadedOperator
-
-
Constructor Detail
-
GenericDemangledFunction
public GenericDemangledFunction(java.lang.String name) throws GenericDemangledExceptionConstructs a new demangled function.- Parameters:
name- the name of the function- Throws:
GenericDemangledException
-
-
Method Detail
-
setReturnType
public void setReturnType(GenericDemangledDataType returnType)
Sets the function return type.- Parameters:
returnType- the function return type
-
setCallingConvention
public void setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention. For example, "__cdecl".- Parameters:
callingConvention- the function calling convention
-
setThisPassedOnStack
public void setThisPassedOnStack(boolean thisPassedOnStack)
'this' is passed on the stack or false if in a register
-
isPassedOnStack
public boolean isPassedOnStack()
-
setTemplate
public void setTemplate(GenericDemangledTemplate template)
-
getTemplate
public GenericDemangledTemplate getTemplate()
-
setVirtual
public void setVirtual()
-
isVirtual
public boolean isVirtual()
- Overrides:
isVirtualin classGenericDemangledObject
-
setOverloadedOperator
public void setOverloadedOperator(boolean isOverloadedOperator)
Sets whether this demangled function represents an overloaded operator. For example, "operator+()".- Parameters:
isOverloadedOperator- true if overloaded operator
-
isOverloadedOperator
public boolean isOverloadedOperator()
-
addParameter
public void addParameter(GenericDemangledDataType parameter)
Description copied from interface:ParameterReceiverAdds the specified parameter to this object.- Specified by:
addParameterin interfaceParameterReceiver- Parameters:
parameter- the parameter to add- See Also:
ParameterReceiver
-
getParameters
public java.util.List<GenericDemangledDataType> getParameters()
Description copied from interface:ParameterReceiverReturns the parameters added to this object.- Specified by:
getParametersin interfaceParameterReceiver- Returns:
- the parameters added to this object
- See Also:
ParameterReceiver
-
getReturnType
public GenericDemangledDataType getReturnType()
Returns the return type or null, if unspecified.- Returns:
- the return type or null, if unspecified
-
getCallingConvention
public java.lang.String getCallingConvention()
Returns the calling convention or null, if unspecified.- Returns:
- the calling convention or null, if unspecified
-
setTemplatedConstructorType
public void setTemplatedConstructorType(java.lang.String type)
Special constructor where it has a templated type before the parameter list
-
getSignature
public java.lang.String getSignature(boolean format)
Description copied from class:GenericDemangledObjectReturns a complete signature for the demangled symbol. For example: "unsigned long foo" "unsigned char * ClassA::getFoo(float, short *)" "void * getBar(int **, MyStruct &)" Note: based on the underlying mangling scheme, the return type may or may not be specified in the signature.- Specified by:
getSignaturein classGenericDemangledObject- Parameters:
format- true if signature should be pretty printed- Returns:
- a complete signature for the demangled symbol
-
getParameterString
public java.lang.String getParameterString()
-
-