Class ProgramCompiler

java.lang.Object
com.mackenziehigh.autumn.lang.compiler.compilers.ProgramCompiler

public final class ProgramCompiler extends Object
An instance of this class controls the compilation of an entire program.
Author:
Mackenzie High
  • Field Details

    • typesystem

      public final TypeSystem typesystem
    • symbols

      public final com.mackenziehigh.autumn.lang.compiler.compilers.SymbolTable symbols
    • checker

      public final com.mackenziehigh.autumn.lang.compiler.compilers.StaticChecker checker
    • reporter

      public final IErrorReporter reporter
    • imported

      public final List<Class> imported
  • Method Details

    • performTypeDeclaration

      public void performTypeDeclaration()
    • performTypeInitialization

      public void performTypeInitialization()
    • performTypeStructureChecking

      public void performTypeStructureChecking()
    • performTypeUsageChecking

      public void performTypeUsageChecking()
    • compile

      public static CompiledProgram compile(List<Module> input, IErrorReporter reporter, ClassLoader loader, List<Class> imported)
      This method compiles a program to its bytecode representation.
      Parameters:
      input - are the modules in the program that will be compiled.
      reporter - is used to report errors.
      loader - is the class-loader used to find previously loaded types.
      imported - are types to automatically import into every module.
      Returns:
      the bytecode representation of the compiled program; or null, if compilation fails.