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.String
callingConvention
protected boolean
isOverloadedOperator
protected java.util.List<GenericDemangledDataType>
parameterList
protected GenericDemangledDataType
returnType
protected GenericDemangledTemplate
template
protected boolean
thisPassedOnStack
-
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 void
addParameter(GenericDemangledDataType parameter)
Adds the specified parameter to this object.java.lang.String
getCallingConvention()
Returns the calling convention or null, if unspecified.java.util.List<GenericDemangledDataType>
getParameters()
Returns the parameters added to this object.java.lang.String
getParameterString()
GenericDemangledDataType
getReturnType()
Returns the return type or null, if unspecified.java.lang.String
getSignature(boolean format)
Returns a complete signature for the demangled symbol.GenericDemangledTemplate
getTemplate()
boolean
isOverloadedOperator()
boolean
isPassedOnStack()
boolean
isVirtual()
void
setCallingConvention(java.lang.String callingConvention)
Sets the function calling convention.void
setOverloadedOperator(boolean isOverloadedOperator)
Sets whether this demangled function represents an overloaded operator.void
setReturnType(GenericDemangledDataType returnType)
Sets the function return type.void
setTemplate(GenericDemangledTemplate template)
void
setTemplatedConstructorType(java.lang.String type)
Special constructor where it has a templated type before the parameter listvoid
setThisPassedOnStack(boolean thisPassedOnStack)
'this' is passed on the stack or false if in a registervoid
setVirtual()
-
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 GenericDemangledException
Constructs 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:
isVirtual
in 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:ParameterReceiver
Adds the specified parameter to this object.- Specified by:
addParameter
in interfaceParameterReceiver
- Parameters:
parameter
- the parameter to add- See Also:
ParameterReceiver
-
getParameters
public java.util.List<GenericDemangledDataType> getParameters()
Description copied from interface:ParameterReceiver
Returns the parameters added to this object.- Specified by:
getParameters
in 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:GenericDemangledObject
Returns 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:
getSignature
in classGenericDemangledObject
- Parameters:
format
- true if signature should be pretty printed- Returns:
- a complete signature for the demangled symbol
-
getParameterString
public java.lang.String getParameterString()
-
-