Package com.jogamp.gluegen.cgram.types
Class FunctionSymbol
java.lang.Object
com.jogamp.gluegen.cgram.types.AliasedSymbol.AliasedSymbolImpl
com.jogamp.gluegen.cgram.types.FunctionSymbol
- All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider,AliasedSymbol,TypeComparator.AliasedSemanticSymbol,TypeComparator.SemanticEqualityOp
public class FunctionSymbol
extends AliasedSymbol.AliasedSymbolImpl
implements TypeComparator.AliasedSemanticSymbol, ASTLocusTag.ASTLocusTagProvider
Describes a function symbol, which includes the name and
type. Since we are currently only concerned with processing
functions this is the only symbol type, though plausibly more
types should be added and a true symbol table constructed during parsing.
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);
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jogamp.gluegen.cgram.types.AliasedSymbol
AliasedSymbol.AliasedSymbolImpl, AliasedSymbol.NoneAliasedSymbol -
Constructor Summary
ConstructorsConstructorDescriptionFunctionSymbol(String name, FunctionType type) FunctionSymbol(String name, FunctionType type, ASTLocusTag locus) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(Type argumentType, String argumentName) Add an argument's name and type.static FunctionSymbolShallow'ish copy, only aliased names are re-created.static booleanbooleanfinal booleanSemantic equality test for Types exclusive its givenname.static intbooleanexactlyEqual(Object arg) Compares the function type as well, sinceequals(Object)andhashCode()won't.getArgumentName(int i) Returns the name of the ith argument.getArgumentType(int i) Returns the type of the ith argument.Returns this instance'sASTLocusTag, if available, otherwise returnsnull.intReturns the return type of this function.getType()Returns the type of this function.inthashCode()intSemantic hashcode for Types exclusive its givenname.toString()toString(boolean emitNativeTag) Helper routine for emitting native javadoc tagsMethods inherited from class com.jogamp.gluegen.cgram.types.AliasedSymbol.AliasedSymbolImpl
addAliasedName, getAliasedNames, getAliasedString, getName, getOrigName, hasAliases, renameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jogamp.gluegen.cgram.types.AliasedSymbol
addAliasedName, getAliasedNames, getAliasedString, getName, getOrigName, hasAliases, rename
-
Constructor Details
-
FunctionSymbol
-
FunctionSymbol
-
-
Method Details
-
cloneWithDeepAliases
Shallow'ish copy, only aliased names are re-created. -
getASTLocusTag
Description copied from interface:ASTLocusTag.ASTLocusTagProviderReturns this instance'sASTLocusTag, if available, otherwise returnsnull.- Specified by:
getASTLocusTagin interfaceASTLocusTag.ASTLocusTagProvider
-
getType
Returns the type of this function. Do not add arguments to it directly; use addArgument instead. -
getReturnType
Returns the return type of this function. -
getNumArguments
public int getNumArguments() -
getArgumentName
Returns the name of the ith argument. May return null if no argument names were available during parsing. -
getArgumentType
Returns the type of the ith argument. -
addArgument
Add an argument's name and type. Use null for unknown argument names. -
toString
-
toString
Helper routine for emitting native javadoc tags -
hashCode
public int hashCode() -
equals
-
hashCodeSemantics
public int hashCodeSemantics()Description copied from interface:TypeComparator.SemanticEqualityOpSemantic hashcode for Types exclusive its givenname.- Specified by:
hashCodeSemanticsin interfaceTypeComparator.SemanticEqualityOp- See Also:
-
equalSemantics
Description copied from interface:TypeComparator.SemanticEqualityOpSemantic equality test for Types exclusive its givenname.- Specified by:
equalSemanticsin interfaceTypeComparator.SemanticEqualityOp- See Also:
-
containsExactly
-
exactIndexOf
-
exactlyEqual
Compares the function type as well, sinceequals(Object)andhashCode()won't.
-