Class InlineFunction

java.lang.Object
org.jfuncmachine.compiler.model.InlineFunction
Direct Known Subclasses:
SingleInstructionInline

public abstract class InlineFunction extends Object
The base class for inline functions (functions where the instructions are directly inserted into the byte code rather than generating a function call)
  • Field Details

    • parameterTypes

      public final Type[] parameterTypes
      The types of each function parameter
    • returnType

      public final Type returnType
      The return type of the function
  • Constructor Details

    • InlineFunction

      public InlineFunction(Type[] parameterTypes, Type returnType)
      Create an inline function
      Parameters:
      parameterTypes - The types of each function parameter
      returnType - The return type of the function
  • Method Details

    • getReturnType

      public Type getReturnType()
      Get the return type of the function
      Returns:
      The return type of this function
    • generate

      public abstract void generate(ClassGenerator generator, Environment env)
      Generate the byte code for the function
      Parameters:
      generator - The class generator current being used to generate the class
      env - The symbol environment available to this function