Class FunctionDecl


public final class FunctionDecl extends Symbol
Represents a function declaration (function symbol). If the function is overloaded, it will serve as a singly linked list.
  • Constructor Details

    • FunctionDecl

      public FunctionDecl(int position, Modifiers modifiers, String name, List<Variable> parameters, Type returnType, boolean builtin, boolean entryPoint, int intrinsicKind)
  • Method Details

    • convert

      @Nullable public static FunctionDecl convert(@Nonnull Context context, int pos, @Nonnull Modifiers modifiers, @Nonnull String name, @Nonnull List<Variable> parameters, @Nonnull Type returnType)
    • getKind

      @Nonnull public Node.SymbolKind getKind()
      Specified by:
      getKind in class Symbol
      See Also:
    • getType

      @Nonnull public Type getType()
      Specified by:
      getType in class Symbol
    • getReturnType

      @Nonnull public Type getReturnType()
    • getIntrinsicKind

      public int getIntrinsicKind()
    • isIntrinsic

      public boolean isIntrinsic()
    • getDefinition

      public FunctionDefinition getDefinition()
    • setDefinition

      public void setDefinition(FunctionDefinition definition)
    • getParameters

      public List<Variable> getParameters()
    • getMangledName

      @Nonnull public String getMangledName()
    • getNextOverload

      @Nullable public FunctionDecl getNextOverload()
    • setNextOverload

      public void setNextOverload(FunctionDecl overload)
      Sets the previously defined function symbol with the same function name.
    • getModifiers

      public Modifiers getModifiers()
    • isBuiltin

      public boolean isBuiltin()
    • isEntryPoint

      public boolean isEntryPoint()
    • resolveParameterTypes

      @Nullable public Type resolveParameterTypes(@Nonnull List<Expression> arguments, List<Type> outParameterTypes)
    • toString

      @Nonnull public String toString()
      Specified by:
      toString in class Node
      Returns:
      a string representation of this AST node