Class FunctionType

    • Method Detail

      • hashCodeImpl

        protected int hashCodeImpl()
        Specified by:
        hashCodeImpl in class Type
      • equalsImpl

        protected boolean equalsImpl​(Type arg)
        Specified by:
        equalsImpl in class Type
      • asFunction

        public FunctionType asFunction()
        Description copied from class: Type
        Casts this to a FunctionType or returns null if not a FunctionType.
        Overrides:
        asFunction in class Type
      • getReturnType

        public Type getReturnType()
        Returns the return type of this function.
      • getNumArguments

        public int getNumArguments()
      • getArgumentName

        public String getArgumentName​(int i)
        Returns the name of the ith argument. May return null if no argument names were available during parsing.
      • getArgumentType

        public Type getArgumentType​(int i)
        Returns the type of the ith argument.
      • getParameterList

        public StringBuilder getParameterList​(StringBuilder buf,
                                              boolean useTypedef,
                                              String callingConvention)
        Returns the function parameter list, i.e. a comma separated list of argument type and name.
        Parameters:
        buf - StringBuilder instance
        useTypedef - if true and type is typedef'ed, use its name
        callingConvention - optional calling-convention
        Returns:
        given StringBuilder instance
      • getParameterList

        public StringBuilder getParameterList​(StringBuilder buf,
                                              boolean useTypedef,
                                              String callingConvention,
                                              List<Integer> exclude)
        Returns the function parameter list, i.e. a comma separated list of argument type and name.
        Parameters:
        buf - StringBuilder instance
        useTypedef - if true and type is typedef'ed, use its name
        callingConvention - optional calling-convention
        exclude - optional list of excluded parameter indices
        Returns:
        given StringBuilder instance
      • addArgument

        public void addArgument​(Type argumentType,
                                String argumentName)
        Add an argument's name and type. Use null for unknown argument names.
      • setArgumentName

        public void setArgumentName​(int i,
                                    String name)
      • toString

        public String toString()
        Description copied from class: Type
        Returns a string representation of this type. The returned string is suitable for use as a type specifier for native C. It does contain an expanded description of structs/unions, hence may not be suitable for type declarations.
        Overrides:
        toString in class Type
      • toString

        public String toString​(String functionName,
                               boolean emitNativeTag)
      • toString

        public String toString​(String functionName,
                               boolean emitNativeTag,
                               boolean isPointer)
      • toString

        public String toString​(String functionName,
                               String callingConvention,
                               boolean emitNativeTag,
                               boolean isPointer)
      • visit

        public void visit​(TypeVisitor arg)
        Description copied from class: Type
        Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
        Overrides:
        visit in class Type