public class FunctionSymbol extends Object
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)
;
Constructor and Description |
---|
FunctionSymbol(String name,
FunctionType type) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Type argumentType,
String argumentName)
Add an argument's name and type.
|
boolean |
equals(Object arg) |
String |
getArgumentName(int i)
Returns the name of the ith argument.
|
Type |
getArgumentType(int i)
Returns the type of the ith argument.
|
String |
getName() |
int |
getNumArguments() |
Type |
getReturnType()
Returns the return type of this function.
|
FunctionType |
getType()
Returns the type of this function.
|
int |
hashCode() |
boolean |
isCompletelyEqual(Object arg)
Compares the function type as well, since
equals(Object)
and hashCode() won't. |
String |
toString() |
String |
toString(boolean emitNativeTag)
Helper routine for emitting native javadoc tags
|
public FunctionSymbol(String name, FunctionType type)
public String getName()
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 boolean isCompletelyEqual(Object arg)
equals(Object)
and hashCode()
won't.