Package iota

Class NEmitter

java.lang.Object
iota.NEmitter

public class NEmitter extends Object
A class for generating Marvin code.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Maps method identifier (ie, combination of its name and descriptor) to its address (ie, where the method is defined in the text segment of Marvin's main memory.
    static int
    Program counter for Marvin instructions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NEmitter(String sourceFile, CLFile clFile, String ra, boolean verbose)
    Constructs an NEmitter object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the destination directory for the .marv file.
    boolean
    Returns true if an emitter error has occurred up to now, and false otherwise.
    void
    Writes out .marv file to the file system.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • methodAddresses

      public static HashMap<String,Integer> methodAddresses
      Maps method identifier (ie, combination of its name and descriptor) to its address (ie, where the method is defined in the text segment of Marvin's main memory.
    • pc

      public static int pc
      Program counter for Marvin instructions.
  • Constructor Details

    • NEmitter

      public NEmitter(String sourceFile, CLFile clFile, String ra, boolean verbose)
      Constructs an NEmitter object.
      Parameters:
      sourceFile - the source iota program file name.
      clFile - JVM bytecode representation of the program.
      ra - register allocation scheme (naive or graph) to use.
      verbose - whether to produce verbose output or not.
  • Method Details

    • destinationDir

      public void destinationDir(String destDir)
      Sets the destination directory for the .marv file.
      Parameters:
      destDir - the destination directory.
    • errorHasOccurred

      public boolean errorHasOccurred()
      Returns true if an emitter error has occurred up to now, and false otherwise.
      Returns:
      true if an emitter error has occurred up to now, and false otherwise.
    • write

      public void write()
      Writes out .marv file to the file system. The destination directory for the files can be set using the destinationDir() method.