public class FunctionSymbol extends AliasedSymbol.AliasedSymbolImpl implements TypeComparator.AliasedSemanticSymbol, ASTLocusTag.ASTLocusTagProvider
Note: Since C does not support method-overloading polymorphism like C++ or Java,
we ignore the FunctionType
attribute in equals(Object)
and hashCode()
.
Hence we assume all method occurrences w/ same name are of equal or compatible type.
Deep comparison can be performed via #isCompletelyEqual(Object o)
;
AliasedSymbol.AliasedSymbolImpl, AliasedSymbol.NoneAliasedSymbol
Constructor and Description |
---|
FunctionSymbol(String name,
FunctionType type) |
FunctionSymbol(String name,
FunctionType type,
ASTLocusTag locus) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Type argumentType,
String argumentName)
Add an argument's name and type.
|
static FunctionSymbol |
cloneWithDeepAliases(FunctionSymbol o)
Shallow'ish copy, only aliased names are re-created.
|
static boolean |
containsExactly(List<FunctionSymbol> l,
FunctionSymbol s) |
boolean |
equals(Object arg) |
boolean |
equalSemantics(TypeComparator.SemanticEqualityOp arg)
Semantic equality test for Types exclusive its given
name . |
static int |
exactIndexOf(List<FunctionSymbol> l,
FunctionSymbol s) |
boolean |
exactlyEqual(Object arg)
Compares the function type as well, since
equals(Object)
and hashCode() won't. |
String |
getArgumentName(int i)
Returns the name of the ith argument.
|
Type |
getArgumentType(int i)
Returns the type of the ith argument.
|
ASTLocusTag |
getASTLocusTag()
Returns this instance's
ASTLocusTag , if available,
otherwise returns null . |
int |
getNumArguments() |
Type |
getReturnType()
Returns the return type of this function.
|
FunctionType |
getType()
Returns the type of this function.
|
int |
hashCode() |
int |
hashCodeSemantics()
Semantic hashcode for Types exclusive its given
name . |
String |
toString() |
String |
toString(boolean emitNativeTag)
Helper routine for emitting native javadoc tags
|
addAliasedName, getAliasedNames, getAliasedString, getName, getOrigName, hasAliases, rename
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAliasedName, getAliasedNames, getAliasedString, getName, getOrigName, hasAliases, rename
public FunctionSymbol(String name, FunctionType type)
public FunctionSymbol(String name, FunctionType type, ASTLocusTag locus)
public static FunctionSymbol cloneWithDeepAliases(FunctionSymbol o)
public ASTLocusTag getASTLocusTag()
ASTLocusTag.ASTLocusTagProvider
ASTLocusTag
, if available,
otherwise returns null
.getASTLocusTag
in interface ASTLocusTag.ASTLocusTagProvider
public FunctionType getType()
public Type getReturnType()
public int getNumArguments()
public String getArgumentName(int i)
public Type getArgumentType(int i)
public void addArgument(Type argumentType, String argumentName)
public String toString(boolean emitNativeTag)
public int hashCodeSemantics()
TypeComparator.SemanticEqualityOp
name
.hashCodeSemantics
in interface TypeComparator.SemanticEqualityOp
#equalSemantics(SemanticEqualityOp)
public final boolean equalSemantics(TypeComparator.SemanticEqualityOp arg)
TypeComparator.SemanticEqualityOp
name
.equalSemantics
in interface TypeComparator.SemanticEqualityOp
TypeComparator.SemanticEqualityOp.hashCodeSemantics()
public static boolean containsExactly(List<FunctionSymbol> l, FunctionSymbol s)
public static int exactIndexOf(List<FunctionSymbol> l, FunctionSymbol s)
public boolean exactlyEqual(Object arg)
equals(Object)
and hashCode()
won't.